CentOS6.7 configuring static IP


CentOS configure static IP:
Servers are generally has its own static IP, so that they can very well connected to the local area network.
1, edit the card file, modify the network adapter configuration
vim /etc/sysconfig/network-scripts/ifcfg-eth0
Contents of the ifcfg-eth0 replaced by the following:
Corresponding device alias HWADDR=00:07:E9:05:E8:B4 # DEVICE=eth0 # description of the network adapter MAC address of the network adapter, network type is Ethernet MAC address TYPE=Ethernet# UUID: UUID of the network card (file can not) ONBOOT=yes# system automatically loads when you start eth0 NM_CONTROLLED=yes# Device management BOOTPROTO=static# by NetworkManager by way of different protocol obtain IP address set the card, static static BOOTPDHCP IPADDR=192.168.118.10# set NETMASK=255.255.255.0# set the card network card IP address mask address NETWORK=192.168.118.0# Set the card corresponds to the broadcast address of the network address corresponding to BROADCAST=192.168.118.255# set the card network
2, modify the gateway configuration
vi /etc/sysconfig/network
The network‘s content to the following:
NETWORKING=yes# indicates whether to use a network system (IPV4), is set to Yes. Set the host name NETWORKING_IPV6=no# shall not apply to IPV6 HASTNAME#, localhost.localhostdomain GATEWAY=192.168.118.1# sets the gateway for the default host name, select an unused address to
3, modify DNS
vi /etc/resolv.conf
The resolv.conf content to the following:
Add two DNS
4, restart the network service
service network restart
5, with another Terminal verify that you can ping Tong
6, the IP configuration is complete and verified successfully