The configuration of centos6 network

Recommended for you: Get network issues from WhatsUp Gold. Not end users.
1 network configuration

Modify the corresponding cardIP address configuration file
# vi /etc/sysconfig/network-scripts/ifcfg-eth0
Modify the following contents
DEVICE=eth0 (describing device aliases, corresponding network card such as ifcfg-eth0 file for eth0)
BOOTPROTO=static (set the card to obtain IP address, the possible options for the static, DHCP or BOOTP, respectively, the corresponding static IP address specified is obtained through the DHCP protocol, IP address, IP address through BOOTP protocol)
BROADCAST= (subnet broadcast address of the corresponding)
HWADDR=00:07:E9:05:E8:B4 (the corresponding physical address)
IPADDR= (if set the card to get the IP address of the method for statically assigned, this field specifies the corresponding network card IP address)
NETMASK= (Ethernet correspondence network mask)
NETWORK= (network corresponding to the network address)
ONBOOT=yes (set this network interface, whether the system startup is set to yes, the system starts to activate this equipment)

The 2 Revised gateway

Gateway to amend the corresponding network card configuration file
# vi /etc/sysconfig/network
Modify the following contents
NETWORKING=yes (system whether the use of network, the general settings for yes. If set to no, we cannot use the network, and a lot of system service program will not start)
HOSTNAME=centos (host name, set the machine here host set host name and /etc/hosts name)
GATEWAY= (gateway settings of this machine is connected to the IP. For example, the gateway to the

The 3 amendment DNS

Modify the corresponding card of the DNS configuration file
# vi /etc/resolv.conf
Modify the following contents
Nameserver (domain name server)
Nameserver (domain name server)

4 restart network configuration

# service network restart
# /etc/init.d/network restart

5 to change the IP address

Immediate effect:
# ifconfig eth0 netmask
Start date:
Modify the default gateway gateway
Immediate effect:
# route add default gw dev eth0
Start date:
Modify the DNS
Modify host name
Can be modified with immediate effect, start with the same effective immediately:
# hostname centos1
Start date:

6 network command

Ifdown eth0 closed network
Ifconfig eth0 down closed network
Ifup eth0 open network
Ifconfig eth0 up open network

service network start //Start the network service
service network stop //Stop the network service
service network restart //Service network restart
service network status //Check the status of network services
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download

Posted by Tony at December 27, 2013 - 10:15 PM