Friday 8 June 2012

Stop Ubuntu 12.04 NetworkManager meddling!

Annoying Notifications!
After adding a couple of extra NICs to my work Ubuntu 12.04 desktop PC - part of an ongoing work with our office NAS/iScsi server - the network icon was blinking away trying to do something useful with the new cards.  Mildly annoying when in the office. Horrid when accessing remotely as the notifications eat lots of bandwidth. At the same time it was generating a fair amount of guff in /var/log/syslog.

Easy, I thought - i'll go fix them in /etc/network/interfaces... ...hang on:
auto lo
iface lo inet loopback
where's eth0 gone?! It seems that by default all is now managed by the network manager - just what I want most of the time especially on my notebook. But not what I want right now. Should I disable it?

root@welbeck:/run# service network-manager stop
network-manager stop/waiting
root@welbeck:/run# ifconfig
lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:118 errors:0 dropped:0 overruns:0 frame:0
          TX packets:118 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:8230 (8.2 KB)  TX bytes:8230 (8.2 KB)
Eth0 has gone! Not quite what I had in mind. A quick dig into the manpage for NetworkManager.conf (in /etc/NetworkManager) though has this:

      managed=false | true
              Controls whether interfaces listed in the 'interfaces' file  are
              managed  by  NetworkManager.   If  set  to true, then interfaces
              listed in /etc/network/interfaces are managed by NetworkManager.
              If  set  to  false,  then  any  interface  listed  in  /etc/net‐
              work/interfaces will be ignored by NetworkManager. Remember that
              NetworkManager controls the default route, so because the inter‐
              face is ignored, NetworkManager may assign the default route  to
              some  other  interface.  When the option is missing, false value
              is taken as default.
Sounds like it does Just the right thing(TM) then. So quick hack of /etc/network/interfaces
auto loiface lo inet loopback
auto eth0iface eth0 inet dhcp
auto eth1iface eth1 inet manual
auto eth2iface eth2 inet manual
And a service network-manager stop/start... 


And it's wound it's neck in.






No comments:

Post a Comment