How do I disable NetworkManager in favor of dhcp setup?

How do I disable NetworkManager in favor of dhcp setup?

Yedidyah Bar-David linux-il at didi.bardavid.org
Thu Mar 8 00:30:04 IST 2012


On Thu, Mar 08, 2012 at 12:21:02AM +0200, Micha wrote:
> I have a redhat 6 desktop based system that exhibits a behavior where
> sshd fails to start on startup despite being enabled and requires manual
> startup after user login. I want to enable remote access before there is
> actual user login on the system
> 
> I believe I pinpointed the problem tp NetworkManager being installed and
> enabled, which means that no network connection is actually configured
> before a user is logged in.
> 
> I want to know how to remove NetworkManager and enable automatic network
> connection startup before sshd is started.
> 
> /etc/network/interfaces doesn't exist, so I'm not sure how this is
> supposed to be achieved these days (under debian it's still there, just
> not active by default). It used to be possible to define the interface
> as auto dhcp in there to get the behavior I want. Will just adding that
> file do the trick is it supposed to be done differently?

On RedHat it's in /etc/sysconfig/network-scripts/ifcfg-<interface-name>,
see 'man ifup' there. A working (for me, currently) example:

/etc/sysconfig/network-scripts/ifcfg-eth0

DEVICE="eth0"
NM_CONTROLLED="yes"
ONBOOT=yes
HWADDR=xx:xx:xx:xx:xx:xx
TYPE=Ethernet
BOOTPROTO=dhcp
DEFROUTE=yes
PEERDNS=yes
PEERROUTES=yes
IPV4_FAILURE_FATAL=yes
IPV6INIT=no
NAME="System eth0"
UUID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx

Note that although the above says 'NM_CONTROLLED="yes"', I do not have
NetworkManager installed so I do not know if it affects anything.
-- 
Didi




More information about the Linux-il mailing list