[Centos 6.2] centos 6.2 (64-bit) Network Configuration

 

1, CentOS modify DNS server
# vi /etc/resolv.conf
modify the following
nameserver 8.8.8.8 # google domain name server
nameserver 8.8.4.4 #google domain name server
2, CentOS modify gateway
to modify the corresponding card gateway configuration file
[root @ centos ] # vi / etc / sysconfig / network

modify the following
NETWORKING = yes (indicate whether the system is using the network, usually set to yes. If set to no, you can not use the network, and many system services will not start)
HOSTNAME = CentOS ( the machine set the host name, the host name corresponding to the host name to be set here and the / etc / hosts set)
the gATEWAY = 192.168.1.1 (gateway is provided connected to the machine's IP address. for example, gateway 10.0.0.2)
. 3 , CentOS modify the IP address of the

configuration file is modified corresponding to the NIC IP address
# vi / etc / sysconfig / network -scripts / ifcfg-eth0

modify the following

dEVICE = eth0 # description of the card corresponding device alias, such as a file ifcfg-eth0 in it as eth0
way to get ip address BOOTPROTO = static # NIC installed, possible options for the static, dhcp or bootp, respectively static ip address specified by dhcp Ip address of the meeting obtained, obtained by ip address bootp protocol
BROADCAST = 192.168.0.255 # corresponding subnet broadcast address
HWADDR = 00: 07: E9: 05: E8: B4 # corresponding network card physical address
IPADDR = 12.168.1.2 # If the network card ip address static manner specified, field to specify the ip address of the corresponding network card

NETMASK = 255.255.255.0 # card corresponding network mask 
NETWORK = 192.168.1.0 # card corresponding network addresses

= NO IPV6INIT
IPV6_AUTOCONF NO =
when ONBOOT = yes # network interfaces this system is set at startup, set to yes, the system starts to activate the device
4, the network configuration restart
# service network restart
or
# /etc/init.d/network restart

IP address changes
with immediate effect:
# ifconfig eth0 192.168.0.2 255.255.255.0 Netmask
start to take effect:
modify / etc / sysconfig / network-scripts / ifcfg-eth0

modify gateway default gateway
immediate effect:
# route the Add default gw 192.168.0.1 dev eth0
start to take effect:
modify / etc / sysconfig / network

modify DNS
modify /etc/resolv.conf
after modification can take effect immediately, starting as effective

to modify host name
with immediate effect:
# hostname centos1
start to take effect:
modify / etc / sysconfig / network

manually change centos static IP
1, first search for a moment, the following explanation
IPADDR IP address
Netmark subnet mask
Gateway Default Gateway
HostName Host name
DomainName domain
DNS DNS of IP
2, often need to modify the file
/ etc / sysconfig / Network
/ etc / sysconfig / Network-scripts / the ifcfg-eth0
/ etc / the resolv .conf
/ etc / hosts

Reproduced in: https: //www.cnblogs.com/licheng/archive/2012/06/08/2542151.html

Guess you like

Origin blog.csdn.net/weixin_33774883/article/details/92627933