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。


 

转载于:https://www.cnblogs.com/gyfluck/p/9553993.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值