Linux 网络接口配置文件及相关工具(2)
DHCP_HOSTNAME[2]=""
# Config information for eth3:
IPADDR[3]=""
NETMASK[3]=""
USE_DHCP[3]=""
DHCP_HOSTNAME[3]=""
# Default gateway IP address:
GATEWAY="192.168.1.1" 注:指定网关;
4.4 SuSE或OpenSuSE网卡配置文件和配置工具;
(详见后继文章)
5、关于拔号工具的介绍;
有的弟兄可能需要ADSL猫和普通猫的拔号工具;现在我们分别介绍一下;
5.1 ADSL pppoe 拔号工具rp-pppoe;
如果您的ADSL不是路由的,如果是路由的,在路由路就能设置好自动拔号。只要把机器接上就能用了,这个咱们不说了,路由器大家都会用;但如果您的ADSL不支持路由,或您想用您当前所用的主机来做路由器;这就需要一个拔号软件;
目前国内大多城市都用的是pppoe协议 ,所以我们有必要介绍 pppoe 拔号软件,在Linux中,这个软件的名字是 rp-pppoe 。
5.11 各大发行版自带的 rp-pppoe 的安装和使用;
rp-pppoe 目前在各大发行版本都是存在的,比如Redhat/Fedora、红旗、Slackware、Debian、SuSE等系统,都是采用这个拔号软件,所以 您大可不必为下载源码编译安装。只需要在各大发行版的安装盘中就可以找得到;请用各大发行版自带的软件包管理工具来安装此软件包;
* 如果您用的是各大发行版提供的rp-pppoe软件包
比如 RPM包的系统是用 rpm -ivh rp-pppoe*.rpm
Slackware 系统是用 installpkg rp-pppoe*.tgz
在Redhat/Fedora 中可以通过图形配置工具来完成,redhat-config-network 命令,调用配置网络,要通过XDSL来添加拔号,比较简单,所有发行版通用的方法是adsl-setup 命令来配置ADSL:
[root@localhost ~]# adsl-setup 注:配置pppoe拔号,请文档下面,都差不多;
[root@localhost ~]# adsl-start 注:启动拔号;
[root@localhost ~]# adsl-stop 注:断开连接;
5.12 如果是源码包安装,我们要自己来编译安装;
[root@localhost ~]# tar zxvf rp-pppoe-3.8.tar.gz
[root@localhost ~]# cd rp-pppoe-3.8
[root@localhost rp-pppoe-3.8]# ./go
Welcome to the Roaring Penguin PPPoE client setup. First, I will run
some checks on your system to make sure the PPPoE client is installed
properly...
Looks good! Now, please enter some information:
USER NAME
>>> Enter your PPPoE user name (default ): 在这里添写你的拔号用户名;就是服务商提供的;
>>> Enter the Ethernet interface connected to the DSL modem
For Solaris, this is likely to be something like /dev/hme0.
For Linux, it will be ethn, where 'n' is a number.
(default eth0): eth0 如果是乙太接口的ADSL,就要在这里写上接猫的那个网络接口号。此处是eth0;
Do you want the link to come up on demand, or stay up continuously?
If you want it to come up on demand, enter the idle time in seconds
after which the link should be dropped. If you want the link to
stay up permanently, enter 'no' (two letters, lower-case.)
NOTE: Demand-activated links do not interact well with dynamic IP
addresses. You may have some problems with demand-activated links.
>>> Enter the demand value (default no): 注:默认回车
>>> Enter the DNS information here: 202.96.134.133 注:在这里写上DNS服务器地址;可以和提供商要,也可以用我写的这个;
Please enter the IP address of your ISP's secondary DNS server.
If you just press enter, I will assume there is only one DNS server.
>>> Enter the secondary DNS server address here: 202.96.128.143 这是第二个DNS服务器地址;
>>> Please enter your PPPoE password:在这里输入用户的密码;
>>> Please re-enter your PPPoE password: 确认密码;
The firewall choices are:
0 - NONE: This script will not set any firewall rules. You are responsible
for ensuring the security of your machine. You are STRONGLY
recommended to use some kind of firewall rules.
1 - STANDALONE: Appropriate for a basic stand-alone web-surfing workstation
2 - MASQUERADE: Appropriate for a machine acting as an Internet gateway
for a LAN
>>> Choose a type of firewall (0-2): 2 注:在这里写上2,可以共享上网的;当然还得加一条防火墙规划 ;
Ethernet Interface: eth0
User name: dxxx
Activate-on-demand: No
Primary DNS: 202.96.134.133
Secondary DNS: 202.96.128.143
Firewalling: MASQUERADE
>>> Accept these settings and adjust configuration files (y/n)? y 注:是不是保存配置。
5.2 普通猫的拔号工具介绍;
普通猫的拔号工具主要有kppp和wvdial;在Redhat/Fedora中,用system-config-network 或redhat-config-network 也能设置ppp拔号。在KDE桌面环境下,大家一般都用kppp拔号工具,点鼠标就可以完成。
wvdial工具是文本的,几乎在各大发行版都有。wvdial的配置文件是/etc/wvdial.conf 。如果您的猫已经驱动好了,运行一下wvdialconf命令就生成了/etc/wvdial.conf了 。当然您得查看一下它的内容;
[root@localhost ~]# wvdialconf[root@localhost ~]# more /etc/wvdial.conf
6、DNS客户端配置文件/etc/resolv.conf;
本来不应该把DNS客户端配置文件放在这里来说,但由于新手弟兄上网时,虽然能拔号,但不能以域名访问。究其原因是由于没有修改 /etc/resolv.conf 文件;/etc/resolv.conf 里面存放的是各大通信公司DNS服务器列表;下面的三个地址可以用一用;当然您可以打电话问你的服务商;
nameserver 202.96.128.143
nameserver 202.96.68.38
- 最新评论