Linux设置pppoe拨号上网
Linux设置pppoe拨号上网
我们现在上网好多都是通过pppoe拨号上网,在windows下我们下载一个客户端就可以很轻松的实现,现在我们用linux也想上网怎么办?我们也可以通过pppoe拨号连接到互联网
环境:
操作系统:CentOs release 6.4
需要的软件:
rp-pppoe-3.11.tar.gz
我们先安装一个pppoe客户端
[root@localhost ~]# ll |grep ppoe
-rw-r--r--. 1 root root 223234 Apr 13 19:01 rp-pppoe-3.11.tar.gz
这是一个pppoe源代码包拆包解压到 /usr/local/src目录
[root@localhost ~]# tar -zxvf rp-pppoe-3.11.tar.gz -C /usr/local/src
解压完后我们看看它的安装说明
[root@localhost ~]# cd /usr/local/src
[root@localhost src]# cd rp-pppoe-3.11/
[root@localhost src]#ll
total 48
-rw-r--r--. 1 user1 user1 1882 Aug 18 2012 README
-rw-r--r--. 1 user1 user1 561 Aug 18 2012 SERVPOET
drwxr-xr-x. 2 user1 user1 4096 Aug 18 2012 configs
drwxr-xr-x. 2 user1 user1 4096 Aug 18 2012 doc
-rwxr-xr-x. 1 user1 user1 845 Aug 18 2012 go
-rwxr-xr-x. 1 user1 user1 1941 Aug 18 2012 go-gui
drwxr-xr-x. 3 user1 user1 4096 Aug 18 2012 gui
drwxr-xr-x. 2 user1 user1 4096 Aug 18 2012 man
-rw-r--r--. 1 user1 user1 4109 Aug 18 2012 rp-pppoe.spec
drwxr-xr-x. 2 user1 user1 4096 Aug 18 2012 scripts
drwxr-xr-x. 4 user1 user1 4096 Aug 18 2012 src
我们查看一下README安装说明
[root@localhost rp-pppoe-3.11]# vim README
Compile and install pppd if you don‘t already have it. Then:
1) Unpack:
$ tar xzvf rp-pppoe-xxx.tar.gz//已完成
2) Change to source directory://已完成
$ cd src
3) Configure:
$ ./configure// ./config配置编译规则
4) Compile:
$ make
5) Install (this step must be done as root)
# make install
6) Now read doc/HOW-TO-CONNECT
--
David F. Skoll <[email protected]> | Roaring Penguin Software Inc.
http://www.roaringpenguin.com
我们按照文件里的说明执行第三、四、五步
[root@localhost rp-pppoe-3.11]# cd src
编译
[root@localhost src]# ./configure
执行make
[root@localhost src]# make
安装make install
[root@localhost src]# make install
Type ‘make install‘ as root to install the software.
mkdir -p /usr/sbin
/usr/bin/install -c -m 755 pppoe /usr/sbin
/usr/bin/install -c -m 755 pppoe-server /usr/sbin
if test -x licensed-only/pppoe-server-control ; then /usr/bin/install -c -m 755 licensed-only/pppoe-server-control /usr/sbin; fi
Type ‘pppoe-setup‘ to configure the software.
让我们通过pppoe-setup来设置
设置pppoe
[root@localhost src]# pppoe-setup
提示设置用户名默认[email protected]
这里填写运营商给你提供的账户密码
[root@localhost rp-pppoe-3.11]# pppoe-setup
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 15638892360):
输入用户名回车
提示选择网卡默认eth0
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):
选择按需连接还是永久在线默认永久在线
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):
提示让你输入你的IPS(Internet服务提供商)的主DNS 服务器地址
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:
输入密码和确认密码
PASSWORD
>>> Please enter your PPPoE password:
>>> 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):
配置完成后会显示的的配置,并询问是否保存
** Summary of what you entered **
Ethernet Interface: eth0
User name:
Activate-on-demand: No
DNS: Do not adjust
Firewalling: NONE
>>> Accept these settings and adjust configuration files (y/n)?
保存后会提示配置的保存位置,并提示下一步操作
Adjusting /etc/ppp/pppoe.conf
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.
启动pppoe
[root@CentOS rp-pppoe-3.11]# pppoe-start
pppoe-start: There already seems to be a PPPoE connection up (PID 37234)
登陆成功!
本文出自 “梦想从这里起飞” 博客,请务必保留此出处http://mao5788.blog.51cto.com/8820527/1399110
郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。