Please note: this is not the already-answered "IPv6 bridging+IPv4 NATing" question, but instead a "IPv6 bridging+DHCPv4 client on eth0+DHCPv4 server on wlan0" question.

For IPv4/IPv6 Dual Stack and IPv6-only system tests I would like to build a very peculiar "brouter" using Linux. This brouter has two pysical network interfaces, eth0 and wlan0. I'm using a bridge br0, to which I attach eth0 and wlan0.

Now for the overall context:

  • eth0 will be attached to either:
    1. an IPv6-only infrastructure with RAs that provide prefixes and DNS autoconfiguration, or alternatively
    2. an IPv6/IPv4 "home" network that has an IPv4/IPv6 router, offers IPv6 prefixes and DNS autoconfig, as well as DHCPv4 for address and DNS autoconfig.
  • wlan0 works in Access Point mode, to which wireless devices will later connect to, such as smartphones. These devices shall get full IPv6 connectivity, but only "limited" (local) IPv4 connectivity. That is, these devices should get a private IPv4 address, but there isn't any bridging or routing to the eth0 side when it comes to IPv4.

In view of the IP address families: - IPv6: this is straightforward using ebtables, because I just need to enable bridging of IPv6-typed Ethernet frames between all bridge ports. The bridge itself gets a SLAAC address using RAs received via eth0, as get all the mobile devices too. - IPv4: now that's where I'm slightly lost at the moment, because I want to achieve this slightly tricky behavior: - br0 should get an autoconfigured IPv4 address via DHCPv4 from the eth0 side, if there's a DHCPv4 server available, otherwise fall back to a static IPv4. So there's a DHCPv4 client that autoconfigures br0 at the moment. - eth0 should offer a DHCPv4 server to the attached mobile devices only. In particular, the bridge-local DHCPv4 client should not get its IPv4 configuration from the local DHCPv4 server.

The rationale for wanting a DHCPv4 client on eth0 is that I need to ssh into box for maintenance, and that is best done in a "home" network environment, but I need to switch between multiple home networks with different address ranges, so I cannot use a static configuration.

How can I run the DHCPv4 client and server on the same host, yet have them serve separate IP subnets/"segments"? Is this achievable using ebtables? Do I need to attach the client and server to the physical network interfaces instead in order to achieve my goal? If so, how is this done correctly, if that is sensible at all?


Sometimes, it is easier to add hardware than trying very hard to make software work in unexpected configurations. It's kind of teverse virtualization. (physicalization?)

In my case that means that is much easier to drop the need to run an DHCPv4 client on eth0. Instead, I simply allow it to claim an optional eth1 or wlan1 for maintenance/updates. Next, with the DHCPv4 client out of the way, the ISC DHCPv4 server happily accepts to be bound to wlan0(!) -- but don't bind it to br0.

So, br0 is used with IPv6 traffic destined to this device itself, and without any IPv4 address. eth0 is a physical bridge port, also without any IPv4 address. And wlan0 gets a static IPv4 address and has the DHCPv4 server sitting on it. For updates, connect another eth1 or wlan1 and do your work.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.