分类: LINUX
2009-10-31 15:55:12
虽然利用路由器连接到Internet非常普遍,但是经常也使用ADSL(也称作‘DSL’)调制解调器通过PPPOE来连接到Internet。
当然,你需要向(ISP)申请Internet连接业务,申请后你就可以连接并使用Internet。然后在你的ADSL调制解调器上的"DSL"信号灯会显示你连接Internet的线路处于同步状态。
你需要ISP提供给你的用户名和密码来使用你的DSL帐号,同时,需要一条合适的网线来连接以太网卡和PPPoE调制解调器。
我们使用终端来配置调制解调器。通过菜单上的应用程序>附件>终端来打开终端。
你需要安装PPPoE包来使用以下的命令。这个包是默认安装的,但是有可能在更改配置的时候丢失。如果以下的命令不能执行,你需要再安装这个包(请参考PPPoE包安装的章节)。
在终端中输入:
sudo pppoeconf
一个基于文本菜单的程序会指导你进行下面的步骤:
当你完成这些步骤,你应该建立了连接并且能够使用了。
在需要的时候启动ADSL连接,可以在终端中输入:
pon dsl-provider(若登录的用户不是root的话。则应输入“sudo pon dsl-provider”)
断开ADSL连接,可以在终端中输入:
poff dsl-provider(若登录的用户不是root的话。则应输入“sudo poff dsl-provider”)
如果你发现连接正常工作,尝试手动去调整你之前ADSL连接的配置(参考前一节)。需要查看日志,可以在终端中输入:
plog
检查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来建立连接,你可以这样做:
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
ifconfig eth0 up
pon dsl-provider
如果你发现连接出现了问题,你可以在系统日志中找到有用的信息。你可以在终端或者图像界面中访问系统日志。
sudo dmesg
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.
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:
Once you have finished these steps, your connection should be working.
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.
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
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.
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
ifconfig eth0 up pon dsl-provider
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.
sudo dmesg