centos7 修改静态ip
需要更改的部门:设置静态ip
[root@rabbitmq /]# vim /etc/sysconfig/network-scripts/ifcfg-ens33 [root@rabbitmq /]# cat /etc/sysconfig/network-scripts/ifcfg-ens33 TYPE=Ethernet BOOTPROTO=static DEFROUTE=yes IPV4_FAILURE_FATAL=no IPV6INIT=no IPV6_AUTOCONF=yes IPV6_DEFROUTE=yes IPV6_PEERDNS=yes IPV6_PEERROUTES=yes IPV6_FAILURE_FATAL=no IPV6_ADDR_GEN_MODE=stable-privacy NAME=ens33 UUID=9960e90c-691b-40fb-9227-97deafb55bca DEVICE=ens33 ONBOOT=yes IPADDR=192.168.217.130 NETMASK=255.255.255.0 GATEWAY=192.168.217.2
PREFIX=24 DNS=192.168.1.1 DNS1=8.8.8.8 DNS2=8.8.4.4
DNS3=4.2.2.2
DNS4=223.5.5.5
[root@rabbitmq /]# cat /etc/resolv.conf # Generated by NetworkManager search localdomain nameserver 192.168.217.2 nameserver 8.8.8.8 nameserver 8.8.4.4 [root@rabbitmq /]# vim /etc/resolv.conf
[root@localhost ~]# cat /etc/sysconfig/network # Created by anaconda NETWORKING=yes GATEWAY=198.168.217.2
[root@rabbitmq /]# service network restart 重启网络
设置的ip的网段要跟下面在一个网段
参照博客 https://segmentfault.com/a/1190000011954814
http://www.xfcodes.com/centos/32903_2.htm
192.168.217.2
本文来自博客园,作者:zsls-lang,转载请注明原文链接:https://www.cnblogs.com/zsls-lang/p/8440196.html
行也思卿,坐也思卿
日高三竿我犹眠,不管人间万里愁