Monday, December 22, 2008

Change DHCP IP to static IP in Ubuntu 8.10

若要將 Ubuntu 8.10 中的 DHCP IP 改成 static IP,必須手動用以下步驟改,因為 Ubuntu 8.10 的 NetworkManager 有 bug

$ sudo update-rc.d –f NetworkManager remove
$ sudo reboot


編輯 /etc/network/interfaces
$ sudo nano /etc/network/interfaces

auto lo eth0
iface lo inet loopback
iface eth0 inet static
address xxx.xxx.xxx.xxx(enter your ip here)
netmask xxx.xxx.xxx.xxx
gateway xxx.xxx.xxx.xxx(enter gateway ip here)

編輯 /etc/resolv.conf
$ sudo nano /etc/resolv.conf

# Generated by NetworkManager
nameserver xxx.xxx.xxx.xxx(enter your dns server ip)
nameserver xxx.xxx.xxx.xxx(enter your alt dns server ip)

$ sudo /etc/init.d/networking restart

No comments: