Ubuntu8.10 下 配置網絡參數
1. 以DHCP 方式獲取IP
方法一、在/etc/network/interfaces 文件加入:
auto eth0
iface eth0 inet dhcp
然後
sudo /etc/init.d/networking restart 生效
方法二、直接用sudo dhclient eth0
2 .配置靜態IP
方法一、在/etc/network/interfaces 文件加入:
auto eth0
iface eth0 inet static
address 192.168.2.223
getway 192.168.2.1
netmask 255.255.255.0
然後
sudo /etc/init.d/networking restart 生效
方法二、直接用 ifconfig eth0 192.168.2.223 gateway 192.168.2.1 netmask 255.255.255.0 up
3. 更改主機名稱
sudo /bin/hostname newname
4. DNS 配置
Sudo vim /etc/resolv.conf
加入
Nameserver 202.96.128.68
Nameserver 61.144.56,101
然後
sudo /etc/init.d/networking restart 生效