- 论坛徽章:
- 0
|
请看我的ifconfig -a怎么那么绑定那么多的IP地址????
添加一个逻辑借口
#ifconfig hme0:1
#ifconfig hme0:1 up
#ifconfig hme0:1 inet 202.96.232.10
# ifconfig -a
lo0: flags=849<UP,LOOPBACK,RUNNING,MULTICAST>; mtu 8232
inet 127.0.0.1 netmask ff000000
hme0: flags=863<UP,BROADCAST,NOTRAILERS,RUNNING,MULTICAST>; mtu 1500
inet 10.0.128.217 netmask ffffc000 broadcast 10.0.191.255
ether 8:0:20:ab:59:28
hme0:1: flags=842<UP,BROADCAST,RUNNING,MULTICAST>; mtu 1500
inet 202.96.232.10 netmask ffffff00 broadcast 202.96.232.255
删除一个逻辑口
#ifconfig hme0:1 0 down
注:重起后,该逻辑口消失
使用配置文件配置,重起后不消失
先使用ifconfig配置
#ifconfig hme0:1 plumb *.*.*.* up permanence
1.vi /etc/hosts
加入
10.0.128.217 register loghost
-〉202.96.232.10 register1 loghost
2.vi /etc/hostname.hme0:1
加入主机名 register1
3.vi /etc/netmasks
加入虚拟接口ip的netmask
202.96.232.10 255.255.255.0
4.reboot |
|