0

My etc/network/interfaces file originally only included info regarding lo:

# The loopback network interface
auto lo
iface lo inet loopback

ifconfig shows me that eth0 is getting an IP from DHCP.

Here's what I want to do instead:

  • create a bridge group
  • take eth0 and eth1 and add them to the bridge group
  • eth0 and eth1 do not get IPs
  • assign ip address 192.168.1.253 to the bridge
  • add a default route

So the first thing I thought I should do is edit etc/network/interfaces to this:

# The loopback network interface
auto lo 
iface lo inet loopback

allow-hotplug eth0
iface eth0 inet manual
pre-up   ifconfig $IFACE up
pre-down ifconfig $IFACE down

allow-hotplug eth1
iface eth1 inet manual
pre-up   ifconfig $IFACE up
pre-down ifconfig $IFACE down

auto br0
iface br0 inet static
bridge_ports eth0 eth1
address 192.168.1.253
broadcast 192.169.1.255
netmask 255.255.255.0

If I reboot, eth0 grabs an IP from DHCP and the bridge is nowhere to be seen. However cat /etc/network/interfaces shows my config is still there

How can I check to see if something is overriding this config? (there's no interfaces.d directory)

Or is something wrong with my code as shown above?

I'm running WANem 3.0 on Knoppix

E C
  • 99
  • 2
  • 8
  • I would change `allow-hotplug` to `auto` for both interfaces. Also change `ifconfig $IFACE up` to `ip link set up dev $IFACE`, better to use `ip` instead of the deprecated `ifconfig`. – wurtel Jan 31 '19 at 12:27
  • thanks wurtel. Looks like eth0 no longer tries to get dhcp which is good. But each time I reboot, the bridge group is not there. I am trying to put eth0 and eth1 into a bridge group, assign that bridge a static IP and have it be consistent. (I also need to add a route - forgot to add that to my original post. So after creating the bridge with the static IP, I want to issue this last command: `route add default gw 192.168.1.88` – E C Jan 31 '19 at 16:38
  • For the gateway, add a line `gateway 192.168.1.88` below the `netmask` line. Do you get any errors if you run `/etc/init.d/networking restart`? – wurtel Feb 01 '19 at 13:48

0 Answers0