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
0
0
(请您对文章做出评价)
« 上一篇:type redefinition Error after Import ADO in vc++
» 下一篇:How To: Using symfony to add a join between tables

posted on 2007-09-25 14:37 Wade 阅读(231) 评论(0)  编辑 收藏 所属分类: Linux

导航

公告

<2007年9月>
2627282930311
2345678
9101112131415
16171819202122
23242526272829
30123456

搜索

 
 

随笔分类

相册

Javascript

PHP

最新评论

阅读排行榜

评论排行榜