Table of Contents

About

Network management on Linux

Management

Configuration

Hostname

See Setting the hostname

DNS

See Linux - The DNS resolver (/etc/resolv.conf)

DHCP

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

Enter this parameter:

DHCP_HOSTNAME=yourhostname

See also Linux - ifconfig (Interface Configuration)

Dhcp Check:

sudo dhclient eth0

Host File

see Network - Hosts File

Ethernet Interface

Set up the ethernet network adapter interface (local connection)

The name of the interface is usually a driver name followed by a unit number, for example eth0 for the first Ethernet interface.

/etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
BOOTPROTO=static
IPADDR=192.168.0.10 # A free ip number
NETMASK=255.255.255.0
NETWORK=192.168.0.0
GATEWAY=192.168.0.1
ONBOOT=yes
NM_CONTROLLED=no

You can also config it with ifconfig.

Example:

ifconfig eth0 address 192.168.0.10  #IPADDR
ifconfig eth0 netmask 255.255.255.0 # netmask

Routing Table

See netstat

netstat -rn # for routing table

Stop and start the network Service

[root@di-obia-01 ~]# service network restart
Shutting down interface eth0:                              [  OK  ]
Shutting down loopback interface:                          [  OK  ]
Bringing up loopback interface:                            [  OK  ]
Bringing up interface eth0:
Determining IP information for eth0... done.               [  OK  ]

The below statement will call the following scripts:

/etc/init.d/network stop
/etc/init.d/network start