[求教]单网卡,如何设置双ip

为当前最终发行版之前的所有版本提供支持
回复
lostxu
帖子: 9
注册时间: 2005-08-20 19:56
送出感谢: 0
接收感谢: 0

[求教]单网卡,如何设置双ip

#1

帖子 lostxu » 2006-04-21 20:40

想在eth0上绑定一个新ip,这是我的/etc/network/interfaces文件,没有挂上新ip,请看看怎么做,谢谢先。
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo eth0 eth0:0 eth1
iface lo inet loopback

# This is a list of hotpluggable network interfaces.
# They will be activated automatically by the hotplug subsystem.
mapping hotplug
script grep
map eth0
map eth1

# The primary network interface
iface eth0 inet static
address 2xx.1xx.xx.xx
netmask 255.255.255.0
network 202.114.85.0
broadcast 2xx.1xx.xx.xx
gateway 2xx.1xx.xx.xx
# dns-* options are implemented by the resolvconf package, if installed
dns-nameservers 2xx.1xx.xx.xx 2xx.1xx.xx.xx
iface eth0:0 inet static
address 192.168.1.1
netmask 255.255.255.12
network 192.168.1.0
broadcast 192.168.1.255
iface eth1 inet static
address 192.168.0.1
netmask 255.255.255.0
network 192.168.0.0
broadcast 192.168.0.255
lostxu
帖子: 9
注册时间: 2005-08-20 19:56
送出感谢: 0
接收感谢: 0

#2

帖子 lostxu » 2006-04-21 20:55

抱歉,ifup 不管用
重新启动ok了
sudo /etc/init.d/networking restart
xautofzx
帖子: 315
注册时间: 2005-05-11 20:14
来自: 西安理工大学
送出感谢: 0
接收感谢: 0

#3

帖子 xautofzx » 2006-07-04 11:42

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback
address 127.0.0.1
netmask 255.0.0.0

# This is a list of hotpluggable network interfaces.
# They will be activated automatically by the hotplug subsystem.
auto eth0

# The primary network interface
iface eth0 inet static
address 192.168.160.100
netmask 255.255.255.0
gateway 192.168.160.1

auto eth0:0
#insert by myself
iface eth0:0 inet static
address 219.244.87.100
netmask 255.255.255.0
#gateway 219.244.87.1
#network 192.168.160.0
#broadcast 192.168.160.255

这是在Ubuntu6.06下测试成功的。
xautofzx
帖子: 315
注册时间: 2005-05-11 20:14
来自: 西安理工大学
送出感谢: 0
接收感谢: 0

#4

帖子 xautofzx » 2006-07-04 12:08

UB里面一块网卡能配置两个IP吗?
http://forum.ubuntu.com.cn/viewtopic.php?p=96408#96408
回复

回到 “老旧版本支持”