ubuntu 12.04网络配置之设置静态iP

前端之家收集整理的这篇文章主要介绍了ubuntu 12.04网络配置之设置静态iP前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

step:

1.输入命令:

sudo vi /etc/network/interfaces

看到如下内容

2、追加以下内容

iface eth0 inet static
address 192.168.1.122
netmask 255.255.255.0
gateway 1.1
dns-nameservers 202.106.0.20

3、重启网络服务,输入以下命令:

 sudo /etc/init.d/networking  restart

4、重启服务器

sudo reboot

5、重启后,查看ip修改是否正确

ifconfig

6、验证是否可以联网

ping www.baidu.com

 

猜你在找的Linux相关文章