两种方法:
1> 修改/etc/network/interface
原来的interface文件如下:
现在要添加一个IP 192.168.53.75 掩码为 255.255.255.128, 在上面的文件中添加如下内容:
依此类推,可以添加eth0:1 eth0:2 ... ...
2> 上面的方法,在Ubuntu8.10server重启后,第2个IP添加不上。
还可以用命令行: ifconfig eth0:0 192.168.53.75 netmask 255.255.255.128 up
要保证开机能使用则把上面这条命令加上/etc/rc.local
1> 修改/etc/network/interface
原来的interface文件如下:
- auto lo
- iface lo inet loopback
- auto eth0
- iface eth0 inet static
- address 192.168.7.72
- netmask 255.255.255.0
- 1. auto eth0:0
- 2. iface eth0:0 inet static
- 3. address 192.168.53.75
- 4. netmask 255.255.255.128
2> 上面的方法,在Ubuntu8.10server重启后,第2个IP添加不上。
还可以用命令行: ifconfig eth0:0 192.168.53.75 netmask 255.255.255.128 up
要保证开机能使用则把上面这条命令加上/etc/rc.local