Chadster766 / McDebian

Linksys WRT3200ACM, WRT1900AC, WRT1900ACS, WRT1200AC and WRT32X Router Debian Implementation
98 stars 14 forks source link

DHCP not providing correct IP address to br0 on startup #19

Closed speedandy closed 7 years ago

speedandy commented 7 years ago

Since the update to 4.7.5 the router will not accept the static lease IP address that my modem/bridge provides.

If I do a /etc/init.d/networking restart, it comes back up with the correct IP.

It seems to me like the final MAC address is not what is provided to the DHCP server on startup.

auto lo br0

iface lo inet loopback

allow-hotplug wlan0
iface wlan0 inet manual

allow-hotplug wlan1
iface wlan1 inet manual

allow-hotplug eth0 eth1

iface eth0 inet manual
        pre-up /etc/dibbler/mcdebian-set-mac
        pre-up iptables-restore < /etc/iptables.up.rules
        pre-up ip6tables-restore < /etc/ip6tables.up.rules

iface br0 inet dhcp
        bridge_ports eth0 eth1 wlan1 wlan0
        address 192.168.1.1
        netmask 255.255.255.0
        network 192.168.1.0
        broadcast 192.168.1.255

Should I set it up as static, or is there a workaround?

Chadster766 commented 7 years ago

You should only have eth0 (WAN) connected to the upstream network.

Upon boot McDebian makes sure eth0 is always assigned the manufacturer MAC Address by running script /etc/dibbler/mcdebian-set-mac

Chadster766 commented 7 years ago

Did you need anymore help with this or should we close the issue?

speedandy commented 7 years ago

Sorry, I've been away and unable to respond. I've normally only got time for this on the weekend. Appologies, a pm may have been better...

I have the WRT set up as an access point, so I assume that the wan port should be bridged to the others?

I thought it was already called automatically on ifconfig up and ifconfig down? Should mcdebian-set-mac be added to the init script to raise the network, or to the if-pre-up.d script? Or do I just change eth0 to br0 in the mcdebian-set-mac script?

Chadster766 commented 7 years ago

No apology necessary :smile:

Your /etc/network/interfaces file looks right for a AP configuration.

I think you are right.

Try:

  1. In /etc/network/interfaces move "pre-up /etc/dibbler/mcdebian-set-mac" from eth0 to br0 section
  2. Then in /etc/dibbler/mcdebian-set-mac change eth0 to br0 as well