原文鏈接:blog.ouyangsihai.cn >> ubuntu服務(wù)器有線和無線網(wǎng)絡(luò)配置
有線網(wǎng)絡(luò)配置
打開/etc/network/interfaces文件
vi /etc/network/interfaces
默認(rèn)會(huì)有下面這些內(nèi)容
auto lo
iface lo inet loopback
如果沒有eth0配置,需要在上面的基礎(chǔ)上添加如下配置筐乳,才能有有線網(wǎng)絡(luò)
靜態(tài)ip配置
auto eth0
ifcace eth0 inet static
address xx
gateway xx
netmask xx
動(dòng)態(tài)ip配置
auto eth0
iface eth0 inet dhcp
有線網(wǎng)絡(luò)的dns如果沒有配置淮摔,在/etc/resolv.conf中添加dns
nameserver xx
動(dòng)態(tài)ip好像不需要配置這個(gè)贬媒。
最后濒析,再重啟網(wǎng)絡(luò)
/etc/init.d/newworking restart
如此庶香,有線網(wǎng)絡(luò)配置成功
無線網(wǎng)絡(luò)配置
打開/etc/network/interfaces文件
vi /etc/network/interfaces
添加如下內(nèi)容
auto wlan0
iface wlan0 inet dhcp
連接無線網(wǎng)絡(luò)
第一步
打開無線網(wǎng)卡:ifconfig wlan0 up
掃描無線網(wǎng)絡(luò):iwlist wlan0 scanning
選擇自己想連上的無線網(wǎng)絡(luò)名夫嗓,我要連的名字是“ubuntu”
第二步
連接無線網(wǎng)絡(luò):iwconfig wlan0 essid ubuntu key 123456
essid后邊是要連接的無線網(wǎng)絡(luò)名桐玻,key表示該網(wǎng)絡(luò)的接入密碼
ok!