from http://tiebob.blogspot.com/2008/01/ubuntu-ip.html 由於安裝的 Ubuntu 是Desktop的版本,所以,系統裝好了之後預設都是用 Dhcp來取得 IP,記錄一下用手動方式來設定IP # sudo vi /etc/network/interfaces 一、單網卡單 IP auto eth0 ## 重要,這一行一定要設定 iface eth0 inet static address [IP] ## 請將 [IP] 換成你要的 IP netmask 255.255.255.0 gateway 192.168.1.1 二、單網卡多個 IP(直接在網卡後,加上 「:n「) auto eth0:0 iface eth0:0 inet static address [IP] netmask [遮罩] gateway [閘道] auto eth0:1 iface eth0:1 inet static address [IP] netmask [遮罩] gateway [閘道] 設定好了之後,需要重新啟動網卡才會生效,可以利用下列指令來達到這個動作 # sudo /etc/init.d/networking restart