Two interfaces sharing the same IP address: how to change default route's interface on link change?

Niki Denev nike_d at cytexbg.com
Tue Feb 19 23:27:08 UTC 2008


On Feb 20, 2008 12:16 AM, Jeremie Le Hen <jeremie at le-hen.org> wrote:
> Hi list,
>
> I have two network interfaces that share the same IP address.  I would
> like tochange the default route's interface when the link changes.  I
> think it could be possible to hack up something with devd(8) or
> net/ifstated, but this would be quite ugly.
>
> FWIW, I have a wired (bge0) and a wireless adapter (ral0).  What I would
> like is:
> - When I unplug the cable, switch to the wireless adapter.
> - When I plug the cable in, switch to the wired adapter.
>
> In summary, favor wired connectivity over the wireless one, at any time:
> could this be at boot time or not.
>
> I'm pretty sure I'm not the only one who wants this kind of setup.  So
> how did you achieve this setup?
>
> Thank you.
> Regards,
> --
> Jeremie Le Hen
> < jeremie at le-hen dot org >< ttz at chchile dot org >

lagg(4) can do this.
There is an example in the man page.

  --Niki


More information about the freebsd-net mailing list