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

最简单的方法是使用命令行: 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. 在添加后必需加入启动项,

最简单的方法是使用命令行:
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
即可.

以上就是如何在linux网卡上添加多个IP的详细内容,更多请关注0133技术站其它相关文章!

赞(0) 打赏
未经允许不得转载:0133技术站首页 » 服务器