Multiple dhclients and next hops towards a single ISP, yet a single dhcp-server-identifier
I have an OpenBSD machine as a router/firewall. It has 4 ethernet interfaces:
re0, em0, em1 and em2. All emX -interfaces are connected to the same
ADSL box, re0 connects to my home network switch.
My subscription allows me to have 5 public IP addresses, so
this way I can fetch 3 of them. 2 of the IPs are binat'ed to two different
hosts in my home network, and the third one is a regular nat for the rest
of the nodes. Once I got it up and running (with some minor patches
to dhclient-script and rc), I faced a new problem with dhclient
for which I can't find information from man pages or Google. Before
getting to source code I decided to spam you.
All interfaces em0, em1 and em2 get a different next hop. I use
mpath routing with three default routes, one to each interface. The
problem seems to be that the next hop on one of the interfaces (em1)
is also used as the dhcp-server-identifier by my ISP for all the
three leases (em0, em1, em2). Therefore, also the dhclients on em0
and em2 try to send DHCP renews to that address. But it seems to
get routed to em1:
May 12 11:25:08 fw dhclient: DHCPREQUEST on em2 to 220.127.116.11 port 67
May 12 11:25:08 fw dhclient: send_packet: No route to host
May 12 11:25:20 fw dhclient: DHCPREQUEST on em1 to 18.104.22.168 port
May 12 11:25:20 fw dhclient: DHCPACK from 22.214.171.124
May 12 11:25:20 fw dhclient: bound to 126.96.36.199 -- renewal in 5180
I wonder why dhclient looks up the routing table instead of preferring
the interface its sitting on. Can this be somehow changed (without patching
code)? I know this DHCP server is reachable via any of the three interfaces.
Maybe I could manually (i.e. in dhclient-script) add mpath routes to this
DHCP server's address for each interface?