Chinaunix首页 | 论坛 | 博客
  • 博客访问: 3417172
  • 博文数量: 1247
  • 博客积分: 11880
  • 博客等级: 上将
  • 技术积分: 13175
  • 用 户 组: 普通用户
  • 注册时间: 2004-11-21 09:13
文章分类

全部博文(1247)

文章存档

2015年(1)

2014年(3)

2013年(3)

2012年(16)

2011年(38)

2010年(141)

2009年(96)

2008年(159)

2007年(158)

2006年(327)

2005年(286)

2004年(19)

分类: LINUX

2009-10-31 15:55:12

介绍

虽然利用路由器连接到Internet非常普遍,但是经常也使用ADSL(也称作‘DSL’)调制解调器通过PPPOE来连接到Internet。

当然,你需要向(ISP)申请Internet连接业务,申请后你就可以连接并使用Internet。然后在你的ADSL调制解调器上的"DSL"信号灯会显示你连接Internet的线路处于同步状态。

你需要ISP提供给你的用户名和密码来使用你的DSL帐号,同时,需要一条合适的网线来连接以太网卡和PPPoE调制解调器。

在命令行下配置PPPoE

我们使用终端来配置调制解调器。通过菜单上的应用程序>附件>终端来打开终端。

你需要安装PPPoE包来使用以下的命令。这个包是默认安装的,但是有可能在更改配置的时候丢失。如果以下的命令不能执行,你需要再安装这个包(请参考PPPoE包安装的章节)。

在终端中输入:

sudo pppoeconf

一个基于文本菜单的程序会指导你进行下面的步骤:

  1. 确认以太网卡已被检测到。
  2. 输入你的用户名(由ISP所提供 注意:输入时请先清除输入框中的“username“,否则可能造成验证错误)。
  3. 输入你的密码(由ISP所提供)。
  4. 如果你已经配置了一个PPPoE的连接,会通知你这个连接将会被修改。
  5. 弹出一个选项:你被询问是否需要'noauth'和'defaultroute'选项和去掉'nodetach',这里选择"Yes"。
  6. Use peer DNS - 选择 "Yes".
  7. Limited MSS problem - 选择 "Yes".
  8. 当你被询问是否在需要在进入系统的时候自动连接,你可以选择"Yes"。
  9. 最后,你会被询问是否马上建立连接。

当你完成这些步骤,你应该建立了连接并且能够使用了。

手动控制连接

在需要的时候启动ADSL连接,可以在终端中输入:

pon dsl-provider
(若登录的用户不是root的话。则应输入“sudo pon dsl-provider”)

断开ADSL连接,可以在终端中输入:

poff dsl-provider
(若登录的用户不是root的话。则应输入“sudo poff dsl-provider”)

遇到的问题

如果你发现连接正常工作,尝试手动去调整你之前ADSL连接的配置(参考前一节)。需要查看日志,可以在终端中输入:

plog

PPPoE包的安装

检查PPPoE包是否已经安装,可以在终端中输入:

dpkg -s pppoeconf

如果包已经安装好了,你应该在输出的信息中看到这两行:

Package: pppoeconf
Status: install ok installed

如果包没有安装,插入你的Ubuntu光盘,在终端中输入:

sudo apt-get install pppoeconf

如果提示找不到这个包,你就必须把Ubuntu光盘加入到软件源的列表中。要加入你的光盘,先保证你已经把光盘插入到CD驱动器中,然后在终端中输入:

sudo apt-cdrom add

如果以上操作的都失败了,你可以从 下载pppoeconf包。当然,前提是你有能够使用的Internet连接,然后通过CDR或者U盘传输到你的电脑。在GNOME中双击这个包来进行安装。

启动的注意事项

如果你的发现每次启动系统都需要手动运行pppoeconf来建立连接,你可以这样做:

  • 参考来编辑/etc/network/interfaces这个文件,使得'pppoe maintained'这一行在'auto dsl-provider'之前:
auto eth0
iface eth0 inet manual
pre-up /sbin/ifconfig eth0 up # line maintained by pppoeconf

auto dsl-provider
iface dsl-provider inet ppp
provider dsl-provider
  • 还是失败的话,编辑/etc/rc.local这个文件,在最后一行("exit 0")前,增加以下内容:
ifconfig eth0 up
pon dsl-provider


错误日志

如果你发现连接出现了问题,你可以在系统日志中找到有用的信息。你可以在终端或者图像界面中访问系统日志。

  • 使用图形界面的日志查看器,可以通过:系统>系统管理>系统日志。你会发现系统的信息是存储在/var/log/messages这个目录下。
  • 使用终端,输入:
sudo dmesg

Introduction

Although it may be very common to use a router to connect to the Internet, often it is needed to directly connect to an ADSL (frequently referred to as 'DSL') modem using PPPoE.

This is useful when you have a modem that don't have internal PPPoE dial up facility or When your modem is configured for "Bridge" connection. In both these cases, You need to do the PPPoE dial-up from your machine. this documentation shows how that can be achived

Of course, you will need to have subscribed to an (ISP), and that your Internet connection be installed and functional. A "DSL" light on your modem usually shows that the line is synchronized.

You will need your username and password provided by your ISP for your DSL account . You must also have an Ethernet card connected to your PPPoE modem with the correct type of cable.

Configuring PPPoE with the command line

To set up the modem, we will use a terminal. To open a terminal, use the menu bar : Applications > Accessories > Terminal.

You need the PPPoE package to be installed in order for the following command to work. This package is installed by default, but can be missing if the configuration has been changed. If the following command does not work, you will need to install this package (see the PPPoE package installation section).

In the terminal type:

sudo pppoeconf

A text-based menu program will guide you through the next steps, which are:

  1. Confirm that your Ethernet card is detected.
  2. Enter your username(provided by your ISP).
  3. Enter your password(provided by your ISP).
  4. If you already have a PPPoE Connection configured, you will be asked if it may be modified.
  5. Popular options: you are asked if you want the 'noauth' and 'defaultroute' options and to remove 'nodetach' - choose "Yes".
  6. Use peer DNS - choose "Yes".
  7. Limited MSS problem - choose "Yes".
  8. When you are asked if you want to connect at start up, you will probably want to say yes.
  9. Finally you are asked if you want to establish the connection immediately.

Once you have finished these steps, your connection should be working.

Manual connection control

To start your ADSL connection on demand, in a terminal type:

pon dsl-provider

To stop your ADSL connection, in a terminal type:

poff dsl-provider

in most cases, you can just type "poff" to stop the ADSL connection and unload the module.

Problems

If your connection does not seem to work, try turning your previously configured ADSL connection on manually (see previous section). To see log, in terminal type:

plog

PPPoE package installation

To check if the PPPoE package is installed, in a terminal type:

dpkg -s pppoeconf

If it is installed you should see the output on the package where two lines show this:

Package: pppoeconf Status: install ok installed

If the package is not installed, insert your Ubuntu CD and in a terminal type:

sudo apt-get install pppoeconf

If the package cannot be found, you may have to add your Ubuntu CD to the list of software repositories. To add your CD, make sure it is inserted in your CD drive and in a terminal type:

sudo apt-cdrom add

If all else fails, you can download the pppoeconf package from . Of course you will need a working Internet connection, and then to transfer the package via a CDR or USB stick for example. Double click on the package in GNOME to install it.

Boot issues

If you find that you have to run pppoeconf each time you boot, you can try two things:

  • Edit /etc/network/interfaces as described , so that that 'pppoe maintained' lines are before 'auto dsl-provider':

# added by pppoeconf auto eth0 iface eth0 inet manual pre-up /sbin/ifconfig eth0 up # line maintained by pppoeconf auto dsl-provider iface dsl-provider inet ppp provider dsl-provider
  • Failing that, edit /etc/rc.local, and before the last line ("exit 0"), add:

ifconfig eth0 up pon dsl-provider

Error logs

If you are having problems with your connection, you may find valuable information in the system message logs. You may acces system logs either in a terminal, or with a graphical interface.

  • To use the grapical log viewer, in the menu bar, go to : System > Administration > System Log. You will find the system messages in /var/log/messages.

  • To use the terminal, type:

sudo dmesg




阅读(1682) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~