一、配置IP地址 ubuntu的網(wǎng)絡(luò)配置信息放在 /etc/network/interfaces 中, 如果配置動態(tài)獲取ip,則在上述文件中加入以下內(nèi)容: auto eth0 iface eth0 inet dhcp
如果配置靜態(tài)ip,則添加如下內(nèi)容: auto eth0 iface eth0 inet static address 192.168.33.201 netmask 255.255.255.0 gateway 192.168.33.1
要是配置生效,需要重啟網(wǎng)卡: ifconfig eth0 down ifconfig eth0 up
不是root,命令前面加sudo
接著用ifconfig命令查看ip是否配置成功 /etc/init.d/networking restart
二、配置DNS服務(wù)器 ubuntu 的dns服務(wù)器信息,放在 /etc/resolv.conf中, |
|