安装Ubuntu网络设置连接配置

系统 Linux
安装完系统后Ubuntu网络设置连接才发现,原来Ubuntu 8.10 ( Intrepid Ibex ) 确实无法保存Ubuntu网络设置,重启之后又等于没设置过一样,到底什么问题我也不清楚,我的是局域网。

Ubuntu网络设置已被广泛应用但是也在不断的更新,这里介绍Ubuntu网络设置安装设置使用,帮助大家安装更新Ubuntu网络设置系统。在Ubuntu 8.10中设置网络后,重新启动,发现Ubuntu网络设置没有保存。

解决方法:
1、配置IP等相关Ubuntu网络设置
sudo vi /etc/network/interfaces
auto lo
iface lo inet loopback

#上面2行是系统loopback设备,必须有
auto eth0
iface eth0 inet static
address 192.168.0.2
netmask 255.255.255.0

安装完系统后Ubuntu网络设置连接才发现,原来Ubuntu 8.10 ( Intrepid Ibex ) 确实无法保存Ubuntu网络设置,重启之后又等于没设置过一样,到底什么问题我也不清楚,我的是局域网。我是这样解决的,把有线连接中的 Auto eth0 先删除掉,然后手动添加一个新的连接,这样就可以保存设置了。

检查Ubuntu网络设置
$ ifconfig

配置DHCP客户端
$ sudo vi /etc/network/interfaces
加入 iface eth0 inet dhcp

Ubuntu网络设置配置静态IP地址
$ sudo vi /etc/network/interfaces
eth0配置如下:
auto eth0
address 192.168.0.88
netmask 255.255.255.0
gateway 192.168.0.1

让新配置生效
保存退出后,使用重启networking命令让新配置生效:
$ sudo /etc/init.d/networking restart
也可以重启网卡让新配置生效,优点是不影响其他网络接口:
$ sudo ifdown eth0
$ sudo ifup eth0

临时改变IP地址
$ sudo ifconfig eth0 192.168.1.111 netmask 255.255.255.0
当系统重启动后,后会恢复interfaces中的配置。

设置默认网关的方法也有两种:
1. 在interfaces文件中设置。
$ sudo vi /etc/network/interfaces
在eth0的相关配置下加入gateway,如:
auto eth0
iface eth0 inet static
address 192.168.1.123
netmask 255.255.255.0
gateway 192.168.1.1

2. 直接用命令设置:
删除当前缺省网关
$ sudo route del default gw
手工配置缺省网关
$ sudo route add default gw 192.168.1.1
查看路由信息
$ route
使用本方法,修改当即生效,重新启动后,则interfaces文件中的设置有效。

查看主机名
$ hosts

临时修改主机名
$ sudo hostname testserver
执行完命令后,即时生效。

***修改主机名
$ sudo vi /etc/hostname
把新的主机名写入即可。当系统重启后,会读出此文件中主机名。

Ubuntu网络设置配置DNS服务器的地址,最多可以使用3个DNS服务器
$ sudo vi /etc/resolv.conf
nameserver 202.xx.xx.xx
nameserver 192.168.1.1
对”resolv.conf”的修改是即时生效的。可以使用nslookup命令进行DNS服务器查询,以验证”resolv.conf”配置文件。

【编辑推荐】

  1. Ubuntu vim配置文件及系统安装
  2. Ubuntu SCIM输入法的安装
  3. Ubuntu C++ 安装必要组件更新源
  4. 使用Ubuntu Server准备安系统过程
  5. 制作Ubuntu deb包使用方法
责任编辑:佚名 来源: CSDN
相关推荐

2010-01-06 10:04:55

2010-01-04 17:25:34

Ubuntu安装

2010-01-05 18:00:16

2010-09-06 13:11:55

无线网络Ubuntu

2011-09-02 16:50:32

2009-09-21 09:49:14

Ubuntu Serv网络配置操作系统

2010-03-04 13:56:31

Ubuntu mysq

2011-03-11 16:42:38

Ubuntu安装LAMP

2010-03-05 10:37:20

Ubuntu ligh

2010-02-06 15:50:00

Ubuntu网络

2011-02-24 12:57:42

Ubuntuvsftpd安装

2010-01-08 09:58:42

Ubuntu Secu

2010-03-05 15:14:55

Ubuntu网络配置

2009-07-09 15:58:40

Ubuntu JDK安

2010-01-07 12:46:28

Ubuntu nfs

2010-01-07 16:34:08

Ubuntu apac

2011-03-31 10:31:18

Ubuntu安装MRTG

2010-01-07 16:47:01

2010-01-07 15:29:58

Ubuntu nfs

2009-12-31 14:27:22

UBUNTU Orac
点赞
收藏

51CTO技术栈公众号