HOWTO: Enable Wired Networking on Boot in Ubuntu Linux without NetworkManager

A lot of Linux distros are going to applet-based management of their network connections in their desktop flavors. For example, Ubuntu Linux Desktop Edition has been using the Gnome applet NetworkManager since at least 9.10 Karmic Koala. While it works great most of the time, I’ve run into issues with it several times.

UPDATE:I believe this issue may have gone away with recent versions of NetworkManager.
The first was that (at least with 9.10) while NetworkManager was running from boot, it didn’t start receiving commands to connect until the user initiated their Gnome session by logging in. If you wanted to run an SSH server on the machine, you wouldn’t be able to connect to it until a local user logged in.

The second issue is that I often times end up using the Desktop Edition in a server-like capacity and turn gdm/X off entirely. The Desktop Edition has a shorter-lead time for package updates (which can be both a blessing and a curse). In my experience it’s also easier to find help/info on it versus the Server Edition. I recently setup a machine to act as a server for my dad, connecting to his weather station’s base station and uploading the results online. I ended up using the Desktop Edition of 11.04 because the server version didn’t have support out-of-the-box for some of his hardware.

Anyways, while I found it maddening to find a solution to initially, like many things Linux, once you know the magic incantation to recite, it’s cake.

Remove NetworkManager

This is optional and many of you may want or need to keep it around. For me, in the cases where I need to use this at all, I find it easier just to completely remove NetworkManager from the picture.

sudo apt-get remove network-manager

Enable Wired Interface

Put an entry in /etc/network/interfaces for eth0 (or eth1, or whatever your wired interface is).

Option 1: DHCP

auto eth0
iface eth0 inet dhcp

Option 2: Static IP

auto eth0
iface eth0 inet static
address 192.168.0.10
gateway 192.168.0.1
netmask 255.255.255.0
network 192.168.0.0
broadcast 192.168.0.255

Now your network interface should come up on boot, without NetworkManager!

Comments

One response to “HOWTO: Enable Wired Networking on Boot in Ubuntu Linux without NetworkManager”

  1. Mike Avatar
    Mike

    Thank you!
    Network manager is a big pest in my situation. I have a permanently connected (hopefully) always available wired network and NO other networking hardware on my machines. Network manager is fluffing around trying to start up modems, wireless, 3G, bluetooth! and it seems that some network dependant stuff (nslcd) isn’t coping well with this at all.
    All I wanted was to start eth0 with dhcp without all the extra messing about, and now I can. Thanks heaps!
    Mike

Leave a Reply

Your email address will not be published. Required fields are marked *

*

This site uses Akismet to reduce spam. Learn how your comment data is processed.