如何用命令行配置UbuntuServer网络

更新时间:02-01 教程 由 心蛊 分享

如何用命令行配置UbuntuServer网络?

ubuntu系统是以桌面应用为主的linux操作系统,下文是用命令行配置Ubuntu Server网络的方法。

首先配置你的ip地址等信息:

用vi打开

/etc/network/interfaces :vi /etc/network/interfaces

如果你用的是固定的ip的话就输入下面的内容

auto eth0 iface eth0 inet static address 192.168.0.2 #你的ip地址 netmask 255.255.255.0 gatway 192.168.0.1

用vi建立文件/etc/resolv.conf :vi /etc/resolv.conf

在该文件中输入如下内容

nameserver 202.117.0.20

nameserver 202.117.0.21#也可以不写,这是备用域名服务器地址

完成上面的人物以后在终端中输入: sudo /etc/init.d/networking restart 一般情况下会等待几秒钟,当弹出[ok]时就说明配置成功了

为了测试可以在终端中输入ping命令:ping 如果有反应而不是network is unreachable就说明已经通了。

声明:关于《如何用命令行配置UbuntuServer网络》以上内容仅供参考,若您的权利被侵害,请联系13825271@qq.com
本文网址:http://www.25820.com/tutorial/14_2249288.html