当前位置: 移动技术网 > 科技>操作系统>Linux > 如何在linux网卡上添加多个IP

如何在linux网卡上添加多个IP

2019年03月24日  | 移动技术网科技  | 我要评论
最简单的方法是使用命令行: ifconfig add eth0 192.168.0.2 netmask 255.255.255.0 ifconfig add eth0:1 192.168.0.2 netmask 255.255.255.0 ifconfig add eth0:2 192.168.0.2 net... 09-03-10
最简单的方法是使用命令行:
ifconfig add eth0 192.168.0.2 netmask 255.255.255.0
ifconfig add eth0:1 192.168.0.2 netmask 255.255.255.0
ifconfig add eth0:2 192.168.0.2 netmask 255.255.255.0
其中eth0:1和eth0:2是添加上的两个ip.
在添加后必需加入启动项,否则重启后,虚拟添加的ip将会失去.
将以上命令加入到:
/etc/rc.d/rc.local
即可.

如您对本文有疑问或者有任何想说的,请点击进行留言回复,万千网友为您解惑!

相关文章:

验证码:
移动技术网