On 2013-02-13, What you get is Not what you see <[email protected]> wrote: > Hi > I have a pf box with 4 links (a multihomed box ) and some services like > dns,dhcp on it. > I have set /etc/mygate to one of the gateways. > Sometimes the line drops and when it drops, obviously some services like > dns stop. > But the other lines are up then. > What is the proper way of handling mygate? > Do you suggest mpath? > >
You can list multiple gateways in priority order (I would usually add these in hostname.if files e.g. "!route add....") route add default -priority 10 10.1.1.1 route add default -priority 12 10.2.2.2 *If* the interfaces lose link when the connection is down, it will fall back to the next in priority order. (lowest number = highest priority; default for a statically configured route is 8). This works nicely with pppoe(4) but in many configurations where you pass to another local router, you may need a bit more than this. In some cases you can handle checking and adding/removing routes via relayd, see the ROUTERS section in relayd.conf(5). You do not need mpath for this. mpath will do load balancing between multiple routes with the same priority. This is useful in some cases. But note this is done in the style of RFC2992 and balancing depends on source/destination address pairs, it does not increase bandwidth to a single host (or a VPN connection to a single other endpoint). Also note that in order to do this you will need your upstream ISP/s to accept packets from the source addresses associated with other lines (and in the case of multiple upstreams going via different ISPs they would need to accept packets with source addresses in *some other ISP's address space*). Some permit this anyway (but are not following best practices and you can't rely on them to keep on doing it); others may permit it on reqeuest (maybe with limits) and others just plain won't allow it.

