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

本文详细介绍了在Ubuntu系统中如何配置单网卡或多网卡的静态IP地址,并提供了设置DNS服务器的方法,以及通过调整MTU值来优化网络连接的具体步骤。


打开/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 网关


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值