`
eimhee
  • 浏览: 2115660 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

在ubuntu中添加新IP

阅读更多

vi /etc/network/interfaces

 

会显示如下:

auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static
        address 207.210.118.56
        netmask 255.255.255.224
        broadcast 207.210.118.63
        network 207.210.118.32
        gateway 207.210.118.33

 

添加新行

auto eth0:1

 在这行下面

auto eth0

 

添加新的interface信息

iface eth0:1 inet static
        address 207.210.118.58
        netmask 255.255.255.224
        broadcast 207.210.118.63
        network 207.210.118.32
        gateway 207.210.118.33

检查MASK和网关是否正确

 

添加完毕, 会显示如下

auto lo
iface lo inet loopback

auto eth0
auto eth0:1
iface eth0 inet static
        address 207.210.118.56
        netmask 255.255.255.224
        broadcast 207.210.118.63
        network 207.210.118.32
        gateway 207.210.118.33
iface eth0:1 inet static
        address 207.210.118.58
        netmask 255.255.255.224
        broadcast 207.210.118.63
        network 207.210.118.32
        gateway 207.210.118.33

 

之后重启网络

/etc/init.d/networking restart

 

电子书下载

1
2
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics