Existing default gateway causes to fail to bring fully up a device
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
ifupdown (Ubuntu) |
Confirmed
|
Undecided
|
Unassigned |
Bug Description
I'm using Ubuntu 15.04 dev with ifupdown 0.7.48.1ubuntu5. My network contains a router which is able to handle connections over LAN and WLAN but if a client is configured to have this router as gateway on his ethernet and WLAN device the second device which is brought up causes an error on ifup. Here is such a client setup from /etc/network/
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
#auto eth0
iface eth0 inet static
address 192.168.1.3
dns-nameservers 192.168.1.1
gateway 192.168.1.1
netmask 255.255.255.0
#auto wlan0
iface wlan0 inet static
address 192.168.1.4
dns-nameservers 192.168.1.1
gateway 192.168.1.1
netmask 255.255.255.0
wpa-psk ***
wpa-ssid o2-WLAN65
Bringing up these devices manually results in this output:
root@ubuntu:~# ip route
root@ubuntu:~# ifup -v eth0
Configuring interface eth0=eth0 (inet)
run-parts --exit-on-error --verbose /etc/network/
run-parts: executing /etc/network/
run-parts: executing /etc/network/
ip addr add 192.168.
ip link set dev eth0 up
ip route add default via 192.168.1.1 dev eth0
run-parts --exit-on-error --verbose /etc/network/
run-parts: executing /etc/network/
run-parts: executing /etc/network/
run-parts: executing /etc/network/
root@ubuntu:~# ip route
default via 192.168.1.1 dev eth0
192.168.1.0/24 dev eth0 proto kernel scope link src 192.168.1.3
root@ubuntu:~# ifup -v wlan0
Configuring interface wlan0=wlan0 (inet)
run-parts --exit-on-error --verbose /etc/network/
run-parts: executing /etc/network/
run-parts: executing /etc/network/
wpa_supplicant: wpa-driver nl80211,wext (default)
wpa_supplicant: /sbin/wpa_
Starting /sbin/wpa_
wpa_supplicant: waiting for "/var/run/
wpa_supplicant: creating sendsigs omission pidfile: /run/sendsigs.
wpa_supplicant: ctrl_interface socket located at /var/run/
wpa_supplicant: configuring network block -- 0
wpa_supplicant: wpa-ssid "o2-WLAN65" -- OK
wpa_supplicant: wpa-psk ***** -- OK
wpa_supplicant: enabling network block 0 -- OK
ip addr add 192.168.
ip link set dev wlan0 up
ip route add default via 192.168.1.1 dev wlan0
RTNETLINK answers: File exists
Failed to bring up wlan0.
ifup calls "ip route" to setup the default gateway for wlan0 but fails because it already exists for eth0. Maybe ifup should check if a default gateway already exists and not call "ip route" in such a case.
Status changed to 'Confirmed' because the bug affects multiple users.