侧边栏壁纸
博主头像
WinJay博主等级

博观而约取 厚积而薄发

  • 累计撰写 319 篇文章
  • 累计创建 169 个标签
  • 累计收到 1 条评论
隐藏侧边栏

Ubuntu 修改网络配置命令

WinJay
2013-05-24 / 0 评论 / 0 点赞 / 80 阅读 / 1,137 字 / 正在检测是否收录...
温馨提示:
本文最后更新于 2021-04-08,若内容或图片失效,请留言反馈。部分素材来自网络,若不小心影响到您的利益,请联系我们删除。

vi /etc/network/interfaces

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto eth0
iface eth0 inet static

address 212.215.161.94 IP地址 netmask 255.255.254.0 子网掩码 network 212.215.160.0 broadcast 212.215.161.255 gateway 212.215.160.1 网关 # dns-* options are implemented by the resolvconf package, if installed dns-nameservers 212.215.160.3 DNS重启网卡

root@Dev-srv:~# /etc/init.d/networking restart
Rather than invoking init scripts through /etc/init.d, use the service(8)
utility, e.g. service networking restart

Since the script you are attempting to invoke has been converted to an
Upstart job, you may also use the stop(8) and then start(8) utilities,
e.g. stop networking ; start networking. The restart(8) utility is also available.
networking stop/waiting
networking start/running

0

评论区