Existing default gateway causes to fail to bring fully up a device

Bug #1390777 reported by Removed by request
10
This bug affects 1 person
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/interfaces (the wpa-psk is replaced with asterisks):

# 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/if-pre-up.d
run-parts: executing /etc/network/if-pre-up.d/wireless-tools
run-parts: executing /etc/network/if-pre-up.d/wpasupplicant
ip addr add 192.168.1.3/255.255.255.0 broadcast 192.168.1.255 dev eth0 label eth0
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/if-up.d
run-parts: executing /etc/network/if-up.d/000resolvconf
run-parts: executing /etc/network/if-up.d/upstart
run-parts: executing /etc/network/if-up.d/wpasupplicant
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/if-pre-up.d
run-parts: executing /etc/network/if-pre-up.d/wireless-tools
run-parts: executing /etc/network/if-pre-up.d/wpasupplicant
wpa_supplicant: wpa-driver nl80211,wext (default)
wpa_supplicant: /sbin/wpa_supplicant -s -B -P /var/run/wpa_supplicant.wlan0.pid -i wlan0 -D nl80211,wext -C /var/run/wpa_supplicant
Starting /sbin/wpa_supplicant...
wpa_supplicant: waiting for "/var/run/wpa_supplicant.wlan0.pid": 0 (max. 5)
wpa_supplicant: creating sendsigs omission pidfile: /run/sendsigs.omit.d/wpasupplicant.wpa_supplicant.wlan0.pid
wpa_supplicant: ctrl_interface socket located at /var/run/wpa_supplicant/wlan0
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.1.4/255.255.255.0 broadcast 192.168.1.255 dev wlan0 label wlan0
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.

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in ifupdown (Ubuntu):
status: New → Confirmed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.