Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm trying to understand the logic behind the failure in the following scenario:

a. If a linux bridge with 2 interfaces, eth0 (LAN) and eth1 (WAN) is behind an ISP device e.g. a cable modem, it does not receive an ip address even if the bridge interface (br0) is set to do so. Instead, it forwards the DHCP offer to the device behind the bridge i.e. whatever device is connected to eth0.

The command dhclient br0 indicates that no leases get offered at all and dhclient then goes back to the leases recorded in dhclient.leases, which are old and irrelevant.

However,

b. if the bridge is inside the LAN itself with eth1 being exposed to an internal DHCP server, it does retrieve an ip address. And so do the devices behind it.

The /etc/network/interfaces contains:

auto lo eth0 eth1 br0
iface eth0 inet dhcp
iface eth1 inet dhcp
iface br0 inet dhcp
     bridge_ports eth0 eth1
     bridge_stp off
  1. This is puzzling. Any idea why this is happening? What's different in b vs. a?
  2. Is there a way to force br0 to obtain an ip address first and not pass it downstream?
share|improve this question

1 Answer 1

Your cable modem is almost certainly restricted to serving IPs via DHCP to a single "learned" MAC address, which is the MAC of the eth1 interface, not the bridge's MAC.

Side note: If you're bridging those ports, then your LAN is directly connected to the WAN, hence not a LAN anymore... Hope you've accounted for this and have appropriate security.

share|improve this answer
    
Thanks Chris. Yes, I have accounted for that. I was just more curious about why this was happening. How is the modem be smart enough to "jump" the mac address of the bridge? –  Bourne Feb 10 '12 at 22:22
    
The modem isn't just a modem, it's also a router (with some firewalling capability and traffic shaping; they're much more advanced than people generally think). –  Chris S Feb 10 '12 at 23:59
    
Right, that makes sense. Any idea why it would bypass the bridge when it comes to DHCP though? –  Bourne Feb 11 '12 at 8:00
    
The NIC's MAC would already be registered in the Modem, so it plain wont talk to anything else; anything at all even a "bridge" interface on the same device. –  Chris S Feb 11 '12 at 15:11
    
I assume that by NIC you're referring to eth1. It's actually not giving an ip address to the eth1 MAC on the bridge but to the first device that's connected through eth0, which is an entirely separate device on the LAN side. So in essence, the modem is skipping the bridge's MAC, the eth1's MAC and the eth0's MAC. It would make sense if eth1 got the ip address but it's not. That's what I find puzzling. –  Bourne Feb 12 '12 at 17:36

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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