0

I used this QUESTION to configure the default of Ubuntu 14.10 to start in RUNLEVEL 1

but when I switch to another RUNLEVEL (2,3,or 5) , there is no network connection and I have to start the network using command NetworkManger

is this a normal behaviour , and if not how to configure the network to start automatically when I switch run levels

Fat Mind
  • 2,485

1 Answers1

0

Network manager is in fact a (local) server, that acts on requests of a (local) client. This client is normaly the network applet in a desktop and thus of course belongs to a GUI session.

Small explain

-----------------------------------------------------------------------------------------------------------------------------
| run level |             name                |     Description                                                             |
-----------------------------------------------------------------------------------------------------------------------------
|     2     |         Multi-User Mode         | Does not configure network interfaces and does not export networks services |
|     3     | Multi-User Mode with Networking | Starts the system normally                                                  |
|     4     | Not used / user definable       | For special purposes                                                        | 
|     5     | System normally with GUI        | Run level 3 + display manager                                               |
-----------------------------------------------------------------------------------------------------------------------------

Propose for you is to disable Network Manager and configure interfaces manually.

Stop the Network Manager process

sudo service network-manager stop

Disable it

echo "manual" | sudo tee /etc/init/network-manager.override

or you can remove NetworkManager from the system

sudo apt-get purge network-manager

Then you need to manually set network

Edit /etc/network/interfaces and write ip,netmask ...

auto eth0
iface eth0 inet static
address xxx.xxx.x.xx
gateway xxx.xxx.x.x
netmask xxx.xxx.xxx.x
network xxx.xxx.x.x
broadcast xxx.xxx.x.xxx

After entering all the details you need to restart networking services using the following command

sudo /etc/init.d/networking restart

Setting up DNS

Edit /etc/resolv.conf

sudo nano /etc/resolv.conf

write

nameserver dns_server_ip
nameserver dns2_server_ip

After this step, your network will be configured without NM and will be work on run level 3 and 5.

Edit 1

You can start any app when login into GUI automatically if you put a .desktop file in ~/.config/autostart to run applications after a user login. This may have following content:

nano ~/.config/autostart/nm.desktop

[Desktop Entry]
Type=Application
Name=<Name of application as displayed>
Exec=<command to execute>
Icon=<full path to icon>
Comment=<optinal comments>
X-GNOME-Autostart-enabled=true
2707974
  • 10,758