Ubuntu
設定IP
# sudo vi /etc/network/interfaces
auto lo
iface lo inet loopback
auto eth0
#預設的DHCP取得IP
# iface eth0 inet dhcp
#改為靜態IP
iface eth0 inet static
#固定IP位址
address 192.168.1.100
#網路遮罩
netmask 255.255.255.0
#預設閘道
gateway 192.168.1.1
最後別忘了重新啟動網路才會生效喔
#sudo /etc/init.d/networking restart
設定DNS server
#vi /etc/resolv.conf
nameserver 168.95.1.1
Fedora
/etc/sysconfig/network-scripts/ifcfg-eth0
改為 Static IP
#USERTRL=no
#PEERDNS=yes
TYPE=Ethernet
DEVICE=eth0
#BOOTPROTO=dhcp
#BOOTROTO=none
BOOTPROTO=static
ONBOOT=yes
NETMASK=255.255.255.0
IPADDR=192.168.0.10
NETWORK=192.168.0.0
BROADCAST=192.168.0.255
GATEWAY=192.168.0.1
設定DNS Server
#vi /etc/resolv.conf
nameserver 168.95.1.1