Centos 6.5 set IP

Reference: http://blog.csdn.net/sky663/article/details/8766038

Modify first: vi /etc/sysconfig/network-scripts/ifcfg-eth0
ONBOOT=yes
and restart


1. Temporarily set IP: ifconfig 192.168. 0.25 , this will generate certain information in /etc/sysconfig/network-scripts/ifcfg-eth0.

2. vi /etc/sysconfig/network-scripts/ifcfg-eth0 , the modification will add the following content:
DEVICE=eth0
BOOTPROTO= static
IPADDR=192.168.0.10
NETMASK=255.255.255.0
ONBOOT=yes


3. vi /etc/sysconfig/network , modify or add the following content:
NETWORKING=yes
GATEWAY=192.168.0.1


The above settings, restart the network, you can get the IP: /etc/init.d/network restart

4. Set dns to access the external network:
vi /etc/resolv.conf
nameserver 192.168.0.1

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326991039&siteId=291194637