ubuntu设置固定IP

来源:岁月联盟 编辑:exp 时间:2012-03-21
 首先设置IPsudo gedit /etc/network/interface 将其内容删除 加上一下内容 auto loiface lo inet loopback auto eth0iface eth0 inet staticaddress 192.168.1.47netmask 255.255.255.0network 192.168.1.0broadcast 192.168.1.255gateway 192.168.1.1 保存 然后修改DNSsudo gedit /etc/resolv.conf 将内容修改为 nameserver 202.112.14.151nameserver 218.6.200.139nameserver 61.139.2.69 查看dnsless /etc/resolv.conf保存 重启网络连接sudo /etc/init.d/networking stopsudo /etc/init.d/networking startsudo /etc/init.d/networking restart 查看路由相关信息:route -n   作者 jayghost