`
mushme
  • 浏览: 777843 次
  • 性别: Icon_minigender_1
  • 来自: 西安
社区版块
存档分类
最新评论

ip别名设置

 
阅读更多
ip别名允许在一个网卡上,建立ip的别名,也就是一个网卡有多个ip,而且mac地址是一样的,可以通过别名的ip来访问这个网卡。
一个网卡最多可以设置256个别名,这样一个C段的网络都可以设置到一个网卡上。
ifconfig eth0:0 192.168.1.109


#ifconfig eth0 192.168.6.99 netmask 255.255.255.0 up
eth0                        //机器的第一个网卡,有些机器有多个网卡,eth1、eth2...
192.168.6.99                //设置网卡的静态ip地址
netmask 255.255.255.0       //ip地址的子网掩码,无需多解释
up                          //表示立即激活该网卡


eth0是指第一个网卡,冒号后的0是指第一个别名,后面跟别名的ip
示例如下:
#ifconfig eth0:0 192.168.6.100 netmask 255.255.255.0 up
#ifconfig eth0:1 173.173.173.173 netmask 255.255.255.0 up
#ifconfig eth0:2 119.110.120.1 netmask 255.255.255.0 up
......


清除ip别名
#ifconfg eth0:0 down
#ifconfg eth0:1 down
#ifconfg eth0:2 down


ip别名重启后,会自动清除,需要重新添加,你也可以通过将添加命令
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics