[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: I hate network-manager (was /etc/rc.local and systemd)



On Sun, Aug 24, 2014 at 6:00 PM, Stephen Powell <zlinuxman@wowway.com> wrote:
> On Sun, 24 Aug 2014 15:44:26 -0400 (EDT), David Baron wrote:
>> On Sunday 24 August 2014 11:45:40 Stephen Powell wrote:


> I have a static route command in my /etc/rc.local file to define
> a route to another network. I won't go into the reasons for why
> it's there. Suffice it to say that there's a reason for it.
>
> But the command is
>
> route add -net 192.168.1.4 netmask 255.255.255.252 gw 192.168.0.2 metric 2
>
> At some point, I issued the command
>
> netstat -rn
>
> to see if my static route was there. It wasn't. I therefore
> concluded (erroneously, as it turned out) that /etc/rc.local
> had not been executed. But it had. The culprit turned out to
> be network-manager. The default installation of Debian for a
> desktop system (XFCE in my case) installs both ifupdown and
> network-manager. It allows ifupdown to manage only the local
> loopback interface (lo) and allows network-manager to manage
> everything else, including the wired ethernet interface (eth0).

The default "/etc/NetworkManager/NetworkManager.conf" has
[ifupdown]
managed=false
so if you have a nic defined in "/etc/network/interfaces", NM'll ignore it.

You can set the route in "/etc/network/if-up.d/" and the script'll be
run by ifupdown and NM, whichever's bringing up eth0.

For an NM-only solution, you can set the route in
"/etc/NetworkManager/dispatcher.d/".


> I have changed this and have given ifupdown control of the eth0
> interface. But network manager insists on creating an "eth0"
> connection on every start-up. If I right-click on the network-
> manager icon, then left-click on "Edit Connections", I see two
> connections listed. One is "ifupdown (eth0)" and the other is
> simply "eth0". (I have "managed=true" in the [ifupdown] section
> of /etc/NetworkManager/NetworkManager.conf.) I then select
> the "eth0" connection and click on the "Delete" button. The
> connection disappears, and "ifupdown (eth0)" becomes the default
> connection. Everything works fine. Except for two things.

"ifupdown (eth0)" means that NM is managing eth0 as defined in
"/etc/network/interfaces"; and that's because of "managed=true".


Reply to: