Demo Environment
VMware8 + Linux CentOS 6.2 x32
Set up IP, Web site, DNS
1, modify the network card configuration, edit
#vi/etc/sysconfig/network-scripts/ifcfg-eth0
Device= "Eth0"
Onboot=yes
Hwaddr=00:0c:29:5d:18:ee
Type=ethernet
Bootproto=static
ipaddr=192.168.1.251
netmask=255.255.255.0
network=192.168.1.1
Defroute=yes
Ipv4_failure_fatal=yes
Ipv6init=no
dns1=114.114.114.114
dns2=202.96.134.133
---------------------------------------------The following is a description
Device= "eth0"/NIC device name
Hwaddr=00:0c:29:5d:18:ee/NIC Physical Address
Bootproto=static/Set the network card to obtain the IP address, here is the manual fill
ipaddr=192.168.1.251/Static IP address
netmask=255.255.255.0/Subnet Mask
network=192.168.1.1/Gateway Address
---------------------------------------------above is a description
2, modify the gateway configuration, edit
#vi/etc/sysconfig/network
Networking=yes
Networking_ipv6=no
Hostname=centos
gateway=192.168.1.1
---------------------------------------------The following is a description
Networking=yes/Indicates whether the system uses a network and is generally set to Yes.
Hostname=centos/Set host name for this machine
gateway=192.168.1.1/Set the IP address of the gateway.
---------------------------------------------above is a description
I'm editing this here. The first two items are already default, so only the gateway is added.
3. Modify DNS, edit
#vi/etc/resolv.conf
NameServer 114.114.114.114
NameServer 202.96.134.133
Search Localdomain
---------------------------------------------The following is a description
NameServer 114.114.114.114/dns Preferred Address
NameServer 202.96.134.133/dns Alternate Address
---------------------------------------------above is a description
4. Restart Service
#service Network restart or #/etc/init.d/network restart
Linux CentOS Configuration IP