现在的位置: 首页 > 综合 > 正文

ubuntu修改ip地址重启网络

2018年04月20日 ⁄ 综合 ⁄ 共 1059字 ⁄ 字号 评论关闭

Ubuntu修改网卡配置文件:

vim /etc/network/interfaces<pre name="code" class="plain">cat /etc/network/interfaces

auto eth0
iface eth0 inet static
        address 192.168.1.41
        gateway 192.168.1.1
        netmask 255.255.255.0
        dns-nameserver 114.114.114.114


然后重启网卡:

ifdown eth0
ifup eth0

VMware下安装的Linux虚拟机ping网关和baidu.com出现下面情况:

64 bytes from 192.168.20.254: icmp_seq=1 ttl=128 time=2460 ms (DUP!)
64 bytes from 192.168.20.254: icmp_seq=1 ttl=128 time=2460 ms (DUP!)

重启VMware的网络:VMnet1 和VMnet8以后解决了问题

ubuntu安装开启启动管理软件:

apt-get install sysv-rc-conf
<span class="pln" style="line-height: 28px; font-family: monospace; font-size: 16px; white-space: pre-wrap;">sysv</span><span class="pun" style="line-height: 28px; color: rgb(102, 102, 0); font-family: monospace; font-size: 16px; white-space: pre-wrap;">-</span><span class="pln" style="line-height: 28px; font-family: monospace; font-size: 16px; white-space: pre-wrap;">rc</span><span class="pun" style="line-height: 28px; color: rgb(102, 102, 0); font-family: monospace; font-size: 16px; white-space: pre-wrap;">-</span><span class="pln" style="line-height: 28px; font-family: monospace; font-size: 16px; white-space: pre-wrap;">conf </span>

抱歉!评论已关闭.