当前位置:首页>维修大全>综合>

如何用命令行配置UbuntuServer网络(ubuntu服务器版怎么设置网络)

如何用命令行配置UbuntuServer网络(ubuntu服务器版怎么设置网络)

更新时间:2025-04-10 23:02:16

如何用命令行配置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就说明已经通了。

更多栏目