On Aug 4, 2014, at 1:39 PM, Christophe <[email protected]> wrote: > Hi misc@, > > I was wondering about the behavior of OpenBSD in this case (not a > production case at this time). > > 2 WAN interfaces (Ethernet / IPv4 DHCP) , linked to an OpenBSD box and 1 > LAN interface (Ethernet / IPv4 static address) > > WAN1 (em0 DHCP) ----- > |--- OpenBSD ----- LAN (em2 static) > WAN2 (em1 DHCP) ----- > > DHCP is providing a default gateway for the 2 WAN interfaces (and can > potentially change). > > First of all : > If only "dhcp" is specified in /etc/hostname.em[0|1] files, which of > these interfaces will provide the default gateway ? Is there a > precedence in this case ? > > Otherwise, is there anyway to specify a routing table in /etc/hostname.X > while using DHCP ? > Second question : > I used to write route-to and reply-to rules in pf.conf in a static context. > As far as I've seen, there are modifiers on interface specifications > like :network or :peer. But is there a :gateway or something similar > telling pf to use the defaut gateway learned by DHCP on the specified > interface ? >
I was just reading this article, which I think provides a different take on what I think you're trying to do. It uses ifstated to adjust pf rules dynamically based on usability of the WAN interfaces, load-balancing outbound connections between the two gateways as well: https://www.geeklan.co.uk/?p=1564 > Thanks and regards, > Christophe.

