Ubuntu 1404设置静态IP
2017-08-16 21:34
615 查看
编辑修改interfaces文件
sudo vim /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 #——————shielding DHCP #iface eth0 inet dhcp #——————add your setting here iface eth0 inet static address 192.168.1.214 gateway 192.168.1.1 netmask 255.255.255.0 network 192.168.1.0 broadcast 192.168.1.255
修改DNS
resolv.conf 这个文件DHCP获取后自动改写,这里我没有修改,原来已经通过DHCP获取了一个,贸然填上8.8.8.8谷歌的,可能还会缓慢sudo vim /etc/resolv.conf # Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8) # DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN nameserver 49.223.187.120 nameserver 175.190.255.50 search DHCP HOST
重启网卡
一般使用sudo service networking restart
或者
sudo /etc/init.d/networking restart
这两个命令都可以重启网卡,重新载入配置,但是在这个Ubuntu 1404 server版本中,没有任何反应,还是原来DHCP获取的IP,通过关闭和开启网卡可以,没有搞清楚原因
ifconfig eth0 down ifconfig eth0 up
相关文章推荐
- Ubuntu 14.04静态ip设置
- ubuntu server设置静态IP和DNS
- 虚拟机ubuntu14.04设置静态ip
- Ubuntu局域网中设置代理服务器上网和设置静态IP
- Ubuntu静态ip的设置方法
- Ubuntu 静态ip的设置方法
- Ubuntu下设置通过NAT方式上网(静态IP)
- Ubuntu中设置静态IP和DNS
- Ubuntu 12.04 静态ip的设置方法
- Ubuntu server 设置静态IP
- ubuntu 16.04 静态IP设置
- Ubuntu 静态IP设置
- 虚拟机ubuntu14.04系统设置静态ip
- ubuntu静态IP的设置
- ubuntu14.04设置静态ip
- Ubuntu静态IP设置
- ubuntu设置静态IP及修复重启电脑后DNS须重新设置的问题
- ubuntu设置静态ip
- vmware ubuntu静态IP联网设置