现在的位置: 首页 > 综合 > 正文

Slackware12.0下的ADSL拨号

2013年03月03日 ⁄ 综合 ⁄ 共 4811字 ⁄ 字号 评论关闭

/*********************************************************************
*    file: Slackware12.0下的ADSL拨号
*    date:2008-03-08(modified)
*    author: 零同学 <lingyi.pro#gmail.com>
*    本文来源:http://www.0x55.cn
*
*    个人说明:
*    本文只是简单地通过step-by-step的方式介绍Linux下ADSL拨号连网,
*    其中大多数命令均需root权限,存在一定的危险性,请谨慎运行!
*   
*    特别声明:
*    a.一切操作/运行结果请使用者自负!
*    b.本文档不进行任何相关的安全设置,一切后果请使用者自负!
*    c.请认真阅读以上说明。
*
**********************************************************************/

(0) 系统信息及软件相关信息:
Linux Distribution:    Slackware 12.0(2.6.21.5-smp)
PPPoE Version:    3.8

(1)拨号前
a.先运行 # ifconfig eth0 down
/* 注1:本机网卡为eth0;有些机器可能为eth1,不清楚的运行ifconfig -a查看网卡相关信息 */
/* 注2:不运行此命令则有可能在后边dial成功后仍无法联网 */

b.运行# netconfig,设置网络连接方式时选择loopback方式。
/* netconfig是Slackware特有的软件包,其它发行版请自行查阅相关资料 */

(2)拨号,根据提示输入相关信息。如下示例:
bash-3.1# pppoe-setup    /* 运行pppoe软件的相关设置 */
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 2000672**):     /* 此处输入201上网卡账号 */

INTERFACE

>>> 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,若与你查看的信息一直,直接按回车确定即可 */

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):   /* 此处直接回车即可 */

DNS

Please enter the IP address of your ISP's primary DNS server.
If your ISP claims that 'the server will provide DNS addresses',
enter 'server' (all lower-case) here.
If you just press enter, I will assume you know what you are
doing and not modify your DNS setup.
>>> Enter the DNS information here: 218.30.19.40   /* 此填西安电信的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: 61.134.1.4  /* 西安电信备用DNS地址 */

PASSWORD

>>> Please enter your PPPoE password:    /* 201上网卡账号密码 */
>>> Please re-enter your PPPoE password:   /* 确认密码 */

FIREWALLING

Please choose the firewall rules to use.  Note that these rules are
very basic.  You are strongly encouraged to use a more sophisticated
firewall setup; however, these will provide basic security.  If you
are running any servers on your machine, you must choose 'NONE' and
set up firewalling yourself.  Otherwise, the firewall rules will deny
access to all standard servers like Web, e-mail, ftp, etc.  If you
are using SSH, the rules will block outgoing SSH connections which
allocate a privileged source port.

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): 1   /* 防火墙设置;看说明,个人电脑一般推荐0(不使用防火墙) */

** Summary of what you entered **

Ethernet Interface: eth0
User name:          2000672**
Activate-on-demand: No
Primary DNS:        218.30.19.40
Secondary DNS:      61.134.1.4
Firewalling:        STANDALONE

>>> Accept these settings and adjust configuration files (y/n)? y   /* 若以上设置均正确,则y保存设置 */
Adjusting /etc/ppp/pppoe.conf
Adjusting /etc/resolv.conf
  (But first backing it up to /etc/resolv.conf-bak)
Adjusting /etc/ppp/pap-secrets and /etc/ppp/chap-secrets
  (But first backing it up to /etc/ppp/pap-secrets-bak)
  (But first backing it up to /etc/ppp/chap-secrets-bak)

Congratulations, it should be all set up!

Type 'pppoe-start' to bring up your PPPoE link and 'pppoe-stop' to bring
it down.  Type 'pppoe-status' to see the link status.
bash-3.1#

(3)运行,查看状态,测试

bash-3.1# pppoe-start
.... Connected!
bash-3.1# pppoe-status
pppoe-status: Link is up and running on interface ppp0
ppp0      Link encap:Point-to-Point Protocol 
          inet addr:124.114.126.141  P-t-P:124.114.126.1  Mask:255.255.255.255
          UP POINTOPOINT RUNNING NOARP MULTICAST  MTU:1492  Metric:1
          RX packets:20653 errors:0 dropped:0 overruns:0 frame:0
          TX packets:15771 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:3
          RX bytes:20407680 (19.4 MiB)  TX bytes:1284620 (1.2 MiB)

软件运行正常,已获得动态IP。不过还是要测试一下,随便ping一个网站试试:

bash-3.1# ping www.linuxsir.org
PING www.linuxsir.org (218.61.34.144) 56(84) bytes of data.
64 bytes from 218.61.34.144: icmp_seq=1 ttl=51 time=94.3 ms
64 bytes from 218.61.34.144: icmp_seq=2 ttl=51 time=94.8 ms
64 bytes from 218.61.34.144: icmp_seq=3 ttl=51 time=94.5 ms
64 bytes from 218.61.34.144: icmp_seq=4 ttl=51 time=93.9 ms

--- www.linuxsir.org ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3000ms
rtt min/avg/max/mdev = 93.970/94.418/94.802/0.299 ms

连通正常返回数据,网络连接成功。这样就可以开始罪恶的surfing了 ... ...

Have fun! ^_^

----------------------------------------
附录:
参考资料
1 http://bbs.linuxsir.org
2 http://bbs.chinaunix.net
3 http://www.linuxforum.com/forums
 

抱歉!评论已关闭.