network has to be started each time system is booted

Bug #50099 reported by Joachim Noreiko
24
Affects Status Importance Assigned to Milestone
ifupdown (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

Each time I use my machine, my network isn't working: when I boot up, and launch firefox, it says the page can't be found.

I open the Networking prefs, open the ethernet properties, disable the connection, then renable -- and then everything works again. But I have to go through these steps each time I boot up.

Revision history for this message
Ixzat (mickeu) wrote :

I have the same problem, for more info, check out the followin forum post: http://ubuntuforums.org/showthread.php?t=193850

Revision history for this message
Ixzat (mickeu) wrote :

Well, looks like it sorted itself out somehow... The only differance in my system is that i installed the k7 kernel instead of the default one, and then todays gnome updates. Besides from that, i havent touched anything.

Revision history for this message
Andrew Evans (andyjevans) wrote :

I have the same problem; I need to deactivate then reactivate eth0 every time I reboot.

Revision history for this message
Dennis Kaarsemaker (dennis) wrote : Re: [Bug 50099] network has to be started each time system is booted

Please attach /etc/network/interafces

Revision history for this message
Joachim Noreiko (jnoreiko) wrote :

Mine is as follows:
-----------
# 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

# This is a list of hotpluggable network interfaces.
# They will be activated automatically by the hotplug subsystem.
auto eth0

iface eth0 inet dhcp
 pre-up /sbin/ifconfig $IFACE mtu 1400

-----------

The forum thread linked to in the first comment has others from users with the same problem.

Revision history for this message
Joachim Noreiko (jnoreiko) wrote :

I have noticed something that may be relevant:

If my router is already running (eg I have rebooted from Windows into Ubuntu) then this problem does not occur.

Revision history for this message
Axel (pejuaxel) wrote :

I have the same problem. I need to deactivate and reactivate eth0 from Gnome networking prefs. There is my /etc/network/interafces :

auto lo eth0
iface lo inet loopback

iface eth0 inet static
address 192.168.1.102
netmask 255.255.255.0
gateway 192.168.1.1
wireless-essid kothlis
wireless-mode managed

Revision history for this message
Mark Ferguson (markfergy) wrote :
Download full text (4.2 KiB)

I think I have found a solution to this problem, well it's fixed things for me.

This is quite a verbose answer if you are not interested in all the details, see
the section labeled FIX at the bottom for the file to change.

There are two systems that I have found that deal with the network interfaces during boot.

The networking script in /etc/init.d (started from /etc/rcS.d)

And the udev system, which is started before the networking script in /etc/rcS.d

udev uses the /etc/udev/rules.d/85-ifupdown.rules to define it's network rules.

I am not sure how these to systems relate to each other, only that udev is
started before the networking.

I knew that there was nothing wrong with the networking script, as I used this
to restart the network interfaces successfully after boot.

Both the networking script and 85-ifupdown.rules file use ifup as the command
to bring the network up.

Contents of 85-ifupdown.rules:

/***********************************************************************/
SUBSYSTEM!="net", GOTO="net_end"

# Bring devices up and down only if they're marked auto.
# Use start-stop-daemon so we don't wait on dhcp
ACTION=="add", RUN+="/sbin/start-stop-daemon --start --background --pidfile /var/run/network/bogus --startas /sbin/ifup -- --allow auto $env{INTERFACE}"
ACTION=="remove", RUN+="/sbin/start-stop-daemon --start --background --pidfile /var/run/network/bogus --startas /sbin/ifdown -- --allow auto $env{INTERFACE}"

LABEL="net_end"
/*********************************************************************/

This is the bit we are interested in:

/sbin/ifup -- --allow auto $env{INTERFACE}

I noticed that there was something not quite right with this command.

The "--" after /sbin/ifup means that there are no more options after this
point on the command line. Anything after this point is considered a
parameter. For the ifup command "--allow" and "auto" are thought to
be interfaces to be brought up, which is incorrect.

For example this is the error reported from ifup if I run the command manually
(ath0 is my wireless card)

/sbin/ifup -- --allow auto ath0

Ignoring unknown interface --allow=--allow.
Ignoring unknown interface auto=auto.

Though running this from the command line will still bring ath0 up.

The command "/sbin/ifup -- --allow auto $env{INTERFACE}" is supposed to mean
bring the network up if it is defined in the network interfaces file with auto

I tried running the same command for my eth0 interface which is not defined as
auto in the interfaces file. The interface was brought up, which it should not
have been.

If I correct the command to not include the -- after /sbin/ifup things work
as expected ie:

/sbin/ifup --allow auto ath0
(brings up ath0 with no errors)

/sbin/ifup --allow auto eth0
(does nothing as expected)

FIX to /etc/udev/rules.d/85-ifupdown.rules: Remove unnecessary "--" from ifup and ifdown cmds.
/***********************************************************************/
SUBSYSTEM!="net", GOTO="net_end"

# Bring devices up and down only if they're marked auto.
# Use start-stop-daemon so we don't wait on dhcp
ACTION=="add", RUN+="/sbin/start-stop-daemon --start --background --pidfile /var/run...

Read more...

Revision history for this message
Axel (pejuaxel) wrote :

I've tried your fix. It doesn't work for me. Boot is just longer when initializing network... But once under Gnome, network is still not correctly up.

iwconfig returns that my acces point is invalid. After deactivate/reactivate, network is up.

Revision history for this message
peter (peter-blackburnsonline) wrote :

Using usb WiFi
Now totally confused

Tried Mark Ferguson's fix certainly worked but introduced a 3 minute delay during booting. Leaving router up powered down ubuntu 20 times back every time.

Then I undid the changes to etc/udev/rules.d/85-ifupdown.rules putting the == back. The 3 minute delay disappeared but the problem did not come back either. Again powered up and down 20 times with no loss of network.

Revision history for this message
peter (peter-blackburnsonline) wrote :

Sorry retract last part of above the next day the problem was back

So at have gone back to Mark's fix and am living with the delay.

Revision history for this message
peter (peter-blackburnsonline) wrote :

After 5 days with no problem the original problem is back again. Mark's fix is still there, the boot delay is still there, and I never knowingly applied any updates from ubuntu.

Revision history for this message
Tom M. (wvm7fk202-deactivatedaccount) wrote :

I can confirm this works for me.

Ubuntu Edgy 6.10 (amd64)
Using madwifi drivers in linux-restricted-modules

My /etc/network/interfaces :

auto ath0
iface ath0 inet manual
   wpa-roam /etc/wpa_supplicant.conf

iface default inet dhcp

(I followed the instructions from /usr/share/doc/wpasupplicant/README.modes.gz)

Interface doesn't come up on boot. (ifup/ifdown "thinks" it's up..)

Putting this in /etc/rc.local fixes the problem:

/sbin/ifdown ath0
/sbin/ifup ath0
exit 0

Also, running /etc/init.d/networking restart will make it come back as well.

wpa_supplicant and wpa_cli (used for the roaming mode) never get started by the networking script upon the initial bootup.

Revision history for this message
Micah Cowan (micahcowan) wrote :

Setting to Confirmed, as several people seem to experience the problem, so as to get it off of the untriaged bugs list.

Revision history for this message
Philip Paquette (pcpaquette) wrote :

Setting package temporarily from (undefined) to network-manager.
This bug seems to be related to dapper, and since then, many improvements have been made to the way Ubuntu handles the network connection. Can anyone confirms this bug still happens in edgy/feisty....

Thank you...

Changed in network-manager:
assignee: shooters → nobody
status: Needs Info → Confirmed
Revision history for this message
Martin Pitt (pitti) wrote :

Mark, this is actually right:

ACTION=="add", RUN+="/sbin/start-stop-daemon --start --background --pidfile /var/run/network/bogus --startas /sbin/ifup -- --allow auto $env{INTERFACE}"

The '--' applies to start-stop-daemon, not to ifup. Everything after -- is passed as arguments to the program given in --startas, so this is resolved to

  ifup --allow auto ethX

Joachim, do you still have this problem on Feisty?

Revision history for this message
Martin Pitt (pitti) wrote :

This was reported against Dapper where we didn't install network-manager. Joachim, do you actually use network-manager in Dapper? Does uninstalling help?

Revision history for this message
Martin Pitt (pitti) wrote :

Oh, and please attach /etc/network/interfaces, this info is still missing. (I suspect a missing 'auto' line)

Revision history for this message
Darren Davison (darren-davisononline) wrote :

guys, this may or may not be relevant but I just had 6 weeks of frustration with wpa-roam under feisty. The following might help you: http://www.zxsoftware.co.uk/Softwareindex.php?action=title_details&id=3965

apologies for the noise if it's not relevant.

Regards

Revision history for this message
Darren Davison (darren-davisononline) wrote :

oops - pasted wrong URL. Sorry 'bout that!!
http://ubuntuforums.org/showthread.php?p=2489740 - try that one instead

Revision history for this message
Tom M. (wvm7fk202-deactivatedaccount) wrote :

I can confirm this on a Feisty machine that uses wireless (madwifi drivers)

My /etc/network/interfaces has 'auto ath0' and 'wpa-conf /etc/wpa_supplicant.conf' lines in it.

I have to manually do ifdown ath0; ifup ath0 to get it to come up properly.
Sticking that in /etc/rc.local seems to do the trick, but it would be nice not to have to do that.

Revision history for this message
Joachim Noreiko (jnoreiko) wrote :

I can confirm on an upgraded Feisty machine, using ethernet.

Revision history for this message
Johannes Ballé (jballe) wrote :

I can confirm this bug for Feisty using ipw2100 in a wpa_roam setup. No network management software involved, just a hand-edited /etc/network/interfaces like so:

auto lo
iface lo inet loopback

allow-hotplug eth0
iface eth0 inet dhcp

auto eth1
iface eth1 inet manual
        wpa-driver wext
        wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf

iface default inet dhcp

ifup "thinks" eth1 is up after booting (the kernel interface actually is up), but wpa_supplicant and wpa_cli aren't running. I have to ifdown and ifup eth1 after each boot to connect.

Revision history for this message
Guillaume Duveau (guix) wrote :

Confirming on a Thinkpad Z60t Feisty kernel 2.6.20-16-generic, with a ar5212 wireless card from Atheros and the madwifi drivers provided in Ubuntu restricted.
I have to restart the network to enable it with ath0.

Revision history for this message
Paul van Genderen (paulvg) wrote :

If ifup says "interface $IF already configured", but it's really not configured on boot, then perhaps the file /var/run/network/ifstate is stale. ifdown $IF; ifup $IF fixes the problem, but if the problem persists, check that file to see if that interface is listed before /etc/init.d/networking runs. Try a live or install CD, or boot Ubuntu with 'init=/bin/bash' (and no splash) on the kernel commandline.

If 'ifconfig' lists the interface but it does not work, then must have been configured once already.

Revision history for this message
Eugene (varnav) wrote :

Same thing after upgrade from 7.04 to 7.10 - network has to be turned off and on again to get started, and does not start manually.

Revision history for this message
Eugene (varnav) wrote :

Fix from Mark Ferguson helps. Hope there will be no problem with upcoming tribe-5 of Gutsy. I will test that.

Revision history for this message
Eugene (varnav) wrote :

Mark Ferguson offered working bugfix.

Changed in ifupdown:
assignee: nobody → keybuk
status: Confirmed → Fix Committed
Revision history for this message
Tormod Volden (tormodvolden) wrote :

Please don't assign bugs to other people without good reasons.

Comment #16 explains why Mark's fix is not the right solution.

Changed in ifupdown:
assignee: keybuk → nobody
status: Fix Committed → Confirmed
Revision history for this message
Eugene (varnav) wrote :

Sorry for that, but I thought Scott is in charge for ifupdown.
Anyway, bug still in there. No ideas?

Revision history for this message
Eugene (varnav) wrote :

I confirm this bug in tribe-5 fresh install

Revision history for this message
Mika Fischer (zoop) wrote :

I have the same problem with an up-to-date gutsy install. My network is simple ethernet. The /etc/network/interfaces is what Ubuntu installed by default, i.e.

auto eth0
iface eth0 inet dhcp

and the same for lo, eth1, eth2, ath0 and wlan0.

Revision history for this message
Mika Fischer (zoop) wrote :

Oh, and I forgot to say that I didn't have this problem in Feisty...

Revision history for this message
Eugene (varnav) wrote :

For me, this bug does not happen every boot. Sometimes net works on boot, sometimes - not.

Revision history for this message
tim_o (tle) wrote :

I am also running into this problem in Gutsy Tribe 5. I have a laptop which uses the ipw3945 wireless driver, and i use wpasupplicant through /etc/network/interfaces.

My solution (reached independently) has been to disable the udev rule entirely:
sudo mv /etc/udev/rules.d/85-ifupdown.rules /etc/udev/rules.d/85-ifupdown.rules.bak

This rule appears to invoke ifup on the wireless interface too soon, and prevents wpasupplicant from loading properly as defined in /etc/network/pre-up.d/wpasupplicant.

Revision history for this message
Davide Capodaglio (davidecapod) wrote :

I have the same problem in a fresh install of Gutsy, final release...
I totally uninstalled network-manager because I don't need it at all (I have only an ethernet interface, statically configured) and because the loopback interface was not automatically brought up.
Now eth0 is not brought up too...

ghost@Ubuntu:~$ cat /etc/network/interfaces
auto lo
iface lo inet loopback

iface eth0 inet static
address 192.168.1.2
netmask 255.255.255.0
gateway 192.168.1.1
auto eth0

Revision history for this message
Mark Ferguson (markfergy) wrote :

For those who are going to use or have tried my fix.
Martin is correct.

ACTION=="add", RUN+="/sbin/start-stop-daemon --start --background --pidfile /var/run/network/bogus --startas /sbin/ifup -- --allow auto $env{INTERFACE}"
The '--' applies to start-stop-daemon, not to ifup. Everything after -- is passed as arguments to the program given in --startas, so this is resolved to

 ifup --allow auto ethX

I must have missed the section of the man page for start-stop-daemon that explains this.

If you apply my fix 'ifup' and 'ifdown' will probably run without any arguments and effectively do nothing.
This is most likely why the problem disappeared for me because the network interfaces where not being brought up by udev.

Revision history for this message
Davide Capodaglio (davidecapod) wrote :

Found the problem, it was my fault: the /var directory (that resides on another partition) was not mounted properly at boot.
Fixing this fixed my networking problem (/var/run was missing and start-stop-daemon was complaining about it).

Revision history for this message
Joachim Noreiko (jnoreiko) wrote :

Seeing same problem in a fresh install of Xubuntu 7.10

Revision history for this message
Olivier Mengué (dolmen) wrote :

See also bug #53387 and bug #69839.

Revision history for this message
Eric Donkersloot (ericd) wrote :

"My solution (reached independently) has been to disable the udev rule entirely:
sudo mv /etc/udev/rules.d/85-ifupdown.rules /etc/udev/rules.d/85-ifupdown.rules.bak"

I can confirm this solved the issue.

Revision history for this message
Joachim Noreiko (jnoreiko) wrote :

I'm confused why this bug has just been marked as a duplicate of Bug #53387 because that bug only mentions wireless.
This bug makes Ubuntu unusable on a wired network.

Revision history for this message
Saivann Carignan (oxmosys) wrote :

Since most of comments here speaks about wireless and that wire-networks isn't mentioned in the description of the bug, I think that it would be a great idea for people which has this bug with a wired network to open a new bug report for that specific case, it would be cleaner and this would help developers fixing the issue. People who have problems with wireless should look at bug 53387 and contribute here.

Revision history for this message
gcordoba (glgcg) wrote :

I disagree with Saivann. It could be the same bug which is producing problems in both wireless and wired networks. I am sure that just one fix is needed for both.
By the way, the Tom M's tip worked for me. Even for static IP (see comment by FOX on 2007-10-10, bug #53387) it works fine (by commenting and uncommenting the needed lines):

#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.

#/sbin/ifconfig eth0 xxx.xxx.xxx.xx netmask xxx.xxx.xxx.xx up
#/sbin/route add -net default gw xxx.xx.xxx.xx

/sbin/idown eth0
/sbin/ifup eth0
exit 0

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.