码迷,mamicode.com
首页 > 系统相关 > 详细

linux 单网卡绑定两个ip

时间:2015-03-04 12:55:00      阅读:152      评论: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
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!