首页 > 系统服务 > 详细

linux 单网卡绑定两个ip

时间:2015-03-04 12:53:03      阅读:189      评论:0      收藏:0      [点我收藏+]

#vi /etc/network/interfaces
OR
$ sudo vi /etc/network/interfaces
Modify as follows:

 1 auto eth0
 2 auto eth0:0
 3 auto eth0:1
 4 iface eth0 inet static
 5 address 192.168.1.1
 6 netmask 255.255.255.248
 7 gateway 192.168.1.254
 8 
 9 iface eth0:0 inet static
10 address 192.168.1.2
11 netmask 255.255.255.248
12 
13 iface eth0:1 inet static
14 address 192.168.1.3
15 netmask 255.255.255.248
16 
17 # add rest of alias / binds below

Save and close the file.

Now restart networking, enter:
# /etc/init.d/networking restart
OR
$ sudo /etc/init.d/networking restart

 

linux 单网卡绑定两个ip

原文:http://www.cnblogs.com/chris-cp/p/4312794.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!