ubuntu9.10网络配置

来源:互联网 发布:淘宝汽车装饰安装联盟 编辑:程序博客网 时间:2024/05/01 10:56
auto lo
iface lo inet loopback
auto eth0

iface eth0 inet static #ip
address 172.16.39.111
netmask 255.255.254.0
gateway 172.16.38.1

auto br100
iface br100 inet static #桥接 一般不用
bridge_ports eth1
bridge_stp off
bridge_maxwait 0
bridge_fd 0
address 192.168.0.1
netmask 255.255.0.0
broadcast 192.168.255.255

------------------------------------------------------------

1、设置IP地址、网关
nano /etc/network/interfaces /etc/network/interfacesbak #备份原有配置文件
nano /etc/network/interfaces #编辑网网卡配置文件
auto lo
iface lo inet loopback
auto eth0 #开机自动连接网络
iface eth0 inet static #static表示使用固定ipdhcp表述使用动态ip
address 192.168.21.168 #设置ip地址
netmask 255.255.255.0 #设置子网掩码
gateway 192.168.21.2 #设置网关
ctrl+o #保存配置
ctrl+x #退出
2、设置dns
cp /etc/resolv.conf /etc/resolv.confbak #备份原有dns配置文件
nano /etc/resolv.conf #编辑配置文件,添加以下内容
nameserver 8.8.8.8 #设置首选dns
nameserver 8.8.4.4 #设置备用dns
ctrl+o #保存配置
ctrl+x #退出
系统运维 温馨提醒:qihang01原创内容版权所有,转载请注明出处及原文链接
3、重启网络
/etc/init.d/networking restart #重启网络

至此IP地址、网关、DNS配置完成现在系统已经可以上网了。

转自:http://cache.baiducontent.com/c?m=9d78d513d98206f905fa940f4f4d863b0e54f1743ca6c7140f83d51984642a1d1020a6e6677b0704a29e202156ef5e5d9aa46523604234f0db9687109bfdd03f2efb3a292042db1405d36efe911d799267cc01a3b81990e6a7748ee98985c85425ca56017f80fa8a581714bc34a6033195a79e4c1f5d1ab0fa3012a51f2877&p=ce7dc64ad4d905ef08e2977e0d4dbb&newp=9f39c54ad5c341f046f3d62d021491231610db2151d7d61520ca8d0a&user=baidu&fm=sc&query=sudo+pico+/etc/network/interfaces&qid=&p1=4

0 0
原创粉丝点击