首頁 > uBuntu > uBuntu以一張網卡設定多個IP

uBuntu以一張網卡設定多個IP

2010年2月26日 發表評論 閱讀評論

筆記一下~一張網卡設定多個IP~
(之前一直會不work是為什麼~~~~~~)

設定:

$ sudo vim /etc/network/interfaces

設定內容:

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
#iface eth0 inet dhcp

auto eth0
iface eth0 inet static
address 192.168.111.73
netmask 255.255.255.0
network 192.168.111.0
broadcast 192.168.111.255
gateway 192.168.111.1
dns-nameservers 168.95.1.1

auto eth0:1
iface eth0:1 inet static
address 192.168.88.85
netmask 255.255.255.0
gateway 192.168.88.1
network 192.168.88.0
broadcast 192.168.88.255
dns-nameservers 168.95.1.1

auto eth0:2
iface eth0:2 inet static
address 192.168.88.86
netmask 255.255.255.0
gateway 192.168.88.1
network 192.168.88.0
broadcast 192.168.88.255
dns-nameservers 168.95.1.1

再來手動指定 dns 也就是 nameserver

$ sudo vim /etc/resolv.conf
nameserver 168.95.1.1
nameserver 139.175.55.244
domain rdnb
search rdnb vm3 vm3.com rdandy.com

nameserver 指定兩個,做為備用~

Categories: uBuntu Tags: ,
  1. 目前尚無任何的評論。