返回顶部
扶摇直上九万里,展翅高飞岂可待。

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
 
posted @ 2022-06-24 15:55  鲤鱼洲畔  阅读(28)  评论(0编辑  收藏  举报