ninic

导航

centos7 新增ip

1.进入network-scripts目录:cd /etc/sysconfig/network-scripts/

2.复制ifcfg-eth0: cp ifcfg-eth0 ifcfg-eth0:0

3.编辑ifcfg-eth0:0: vi ifcfg-eth0:0

   NAME=eth0:0 #保持和文件名一致

   DEVICE=eth0:0 #保持和文件名一致,添加多个IP依次递增

   ONBOOT=yes #是否开机激活

   BOOTPROTO=static #静态IP,如果需要DHCP获取请输入dhcp

   IPADDR=210.77.69.233#此处修改为要添加的IP

   NETMASK=210.77.69.254 #子网掩码根据你的实际情况作修改

4.重启网络服务:systemctl  restart network.service

5.查看ip:ip addr

posted on 2017-11-21 17:38  ninic  阅读(388)  评论(0编辑  收藏  举报