您的位置:首页 > 其它

Ubuntu配置静态IP地址+上网

2012-12-30 18:02 357 查看
1. ~# gedit /etc/network/interfaces

将dhcp 一行屏蔽

添加和静态ip有关的参数

我修改后的文件如下:

# 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 dhcp
iface eth0 inet static

address 192.168.1.192
netmask 255.255.255.0
gateway 192.168.1.1
nameserver 192.168.1.1



2. ~#gedit /etc/resolv.conf

设置dns

我的配置文件如下:

nameserver 192.168.1.1
nameserver 8.8.4.4
domain domain
search domain


3.执行下面两个命令,启用新设置

~#ifdown eth0

~#ifup eth0

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