centos7设置静态ip ,添加临时ip

家里路由器日常抽风换ip 导致xshell断开,还是换成静态ip吧 注意先准备一个ping不通的正常ip    ping -c 5

查看自己Windows查看cmd ipconfig

vim /etc/sysconfig/network-scripts/ifcfg-ens33

原图:

修改添加

BOOTPROTO=static
IPADDR=192.168.1.111
NETMASK=255.255.255.0 GATEWAY=192.168.1.1


重启
systemctl restart network.service

 添加临时ip :ip addr ad 192.168.1.112/22 dev ens33

 
 

猜你喜欢

转载自www.cnblogs.com/oo-llm/p/12081803.html