ubuntu14.04 配置网络


ubuntu14.04 配置网络的练习


 

本文参考的资料:

  https://blog.csdn.net/liu782726344/article/details/52912797

感谢作者的分享!


 

打开配置文件进行修改:

sudo vim /etc/network/interfaces

看到配置文件的内容是:

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto eth0
iface eth0 inet dhcp

 

修改增加新内容:

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto eth0
#iface eth0 inet dhcp

iface eth0 inet static
address 静态IP地址
netmask 255.255.255.0
gateway 默认网关

dns-nameservers DNS1 DNS2

其中的静态IP地址、默认网关、DNS1、DNS2,请根据本地电脑的配置,进行相应配置。

然后关机,设置网络的连接方式为【桥接网卡】,启动ubuntu。

查看ip地址,发现ip地址为刚才配置的ip信息,ping一个网址,有数据响应,表示可以上网了。


 

总结:

  ubuntu 14.04 的网络配置文件位置:/etc/network/interface。

  ubuntu 14.04 的重启网络的命令是:sudo /etc/init.d/networking restart。


 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM