Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Is there a way to force the network connection to be active before logging in?

I have a debian (squeeze 6.0.5 64 bit) workstation, and I would like the network connection to be activated directly on powerup. Right now, the network connection (wired LAN, DHCP) activates only when I log in.


Additional info:

File: /etc/network/intefaces

# 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
allow-hotplug eth0
#NetworkManager#iface eth0 inet dhcp 
share|improve this question
    
Do you have any customizations to the configuration which would affect networking? What kind of network are you connecting to? Wired ethernet should already be connecting on boot-up. –  Darth Android Aug 2 '12 at 16:35
    
@DarthAndroid No, I don't have any customizations... I agree with you, but for some reason, the network only connects after I log in (for the first time after power up). After that, there's no problem. My solution has been to keep my computer on 24 / 7... Of course, on the event of a power failure it losses its connection. –  Barranka Aug 2 '12 at 16:39
    
Is it simple ethernet, PPPOE, WiFi, a VPN tunnel...? What are the contents of /etc/network/interfaces ? –  Darth Android Aug 2 '12 at 16:42
    
@DarthAndroid I've edited the question to include the info you request. Thank you! –  Barranka Aug 2 '12 at 16:48
1  
move iface eth0 inet dhcp down a line. Right now it is commented out. –  Rob Aug 2 '12 at 16:54
add comment

1 Answer

up vote 1 down vote accepted

The issue is you have a userspace program which manages your wired connection, called NetworkManager. Since this program doesn't start until login, your ethernet is not available until it starts up and configures it.

If you're willing to forgo the ease of reconfiguring with the GUI, try this:

  1. Back up your interface file: sudo cp /etc/network/interfaces /etc/network/interfaces.bak
  2. Edit your interface file: sudo nano /etc/network/interfaces
    1. Tell it to bring up eth0 automatically by changing the auto lo to auto lo eth0
    2. Remove the #NetworkManager# part from the last line, so that it reads iface eth0 inet dhcp
    3. Ctrl+O to save, Ctrl+X to exit.
  3. Reboot your computer.

If that doesn't fix it, just restore the backup to revert the changes and continue troubleshooting: sudo cp /etc/network/interfaces.bak /etc/network/interfaces

Following these changes, you will need to manage your network interface manually. You should read up on ifconfig and the /etc/network/interfaces file. It would probably also be good to read up on NetworkManager.

share|improve this answer
    
It works! But now there's another issue: I can't connect to my computer from another workstation :s (I need to be able to connect with smb). I'm able to connect with ssh and mysql... but smb somehow doesn't work now (It worked fine before). –  Barranka Aug 2 '12 at 17:15
    
Forget it, it works... somehow it just took some minutes to work again. Thanks a lot!!!!! –  Barranka Aug 2 '12 at 17:21
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.