EzDevInfo.com

networkmanager interview questions

Top networkmanager frequently asked interview questions

How to force Network Manager to rescan connections?

How to force Network Manager in Ubuntu to rescan wireless connections?

After closing my laptop, network manager does not see new wireless connections. Is there any bash command to force rescan? sudo service network-manager restart does not help.


Source: (StackOverflow)

How to force NetworkManager to make a connection before login?

I leave my laptop at home 95% of the time. I would like it to connect to my wireless network without me having to login. And, just as important, I'd like it NOT to DISconnect when I log off.

I'm using Fedora, but Ubuntu instructions are welcome too.


Source: (StackOverflow)

Advertisements

VPN through NetworkManager in Debian?

I just switched over to Debian from Ubuntu and I can't seem to figure out how to add a VPN connection through network manager. When I select the VPN tab from Edit Connections the Add button is disabled.

I'm running a fresh install of Debian 6.0.1 Already install the the Cisco VPN client (network-manager-vpnc).

Any pointers would be great.


Source: (StackOverflow)

Network stopped working on Ubuntu after system had locked up

My main PC has AN Athlon X2 4600+ on an Asus M2npv-vm. Has been working fine for ages running Ubuntu. Today it the system locked up and I had to do a reset. Since then it will not connect to the router or cable modem. I can connect another PC to the router, so that looks okay.

What can I do to test the network connection from Ubuntu? It's not even getting an IP.

I suppose it could be something has died in the hardware, but want to eliminate other possibilities first.


Source: (StackOverflow)

Disabling networkmanager for a specific interface

I'd like to do some experimentation with hostap without disabling my primary wireless interface. How do I tell networkmanager to keep its hands off a specific interface or interfaces while allowing it to continue managing all other interfaces normally? I'm using Ubuntu 9.04.

(Wasn't sure if this should go on superuser or serverfault, as networkmanager isn't much of a 'server' tool - if it belongs on serverfault please feel free to move it)

Edit: I've tried adding this to /etc/network/interfaces:

allow-hotplug wlan2
iface wlan2 inet static
        address 192.168.49.1
        netmask 255.255.255.0

But this has no apparent effect, even after restarting NetworkManager.

Here's my /etc/NetworkManager/nm-system-settings.conf:

[main]
plugins=ifupdown,keyfile

[ifupdown]
managed=false

Edit[2]: Looks like I needed to restart nm-system-settings, then NetworkManager.


Source: (StackOverflow)

How do I setup a Gnome 3.2 VPN connection (Fedora 16)

I just switched to Gnome 3 on a new laptop to try it out. Lots of things are different, but I think I can get used to them. But I'm having a real problem trying to figure out how to get the new network manager to setup a VPN through the GUI.

I have openvpn, NetworkManager and NetworkManager-openvpn installed, but when I click on the network icon in gnome-shell there is nothing about vpn connections in there. When I click the "Network Settings" link in that menu I just see menus for Wired, Wireless and Network Proxy and none of those screens has anything for VPN connections either.

Any suggestions about where I need to look to setup my connections and how to make it easier connect when I need to?


Source: (StackOverflow)

Disabling NetworkManager on RHEL 7

I was setting up a RHEL7 server in vmware vSphere and I'm having trouble getting it on the network without NetworkManager. I configured the server to have a static IP during the install process and it set everything up using NetworkManager. While this does work we do not use NetworkManager in my office, so I went and entered what we usually put the config file to get RHEL6 servers online without NetworkManager.

/etc/sysconfig/network-scripts/ifcfg-ens192 is the following:

NAME=ens192
TYPE=Ethernet
ONBOOT=yes
NM_CONTROLLED=no
BOOTPROTO=static
IPADDR=10.0.2.15
PREFIX=24
GATEWAY=10.0.2.2

However when I disable NetworkManager the network service fails to start with the following error

#service network restart

Restarting network (via systemctl): Job for network.service failed. See 'systemctl status network.service' and 'journalctl -xn' for details.

And both commands output the following:

network[1838]: RTNETLINK answers: File exists
network[1838]: RTNETLINK answers: File exists
network[1838]: RTNETLINK answers: File exists
network[1838]: RTNETLINK answers: File exists
network[1838]: RTNETLINK answers: File exists
network[1838]: RTNETLINK answers: File exists
network[1838]: RTNETLINK answers: File exists
systemd[1]: network.service: control process exited, code=exited status=1
systemd[1]: Failed to start LSB: Bring up/down networking

Also, here's what the command 'ip addr' outputs:

1: lo: mtu 65536 qdisc noqueue state UNKNOWN
     link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
     inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
     inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: ens192: mtu 1500 qdisc noop state DOWN qlen 1000
     link/ether 08:00:27:98:8e:df brd ff:ff:ff:ff:ff:ff


Source: (StackOverflow)

Where are Wireless Profiles stored in Ubuntu

Where does Ubuntu store profiles that allow it to remember the credentials to private wireless networks that it has previously authenticate to and used?

I just replaced my Uncle's hard drive with a new one and installed Ubuntu 10.04 on it (he had Ubuntu 9.10 on his old hard drive.

He is at my house right now, and I want him to be able to access his private wireless network when he gets home. Usually, when I upgrade Ubuntu, I have his /home directory on another partition, so his wireless profile to his own network persists.

However, right now, I'm trying to figure out which .folder I need to copy from his /home/user folder on the old hard drive, to the new hard drive, so that he will be able to have wireless Internet when he gets home.

Does anyone know with certainty, exactly which folder I need to copy to the new hard drive to achieve this?


Source: (StackOverflow)

is there a way to prevent network manager from storing the password for a wireless network

Our corporate wireless network uses continuously changing passwords with RSA tokens. So every time we need to connect to the wireless we need to enter a new password off the RSA token. For extra fun using the wrong password a couple of times in a row causes the users account to be locked.

Network manager automatically stores and reuses the password, with the net result that it is constant getting my account locked.

Is there some way to prevent it from storing my password for that network?

Or perhaps someway to get the gnome keyring to not store it?


Source: (StackOverflow)

Make NetworkManager prefer ethernet over wifi if both present

A similar question was asked for windows Automatically prefer Ethernet over WLAN but I'm on linux and am using NetworkManager.

Right now if the ethernet cable is plugged in and is available while wifi connections are also available NetworkManager chooses the wifi connection. How can I tell it to always choose the wired connection if available?

I'm on Fedora 17 using NetworkManager-0.9.4.0-9.git20120521


Source: (StackOverflow)

Static IP Address with NetworkManager?

I just wanted to set up a static IP address for a fedora 19 machine in my LAN. I'm used to /etc/network/interfaces from debian but that file doesn't exist here.
After googling around a little bit, I found a small tutorial that tells one to disable NetworkManager via systemctl and enable network. After that one could configure the static IP address in a file called /etc/sysconfig/network-scripts/ifcfg-*interfacename*.

Here is my first problem: I found a file with the MAC address of my interface as displayed by ifconfig but the name after ifcfg- doesn't match the name from ifconfig. Why is that like this?

My second problem is about using NetworkManager.service or network.service. I read in a Forum, that network.service is still included for compatibility reasons and may be excluded soon. If network.service will soon be replaced by NetworkManager.service, shouldn't I choose NetworkManager.service to configure my network interfaces? If yes, how do I do that with NetworkManager from a shell?

Edit:
Here are the outputs requested:

[root@bitch /]# ifconfig
lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 0  (Local Loopback)
        RX packets 97  bytes 12042 (11.7 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 97  bytes 12042 (11.7 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

p3p1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.178.11  netmask 255.255.255.0  broadcast 192.168.178.255
        inet6 fe80::214:85ff:febc:1c63  prefixlen 64  scopeid 0x20<link>
        ether 00:14:85:bc:1c:63  txqueuelen 1000  (Ethernet)
        RX packets 134347  bytes 169988336 (162.1 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 78199  bytes 6595669 (6.2 MiB)
        TX errors 0  dropped 0 overruns 1  carrier 0  collisions 0

[root@bitch /]# ls -l /etc/sysconfig/network-scripts/
total 200
-rw-r--r--. 1 root root   437 Sep 15 02:05 ifcfg-enp2s5
-rw-r--r--. 1 root root   254 May 31 09:49 ifcfg-lo
lrwxrwxrwx. 1 root root    24 Jun 27 19:12 ifdown -> ../../../usr/sbin/ifdown
-rwxr-xr-x. 1 root root   627 May 31 09:49 ifdown-bnep
-rwxr-xr-x. 1 root root  5553 May 31 09:49 ifdown-eth
-rwxr-xr-x. 1 root root   781 May 31 09:49 ifdown-ippp
-rwxr-xr-x. 1 root root  4141 May 31 09:49 ifdown-ipv6
lrwxrwxrwx. 1 root root    11 Jun 27 19:12 ifdown-isdn -> ifdown-ippp
-rwxr-xr-x. 1 root root  1642 May 31 09:49 ifdown-post
-rwxr-xr-x. 1 root root  1068 May 31 09:49 ifdown-ppp
-rwxr-xr-x. 1 root root   837 May 31 09:49 ifdown-routes
-rwxr-xr-x. 1 root root  1444 May 31 09:49 ifdown-sit
-rwxr-xr-x. 1 root root  1462 May 31 09:49 ifdown-tunnel
lrwxrwxrwx. 1 root root    22 Jun 27 19:12 ifup -> ../../../usr/sbin/ifup
-rwxr-xr-x. 1 root root 12445 May 31 09:49 ifup-aliases
-rwxr-xr-x. 1 root root   859 May 31 09:49 ifup-bnep
-rwxr-xr-x. 1 root root 10234 May 31 09:49 ifup-eth
-rwxr-xr-x. 1 root root 12033 May 31 09:49 ifup-ippp
-rwxr-xr-x. 1 root root 10437 May 31 09:49 ifup-ipv6
-rwxr-xr-x. 1 root root   804 May 31 09:49 ifup-ipx
lrwxrwxrwx. 1 root root     9 Jun 27 19:12 ifup-isdn -> ifup-ippp
-rwxr-xr-x. 1 root root   642 May 31 09:49 ifup-plip
-rwxr-xr-x. 1 root root  1043 May 31 09:49 ifup-plusb
-rwxr-xr-x. 1 root root  2609 May 31 09:49 ifup-post
-rwxr-xr-x. 1 root root  4154 May 31 09:49 ifup-ppp
-rwxr-xr-x. 1 root root  1925 May 31 09:49 ifup-routes
-rwxr-xr-x. 1 root root  3268 May 31 09:49 ifup-sit
-rwxr-xr-x. 1 root root  2607 May 31 09:49 ifup-tunnel
-rwxr-xr-x. 1 root root  3775 May 31 09:49 ifup-wireless
-rwxr-xr-x. 1 root root  4623 May 31 09:49 init.ipv6-global
-rw-r--r--. 1 root root 13836 May 31 09:49 network-functions
-rw-r--r--. 1 root root 26134 May 31 09:49 network-functions-ipv6

Content of /etc/sysconfig/network-scripts/ifcfg-enp2s5:

PEERROUTES="yes"
IPV6INIT="yes"
NAME="enp2s5"
IPV6_PEERDNS="yes"
DEFROUTE="yes"
UUID="7622e20e-3f2a-4b5c-83d8-f4f6e22ed7ec"
PEERDNS="yes"
IPV4_FAILURE_FATAL="no"
HWADDR="00:14:85:BC:1C:63"
BOOTPROTO="static"
IPV6_DEFROUTE="yes"
IPV6_AUTOCONF="yes"
IPV6_FAILURE_FATAL="no"
TYPE="Ethernet"
ONBOOT="yes"
IPV6_PEERROUTES="yes"
IPADDR=192.168.178.11
NETMASK=255.255.255.0
BROADCAST=192.168.178.255
NETWORK=192.168.178.0
GATEWAY=192.168.178.1

Grepping dmesg for udevd:

[root@bitch network-scripts]# dmesg | grep udevd
[    0.788381] systemd-udevd[97]: starting version 204
[    2.457296] systemd-udevd[322]: starting version 204
[    3.110272] systemd-udevd[329]: renamed network interface eth0 to p3p1

Source: (StackOverflow)

Ubuntu Network Manager and VLAN

On Ubuntu I set up a VLAN on eth5 as eth5.1451. I want to configure it using network manager(nm-applet), but network manager does not see the newly created VLAN? Is there a way to make NM recognize it?


Source: (StackOverflow)

Default gateway "dissapears" from the routing table

I use NetworkManager (Arch Linux) in my laptop in order to connect to wireless networks. I use the official GNOME GUI. Everything works fine, but after an half an hour or so the network is still connected, but the default gateway just "dissapear" from the routing table.

➜  log  ip r                                 
10.135.1.0/24 dev wlan0  proto kernel  scope link  src 10.135.1.3  metric 303 
10.135.1.3 via 127.0.0.1 dev lo  metric 303

The default gateway should be 10.135.1.138 and I can actually ping it. I can restore it if I reconnect, restart NetworkManager or use "ip r" to add it back manually, but it will be gone again after a half an hour. I tried 2 different Wifi drivers and it happens with both. I tried using wicd instead of NetworkManager and it seemed to solve the problem. However, I'm not happy with wicd for several other reasons and I'm curious to know what's wrong with NetworkManager. I checked that netctl and wicd are disabled while NetworkManager is running (Are there any other services which might interfere it?). This is the log from the last hour. I couldn't find anything suspecious in it, though:

Jan 18 17:36:39 tarsonis NetworkManager[2382]: <info> (wlan0): device state change: prepare -> config (reason 'none') [40 50 0]
Jan 18 17:36:39 tarsonis NetworkManager[2382]: <info> Activation (wlan0/wireless): connection 'KrustyKrab' has security, and secrets exist.  No new secrets needed.
Jan 18 17:36:39 tarsonis NetworkManager[2382]: <info> Config: added 'ssid' value 'KrustyKrab'
Jan 18 17:36:39 tarsonis NetworkManager[2382]: <info> Config: added 'scan_ssid' value '1'
Jan 18 17:36:39 tarsonis NetworkManager[2382]: <info> Config: added 'key_mgmt' value 'WPA-PSK'
Jan 18 17:36:39 tarsonis NetworkManager[2382]: <info> Config: added 'auth_alg' value 'OPEN'
Jan 18 17:36:39 tarsonis NetworkManager[2382]: <info> Config: added 'psk' value '<omitted>'
Jan 18 17:36:39 tarsonis NetworkManager[2382]: <info> Activation (wlan0) Stage 2 of 5 (Device Configure) complete.
Jan 18 17:36:39 tarsonis NetworkManager[2382]: <info> Config: set interface ap_scan to 1
Jan 18 17:36:39 tarsonis NetworkManager[2382]: <info> (wlan0): supplicant interface state: inactive -> scanning
Jan 18 17:36:40 tarsonis NetworkManager[2382]: <info> (wlan0): supplicant interface state: scanning -> authenticating
Jan 18 17:36:40 tarsonis NetworkManager[2382]: <info> (wlan0): supplicant interface state: authenticating -> associating
Jan 18 17:36:40 tarsonis NetworkManager[2382]: <info> (wlan0): supplicant interface state: associating -> 4-way handshake
Jan 18 17:36:40 tarsonis NetworkManager[2382]: <info> (wlan0): supplicant interface state: 4-way handshake -> completed
Jan 18 17:36:40 tarsonis NetworkManager[2382]: <info> Activation (wlan0/wireless) Stage 2 of 5 (Device Configure) successful.  Connected to wireless network 'KrustyKrab'.
Jan 18 17:36:40 tarsonis NetworkManager[2382]: <info> Activation (wlan0) Stage 3 of 5 (IP Configure Start) scheduled.
Jan 18 17:36:40 tarsonis NetworkManager[2382]: <info> Activation (wlan0) Stage 3 of 5 (IP Configure Start) started...
Jan 18 17:36:40 tarsonis NetworkManager[2382]: <info> (wlan0): device state change: config -> ip-config (reason 'none') [50 70 0]
Jan 18 17:36:40 tarsonis NetworkManager[2382]: <info> Activation (wlan0) Beginning DHCPv4 transaction (timeout in 45 seconds)
Jan 18 17:36:40 tarsonis NetworkManager[2382]: <info> dhcpcd started with pid 2403
Jan 18 17:36:40 tarsonis NetworkManager[2382]: <info> Activation (wlan0) Beginning IP6 addrconf.
Jan 18 17:36:40 tarsonis NetworkManager[2382]: <info> Activation (wlan0) Stage 3 of 5 (IP Configure Start) complete.
Jan 18 17:36:40 tarsonis NetworkManager[2382]: <info> (wlan0): DHCPv4 state changed nbi -> preinit
Jan 18 17:36:50 tarsonis NetworkManager[2382]: <info> (wlan0): DHCPv4 state changed preinit -> bound
Jan 18 17:36:50 tarsonis NetworkManager[2382]: <info>   address 10.135.1.3
Jan 18 17:36:50 tarsonis NetworkManager[2382]: <info>   prefix 24 (255.255.255.0)
Jan 18 17:36:50 tarsonis NetworkManager[2382]: <info>   gateway 10.135.1.138
Jan 18 17:36:50 tarsonis NetworkManager[2382]: <info>   nameserver '10.135.1.138'
Jan 18 17:36:50 tarsonis NetworkManager[2382]: <info> Activation (wlan0) Stage 5 of 5 (IPv4 Configure Commit) scheduled...
Jan 18 17:36:50 tarsonis NetworkManager[2382]: <info> Activation (wlan0) Stage 5 of 5 (IPv4 Commit) started...
Jan 18 17:36:51 tarsonis NetworkManager[2382]: <info> (wlan0): device state change: ip-config -> secondaries (reason 'none') [70 90 0]
Jan 18 17:36:51 tarsonis NetworkManager[2382]: <info> Activation (wlan0) Stage 5 of 5 (IPv4 Commit) complete.
Jan 18 17:36:51 tarsonis NetworkManager[2382]: <info> (wlan0): device state change: secondaries -> activated (reason 'none') [90 100 0]
Jan 18 17:36:51 tarsonis NetworkManager[2382]: <info> NetworkManager state is now CONNECTED_GLOBAL
Jan 18 17:36:51 tarsonis NetworkManager[2382]: <info> Policy set 'KrustyKrab' (wlan0) as default for IPv4 routing and DNS.
Jan 18 17:36:51 tarsonis NetworkManager[2382]: <info> Writing DNS information to /usr/bin/resolvconf
Jan 18 17:36:51 tarsonis NetworkManager[2382]: <info> Activation (wlan0) successful, device activated.
Jan 18 17:36:51 tarsonis NetworkManager[2382]: <warn> Dispatcher failed: (32) Unit dbus-org.freedesktop.nm-dispatcher.service failed to load: No such file or directory.
Jan 18 17:37:01 tarsonis NetworkManager[2382]: <info> (wlan0): IP6 addrconf timed out or failed.
Jan 18 17:37:01 tarsonis NetworkManager[2382]: <info> Activation (wlan0) Stage 4 of 5 (IPv6 Configure Timeout) scheduled...
Jan 18 17:37:01 tarsonis NetworkManager[2382]: <info> Activation (wlan0) Stage 4 of 5 (IPv6 Configure Timeout) started...
Jan 18 17:37:01 tarsonis NetworkManager[2382]: <info> Activation (wlan0) Stage 4 of 5 (IPv6 Configure Timeout) complete.
Jan 18 18:06:50 tarsonis NetworkManager[2382]: <info> (wlan0): DHCPv4 state changed bound -> (null)
Jan 18 18:06:55 tarsonis NetworkManager[2382]: <info> (wlan0): DHCPv4 state changed (null) -> bound
Jan 18 18:06:55 tarsonis NetworkManager[2382]: <info>   address 10.135.1.3
Jan 18 18:06:55 tarsonis NetworkManager[2382]: <info>   prefix 24 (255.255.255.0)
Jan 18 18:06:55 tarsonis NetworkManager[2382]: <info>   gateway 10.135.1.138
Jan 18 18:06:55 tarsonis NetworkManager[2382]: <info>   nameserver '10.135.1.138'
Jan 18 18:36:56 tarsonis NetworkManager[2382]: <info> (wlan0): DHCPv4 state changed bound -> (null)
Jan 18 18:37:01 tarsonis NetworkManager[2382]: <info> (wlan0): DHCPv4 state changed (null) -> bound
Jan 18 18:37:01 tarsonis NetworkManager[2382]: <info>   address 10.135.1.3
Jan 18 18:37:01 tarsonis NetworkManager[2382]: <info>   prefix 24 (255.255.255.0)
Jan 18 18:37:01 tarsonis NetworkManager[2382]: <info>   gateway 10.135.1.138
Jan 18 18:37:01 tarsonis NetworkManager[2382]: <info>   nameserver '10.135.1.138'
Jan 18 18:48:23 tarsonis NetworkManager[2382]: <warn> Connection disconnected (reason -4)
Jan 18 18:48:23 tarsonis NetworkManager[2382]: <info> (wlan0): supplicant interface state: completed -> disconnected
Jan 18 18:48:23 tarsonis NetworkManager[2382]: <info> (wlan0): supplicant interface state: disconnected -> scanning
Jan 18 18:48:24 tarsonis NetworkManager[2382]: <info> (wlan0): supplicant interface state: scanning -> authenticating
Jan 18 18:48:24 tarsonis NetworkManager[2382]: <info> (wlan0): supplicant interface state: authenticating -> associating
Jan 18 18:48:24 tarsonis NetworkManager[2382]: <info> (wlan0): supplicant interface state: associating -> 4-way handshake
Jan 18 18:48:24 tarsonis NetworkManager[2382]: <info> (wlan0): supplicant interface state: 4-way handshake -> completed
Jan 18 19:07:01 tarsonis NetworkManager[2382]: <info> (wlan0): DHCPv4 state changed bound -> (null)
Jan 18 19:07:07 tarsonis NetworkManager[2382]: <info> (wlan0): DHCPv4 state changed (null) -> bound
Jan 18 19:07:07 tarsonis NetworkManager[2382]: <info>   address 10.135.1.3
Jan 18 19:07:07 tarsonis NetworkManager[2382]: <info>   prefix 24 (255.255.255.0)
Jan 18 19:07:07 tarsonis NetworkManager[2382]: <info>   gateway 10.135.1.138
Jan 18 19:07:07 tarsonis NetworkManager[2382]: <info>   nameserver '10.135.1.138'
Jan 18 19:13:27 tarsonis NetworkManager[2382]: <warn> Connection disconnected (reason -4)
Jan 18 19:13:27 tarsonis NetworkManager[2382]: <info> (wlan0): supplicant interface state: completed -> disconnected
Jan 18 19:13:27 tarsonis NetworkManager[2382]: <info> (wlan0): supplicant interface state: disconnected -> scanning
Jan 18 19:13:28 tarsonis NetworkManager[2382]: <info> (wlan0): supplicant interface state: scanning -> authenticating
Jan 18 19:13:28 tarsonis NetworkManager[2382]: <info> (wlan0): supplicant interface state: authenticating -> associating
Jan 18 19:13:28 tarsonis NetworkManager[2382]: <info> (wlan0): supplicant interface state: associating -> 4-way handshake
Jan 18 19:13:28 tarsonis NetworkManager[2382]: <info> (wlan0): supplicant interface state: 4-way handshake -> completed
Jan 18 19:37:07 tarsonis NetworkManager[2382]: <info> (wlan0): DHCPv4 state changed bound -> (null)
Jan 18 19:37:13 tarsonis NetworkManager[2382]: <info> (wlan0): DHCPv4 state changed (null) -> bound
Jan 18 19:37:13 tarsonis NetworkManager[2382]: <info>   address 10.135.1.3
Jan 18 19:37:13 tarsonis NetworkManager[2382]: <info>   prefix 24 (255.255.255.0)
Jan 18 19:37:13 tarsonis NetworkManager[2382]: <info>   gateway 10.135.1.138
Jan 18 19:37:13 tarsonis NetworkManager[2382]: <info>   nameserver '10.135.1.138'

What's really odd is that it actually shows "gateway 10.135.1.138" although it won't appear in the routing table unless I reconnect.


Source: (StackOverflow)

Add a hook to run when NetworkManager connects

What would be a good way to make a script run every time my computer connects to the network in Ubuntu? Would I somehow use dbus to do this?

Background: when I'm on the train I run a short Perl script to click a button on the splash page. That way I can immediately use the internet without having to manually visit a pointless website. My script is a near-perfect solution, but it would be perfect if it could run automatically any time I connect to the network.


Source: (StackOverflow)

How to boot into command-line mode and keep other services unchanged

I want to configure my Ubuntu installation to boot into a command-line prompt instead of the Gnome Desktop Environment. I ran the below command to effect this:

sudo update-rc.d -f gdm remove

It worked as intended and dropped me onto a shell prompt on reboot, BUT a lot of services (e.g network access) weren't running at that point.

They started up when I manually started GDM from the shell prompt.

How do I get Ubuntu to boot into the command shell without GDM, but without disabling other services, or having to manually enable them ?

By removing gdm using update-rc.d, have I changed the runlevel Ubuntu boots into ? I've looked at the Boot-Up Manager GUI in Advanced mode, but couldn't gather much from the Services tab.

Edit: The problem wasn't what I thought it was. I've described the modified issue and the solution in my answer below.

PS: As it stands, the question is misleading though the underlying problem is valid.


Source: (StackOverflow)