1. 查看centos版本
cat /etc/redhat-release
2. 修改 ifcfg-eth0 文件
vi /etc/sysconfig/network-scripts/ifcfg-eth0
修改 BOOTPROTO=static,增加 IPADDR,NETMASK,GATEWAY
DEVICE=eth0
TYPE=Ethernet
ONBOOT=yes
BOOTPROTO=dhcp
BOOTPROTO=static
IPADDR=192.168.0.X
NETMASK=255.255.255.0
GATEWAY=192.168.0.1
1
2
3
4
5
6
7
8
9
3. 重启网络
service network restart
- 上一篇:实现虚拟机单窗口单IP的方法和步骤
- 下一篇:ubuntu修改IP地址和网关的方法