- 论坛徽章:
- 0
|
请问如何将网卡绑定多个ip地址
一块网卡帮定三个ip,并且子网掩码不同
搞定!如下:
/etc/hosts
127.0.0.1 localhost
210.xxx.xx1.xx dbs loghost
192.168.9.15 mytestip
192.168.9.65 mytestip2
/etc/netmasks
210.xx.xx.0 255.255.255.0
192.168.9.0 255.255.255.192
192.168.9.64 255.255.255.252
/etc/hme0
dbs
/etc/hme0:1
mytestip
/etc/hme0:2
mytestip2
#init 6
...
#ifconfig -a
lo0: flags=1000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4>; mtu 8232 index 1
inet 127.0.0.1 netmask ff000000
hme0: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4>; mtu 1500 index 2
inet 210.xxx0.2xx.xx netmask ffffff00 broadcast 210.82.31.255
hme0:1: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4>; mtu 1500 index 2
inet 192.168.9.15 netmask ffffffc0 broadcast 192.168.9.63
hme0:2: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4>; mtu 1500 index 2
inet 192.168.9.65 netmask fffffffc broadcast 192.168.9.67 |
|