wangmeng960111

centos7设置固定ip

1.进入 network-scripts文件

 1 cd /etc/sysconfig/network-scripts/ 
2.修改ifcfg-eth0 文件

1 DEVICE=eth0
2 TYPE=Ethernet
3 ONBOOT=yes 改为yes
4 NM_CONTROLLED=yes 
5 BOOTPROTO=static 指定为静态IP 
6 DNS1=114.114.114.114 dns
7 IPADDR=192.168.238.128 指定ip地址
8 NETMASK=255.255.255.0 子网掩码
9 GATEWAY=192.168.238.2 网关

3.使用service network restart 重启服务
如果重启网络服务之后没有全是ok提示重启网卡提示Bringing up interface eth0: Device eth0 does not seem to be present,delaying initialization. [FAILED]:
这是因为克隆的机器没有正确的mac,UUID信息冲突导致的,首先将
/etc/udev/rules.d/70-persistent-net.rules文件删除rm -rf
2.然后将网卡配置文件
/etc/sysconfig/network-scripts/ifcfg-eth0的uuid和hwaddr这两行删除dd
3.重启虚拟机
init 6

分类:

技术点:

相关文章:

  • 2021-11-19
  • 2021-12-20
  • 2021-11-19
  • 2021-04-11
  • 2021-07-01
  • 2021-11-19
  • 2022-01-22
猜你喜欢
  • 2022-01-20
  • 2021-05-03
  • 2022-01-07
  • 2021-06-24
  • 2021-11-19
  • 2021-11-29
相关资源
相似解决方案