您的位置:首页 > 其它

Ubuntu 14.04 静态IP设置

2015-08-31 22:09 253 查看
1. 编辑/etc/network/interfaces

vim /etc/network/interfaces

2.将以下五项添加到/etc/network/interfaces中

Static declaration (using <interface> chosen above): iface <interface> inet static
Static IP address: address <chosen ip>
Network gateway: gateway <gateway ip>
Netmask / subnet: netmask <netmask ip>
DNS nameservers: dns-nameservers <dns ip’s>
3. 修改后文件如下

# 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

auto eth0

# The primary network interface
iface eth0 inet static
address 192.168.1.8
gateway 192.168.1.1
netmask 255.255.255.0
dns-nameservers 223.5.5.5 223.6.6.6

4. 重启网络服务

service networking restart
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: