新手~求助`ubuntu用路由上网问题~~~
原来在家的时候用ADSL上网,现在回到了宿舍要用路由器上网,可是不知道怎么配置~~~我的路由IP是192.168.1.1,我用ifconfig eth0 192.168.1.123命令配置了自己的IP,就可以访问 路由了,但是 为什么不能 上网啊~ 还要怎么配置~~那个 高手帮忙下~~不甚感激~~~ gateway & dns 启用路由的DHCP
然后配置网卡ip获取方式为DHCP 谢谢了~~我现在搞定了~不过我没配置 DHCP
我是根据 以下的配置弄好的~
配置基本网络参数
内容提要
1.
使用手工方式修改网络参数
2.
实现 Hosts 表的静态域名解析
*
如果您在安装 Ubuntu 的过程中已经配置好了网络参数,可以略过本节内容
*
如果您在安装 Ubuntu 的过程中使用了 DHCP 客户端设置,可以使用如下的方法将服务器设置为静态地址,本节重点讲述这种情况
*
在安装之后可以用本节讲述的方法随时修改网络配置
TCP/IP 配置文件族
配置文件名 功能
/etc/network/interfaces 网络接口参数配置文件
/etc/inetd.conf 定义由超级进程 inted 启动的网络服务
/etc/xinetd.conf 定义由超级进程 xinted 启动的网络服务
/etc/hosts 完成主机名映射为 IP 地址的静态 DNS 解析功能
/etc/hostname 记录本机的主机名
/etc/networks 完成本地域名与网络地址(网络ID)的映射
/etc/host.conf 配置域名服务客户端的控制文件
/etc/resolv.conf 配置域名服务客户端的配置文件,用于指定域名服务器的位置
/etc/protocols 设定了主机使用的协议以及各个协议的协议号
/etc/services 设定主机的不同端口的网络服务
配置网络接口
Ubuntu 的网络接口配置文件是 /etc/network/interfaces ,使用如下的命令修改配置文件:
sudo vim /etc/network/interfaces
将默认的配置文件
修改前的 /etc/network/interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
auto eth0
iface eth0 inet dhcp
根据自己的需要改为:
修改后的 /etc/network/interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interfaceauto eth0
auto eth0
iface eth0 inet static
address 192.168.0.222
netmask 255.255.255.0
network 192.168.0.0
broadcast 192.168.0.255
gateway 192.168.0.1
您还可以添加如下的配置为本地网卡邦定第二个 IP 地址:
auto eth0:0
iface eth0:0 inet static
address 192.168.0.250
netmask 255.255.255.0
network 192.168.0.0
broadcast 192.168.0.255
gateway 192.168.0.1
配置文件修改完毕,必须使用如下命令重新启动网络服务,使配置生效。
sudo /etc/init.d/networking restart
页:
[1]