Add two ips to one NIC in ubuntu

edit file: /etc/network/interfaces

the original content should be something like:

# The primary network interface
auto eth0
iface eth0 inet static
address 192.168.0.5
netmask 255.255.255.0
network 192.168.0.0
broadcast 192.168.0.255
gateway 192.168.0.1
# dns-* options are implemented by the resolvconf package, if installed
dns-nameservers 192.168.0.1 

add the following settings in the file:

auto eth0:1
iface eth0:1 inet static
address 192.168.0.6
netmask 255.255.255.0
network 192.168.0.0
broadcast 192.168.0.255
gateway 192.168.0.1

# dns-* options are implemented by the resolvconf package, if installed dns-nameservers 192.168.0.1

 

run command in root mode:

/etc/init.d/networking restart

that's all. you can run ifconfig to check if it works.

I tested it in ubuntu 6.10.

Tao obeys its own inherent Nature

posted on 2007-09-25 14:37 Wade 阅读(321) 评论(0) 编辑 收藏

导航

公告

昵称:Wade
园龄:4年5个月
粉丝:1
关注:0
<2007年9月>
2627282930311
2345678
9101112131415
16171819202122
23242526272829
30123456

搜索

 
 

随笔分类

相册

Javascript

PHP

最新评论

阅读排行榜

评论排行榜

推荐排行榜