ubuntu设置固定IP不出错的方法[转]

来源:互联网 发布:网络黄金egd双涡轮登录 编辑:程序博客网 时间:2024/06/05 00:34


打开/etc/network/interface,

修改内容为:

auto eth0 
iface eth0 inet static 
address IP 
netmask 子网掩码 
gateway 网关

保存,打开 /etc/resolv.conf,

nameserver 主DNS 
nameserver 后备DNS

在终端输入

/etc/init.d/networking restart

重启网卡

一般这样就可以了,奇怪的是我这样设置只可以访问百度等几个网站,其它一概不行。

而且重启进入gnome后,速度变的486运行win98一样。

解决方法打开/etc/rc.local

在里面添加一句

/sbin/ifconfig eth0 mtu 1300

重启就行了。


单网卡双IP打开 /etc/network/interface

auto eth0:0 
iface eth0:0 inet static 
address IP 
netmask 子网掩码 
gateway 网关

auto eth0:1 
iface eth0:1 inet static 
address IP 
netmask 子网掩码 
gateway 网关

双网卡双IP(应用情况较多,一般为一个内网一个为外网)

auto eth0 
iface eth0 inet static 
address IP 
netmask 子网掩码 
gateway 网关

auto eth1 
iface eth1 inet static 
address IP 
netmask 子网掩码 
gateway 网关


原创粉丝点击