Note: I couldn't find a straight-forward answer in any of the duplicates flagged for this question. The problem is the "right answer" seems to depend very heavily on which release you are running and whether you have a desktop or server profile. I have a bit of both because I installed lubuntu-core to provide some basic remote X functionality and it seems NetworkManager was installed as well but we prefer to edit our network config by hand not use the GUI tools.
Situation is I have a remote Ubuntu 14.04 server I need to reconfigure networking on. I need to safely add a bridged interface eth1
to the remote system without breaking remote connectivity. I have a new /etc/network/interfaces file I want to load but because I don't have an equivalent machine to test it on or physical access to the server I have some questions about my new configuration:
- Is the gateway configuration and metric in the file below valid for what I'm trying to do and,
- Will network manager override or interfere with what I'm doing here? Currently when I
ifup eth1
network manager just brings it down automatically. I'm afraid to disable NM in case it kills the remote connection, and - If I reboot the system with the updated file and my current configuration should it be able to receive a remote SSH connection when it comes back up?
The server has NetworkManager currently running however I don't need it. I only care that the configuration in /etc/network/interfaces is used and that the machine remains accessible for remote SSH login at all stages of reconfiguration (ie, I do not want to get locked out by a misconfiguration or by taking both interfaces down without a script or reboot automatically and correctly bring them back on).
eth0
is the default interface for host traffic. eth1
is going to be a bridge for a KVM virtual machine with it's own external IP address. Both interfaces connect to the same physical switch and share the X.X.X.0/24 subnet. My understanding is I need a bridge for this to work BUT I also need to be careful about my gateways and metrics because I have 2 interfaces on the same network.
The host currently has the following NetworkManager status:
# nmcli d status
DEVICE TYPE STATE
eth1 802-3-ethernet unavailable
eth0 802-3-ethernet unmanaged
And configuration in NetworkManager.conf:
[ifupdown]
managed=false
I've created the new config below:
# interfaces(5) file used by ifup(8) and ifdown(8)
auto lo
iface lo inet loopback
# The primary network interface
auto eth0
iface eth0 inet static
address X.X.X.4
netmask 255.255.255.0
network X.X.X.0
broadcast X.X.X.255
gateway X.X.X.1
# dns-* options are implemented by the resolvconf package, if installed
dns-nameservers X.X.X.2
dns-search example.com
# Interfaces with lower values get used first
metric 10
### NEW BRIDGED INTERFACE ON ETH1 ###
auto eth1
iface eth1 inet static
address X.X.X.7
netmask 255.255.255.0
network X.X.X.0
broadcast X.X.X.255
# do I need gateway here or will it conflict with eth0 ?
# gateway X.X.X.1
metric 20
auto br0
iface br0 inet static
address X.X.X.200
netmask 255.255.255.0
network X.X.X.0
broadcast X.X.X.255
gateway X.X.X.1
bridge_ports eth1
bridge_stp off
bridge_maxwait 5
# dns-* options are implemented by the resolvconf package, if installed
dns-nameservers X.X.X.2
dns-search example.com
metric 30
As I said though, with this new config just added to the server an ifup eth1
only works until NM decides to remove it. That's making testing anything problematic but I'm worried simply disabling NM could be much worse.