2、centos7设置静态IP
1.编辑网卡信息
vim /etc/sysconfig/network-scripts/ifcfg-ens33
修改:
BOOTPROTO="static"
IPADDR=192.168.127.140
NETMASK=255.255.255.0
GATEWAY=192.168.127.2
2.设置systemctl
systemctl stop NetworkManager
systemctl disable NetworkManager
systemctl restart network
3.一个网卡上面绑定多个IP
添加方法:
ifconfig eth0:0 192.168.2.99 netmask 255.255.255.0
ip addr add 192.168.2.199/24 dev eth0:0
删除方法:
ip addr delete 192.168.2.199 dev eth0:0
eg:
添加:
ifconfig eth0:0 172.30.0.100 broadcast 172.30.255.255 netmask 255.255.0.0 up
删除:
ip addr delete 172.30.0.100 dev eth0:0
本文来自博客园,作者:鲤鱼洲畔,转载请注明原文链接:https://www.cnblogs.com/liyuzhoupan/p/16409201.html