On most modern Linux systems, you should be able to configure the network settings in some config file (Manuel gave some good locations) and the system will take care of executing the relevant commands (like ifconfig
and dhclient
) for you.
If this is CentOS, you shoud probably set the following in /etc/sysconfig/networking/devices/ifcfg-eth0
:
BOOTPROTO=dhcp
ONBOOT=yes
Just to be sure, check also that chkconfig --list network
returns something like this:
network 0:off 1:off 2:on 3:on 4:on 5:on 6:off
To start, stop and restart you networking, you can use /etc/init.d/network [start|stop|restart]
.