1. 我在 Ubuntu 下是使用 root 權限進入
2. 請修改 /etc/network/interfaces
A.Ubuntu DHCP 設定方式如下:
auto eth0
iface eth0 inet dhcp
B. Static IP 設定方式如下:
auto eth0
iface eth0 inet static
address 192.168.10.100
netmask 255.255.255.0
gateway 192.168.10.1
如要設定 Static route,使用 up command 來設定,如下:
up route add -net 10.10.0.0 netmask 255.255.0.0 gw 192.168.10.254
這樣就可以透過 192.168.10.254 這台機器連到 10.10 的網段去
一起寫就是:
auto eth0
iface eth0 inet static
address 192.168.10.100
netmask 255.255.255.0
gateway 192.168.10.1
up route add -net 10.10.0.0 netmask 255.255.0.0 gw 192.168.10.254
重啟動網路:
$ /etc/init.d/networking restart
另外,如要設定單網卡多個 IP,請直接在網卡後,加上 “:n“
auto eth0:0
iface eth0:0 inet static
address [IP]
netmask [your_netmask]
gateway [[your_gateway]
auto eth0:1
iface eth0:1 inet static
address [IP]
netmask [your_netmask]
gateway [[your_gateway]
################################################
lost eth0 when using a copied ubuntu-server vm
1. rm -f /etc/udev/rules.d/70-persistent-net.rules
2. reboot ubuntu
於 VMware 複製 Ubuntu Image 後要做的修改
1. 修改 Host Name 設定 : 改 /etc/hostname 中的電腦名稱即可
2. 修改 Hosts 設定 : 改 /etc/hosts 中的電腦名稱
3. reboot 重新開機
沒有留言:
張貼留言