树莓派pppoe

连接的网络是移动(铁通)的宽带,不同的宽带的dns需要修改。

1.首先安装pppoe包

apt-get install pppoe

2.然后,复制conf文件/etc/ppp/pppoe.conf:

#***********************************************************************
#
# pppoe.conf
#
# Configuration file for rp-pppoe. Edit as appropriate and install in
# /etc/ppp/pppoe.conf
#
# NOTE: This file is used by the pppoe-start, pppoe-stop, pppoe-connect and
# pppoe-status shell scripts. It is *not* used in any way by the
# "pppoe" executable.
#
# Copyright (C) 2000 Roaring Penguin Software Inc.
#
# This file may be distributed under the terms of the GNU General
# Public License.
#
# LIC: GPL
# $Id: pppoe.conf,v 1.11 2005/08/09 02:49:12 dfs Exp $
#***********************************************************************

# When you configure a variable, DO NOT leave spaces around the "=" sign.

# Ethernet card connected to DSL modem
ETH=‘eth0‘

# PPPoE user name. You may have to supply "@provider.com" Sympatico
# users in Canada do need to include "@sympatico.ca"
# Sympatico uses PAP authentication. Make sure /etc/ppp/pap-secrets
# contains the right username/password combination.
# For Magma, use [email protected]
USER=‘××××××ב

# Bring link up on demand? Default is to leave link up all the time.
# If you want the link to come up on demand, set DEMAND to a number indicating
# the idle time after which the link is brought down.
DEMAND=no
#DEMAND=300

# DNS type: SERVER=obtain from server; SPECIFY=use DNS1 and DNS2;
# NOCHANGE=do not adjust.
DNSTYPE=SPECIFY

# Obtain DNS server addresses from the peer (recent versions of pppd only)
# In old config files, this used to be called USEPEERDNS. Changed to
# PEERDNS for better Red Hat compatibility
PEERDNS=no

DNS1=61.232.206.102
DNS2=211.98.4.1

# Make the PPPoE connection your default route. Set to
# DEFAULTROUTE=no if you don‘t want this.
DEFAULTROUTE=yes

### ONLY TOUCH THE FOLLOWING SETTINGS IF YOU‘RE AN EXPERT

# How long pppoe-start waits for a new PPP interface to appear before
# concluding something went wrong. If you use 0, then pppoe-start
# exits immediately with a successful status and does not wait for the
# link to come up. Time is in seconds.
#
# WARNING WARNING WARNING:
#
# If you are using rp-pppoe on a physically-inaccessible host, set
# CONNECT_TIMEOUT to 0. This makes SURE that the machine keeps trying
# to connect forever after pppoe-start is called. Otherwise, it will
# give out after CONNECT_TIMEOUT seconds and will not attempt to
# connect again, making it impossible to reach.
CONNECT_TIMEOUT=30

# How often in seconds pppoe-start polls to check if link is up
CONNECT_POLL=2

# Specific desired AC Name
ACNAME=

# Specific desired service name
SERVICENAME=

# Character to echo at each poll. Use PING="" if you don‘t want
# anything echoed
PING="."

# File where the pppoe-connect script writes its process-ID.
# Three files are actually used:
# $PIDFILE contains PID of pppoe-connect script
# $PIDFILE.pppoe contains PID of pppoe process
# $PIDFILE.pppd contains PID of pppd process
CF_BASE=`basename $CONFIG`
PIDFILE="/var/run/$CF_BASE-pppoe.pid"

# Do you want to use synchronous PPP? "yes" or "no". "yes" is much
# easier on CPU usage, but may not work for you. It is safer to use
# "no", but you may want to experiment with "yes". "yes" is generally
# safe on Linux machines with the n_hdlc line discipline; unsafe on others.
SYNCHRONOUS=no

# Do you want to clamp the MSS? Here‘s how to decide:
# - If you have only a SINGLE computer connected to the DSL modem, choose
# "no".
# - If you have a computer acting as a gateway for a LAN, choose "1412".
# The setting of 1412 is safe for either setup, but uses slightly more
# CPU power.
CLAMPMSS=1412
#CLAMPMSS=no

# LCP echo interval and failure count.
LCP_INTERVAL=20
LCP_FAILURE=3

# PPPOE_TIMEOUT should be about 4*LCP_INTERVAL
PPPOE_TIMEOUT=80

# Firewalling: One of NONE, STANDALONE or MASQUERADE
FIREWALL=NONE

# Linux kernel-mode plugin for pppd. If you want to try the kernel-mode
# plugin, use LINUX_PLUGIN=/etc/ppp/plugins/rp-pppoe.so
LINUX_PLUGIN=

# Any extra arguments to pass to pppoe. Normally, use a blank string
# like this:
PPPOE_EXTRA=""

# Rumour has it that "Citizen‘s Communications" with a 3Com
# HomeConnect DSL Modem DualLink requires these extra options:
# PPPOE_EXTRA="-f 3c12:3c13 -S ISP"

# Any extra arguments to pass to pppd. Normally, use a blank string
# like this:
PPPD_EXTRA=""

########## DON‘T CHANGE BELOW UNLESS YOU KNOW WHAT YOU ARE DOING
# If you wish to COMPLETELY overrride the pppd invocation:
# Example:
# OVERRIDE_PPPD_COMMAND="pppd call dsl"

# If you want pppoe-connect to exit when connection drops:
# RETRY_ON_FAILURE=no

3.接着配置pppoe

[email protected]:/mnt/pi_boot/home# 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 username): 用户名

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):

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: server

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): 2

** Summary of what you entered **

Ethernet Interface: eth0
User name:          用户名
Activate-on-demand: No
DNS addresses:      Supplied by ISP‘s server
Firewalling:        MASQUERADE

>>> Accept these settings and adjust configuration files (y/n)? y
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.

4.开启pppoe

pppoe-start

end

时间: 2024-11-05 17:19:56

树莓派pppoe的相关文章

树莓派实现PPPOE拨号上网

我们知道,如果树莓派安装了官方Raspbian系统,默认是将有线网口设置为DHCP模式的,也就是可以自动获取IP,如果通过网线直接连接家里的无线路由器,树莓派就可以正常上网了.但是,如果你的家中没有路由器,只有有线宽带,而且是通过运营商提供的账号和密码上网的,那你的这种上网方式就属于PPPOE拨号上网.此时如果想要树莓派通过这根网线上网,树莓派就需要做一些必要的配置.按照以下的步骤进行操作,你就可以让你的树莓派轻松实现PPPOE拨号上网. 1. 安装pppoe.pppoeconf和pppstat

树莓派进阶之路 (028) - 树莓派SQLite3的安装

MySQL占用内存太大,而SQLite是一款轻量级零配置数据库,非常适合在树莓派和其他嵌入式系统中使用.SQLite文档详细资料丰富,本文不会详细解释SQLite数据库操作的方方面面,只能结合具体场景按需说明.本文介绍的SQLite技巧也可以在其他平台使用,并不局限于树莓派. 安装 SQLite 1 sudo apt-get update 2 sudo apt-get install sqlite sqlite3 3 #如果需要的话还可以顺便安装 PHP 相关组件 4 sudo apt-get

树莓派研发笔记 一

树莓派组装及操作系统安装 一.树莓派原件 1.Raspberry Pi 2 Model B 开发板 2.SD卡(本次实验项目选用内存为8G的SD卡) 3.网线一根 4.HDMI连接线1根 5.液晶显示屏 6.电源 7.USB无线网卡 二.安装系统 1.SD卡格式化 用读卡器将SD卡与PC相连,在WINDOWS环境下使用SDFormatter,将SD卡格式化. 2.下载系统压缩包 去树莓派官网下载,地址为http://www.raspberrypi.org/downloads,下载NOOBS_v1

(16)给树莓派B+ 安装一个实时时钟芯片DS1302

在这里首先感谢glgoo在google被墙的情况下提供搜索功能,还要感谢 http://wiringpi.com/ 以及github,尽管自己眼瞎,几经波折还是发现了尘封已久的少林"七十二绝技",没错,每种绝技都能克制一个树莓派GPIO控制外设的问题,七十二绝技的核心就是wiringpi这个为Pi GPIO写的C语言库了,而每种绝技则暗藏在wiringPi/examples/目录下,这里就不一一罗列了,大家想学什么招式,就去看每个example,都非常简短. 其实早在第9篇文章&quo

Mac OSX下给树莓派安装Raspbian系统

Mac OS X下给树莓派安装Raspbian系统 先到树莓派的官方网站去下载一个系统镜像,推荐下载Raspbian. 如果用了直接扩展的WaveShare的TFT小屏,到http://www.waveshare.net/wiki/RPI_IMAGE 去下载. 下载完成后得到一个img镜像: [[email protected]: pi]$ls -lh total 3788800 -rw-r--r--  1 zhangshenjia  staff   1.8G  2  9 03:44 2013-

Deruio制作 树莓派用户手册V001

目录 1 准备工作...5 1.1 下载Raspbian系统...5 1.2 Linux系统下安装Raspbian系统...6 1.3 Windows系统下安装Raspbian系统...7 1.4 配置树莓派系统...8 1.5 安装samba.9 1.6 使用ssh工具登录树莓派...11 2 树莓派GPIO的学习...15 2.1 GPIO类库...15 2.1.1Python GPIO类库...15 2.1.2wiringPi类库...16 2.1.3BCM2835 C Library库.

OpenWrt PPPoE拨号问题之mac地址克隆

[转载请注明出处:钱国正的专栏http://blog.csdn.net/qianguozheng/article/details/38322705] 在实施任何大型项目中,我们会遇到各种各样的问题,当然了,如果做足了充分的测试,我们会便利很多. 前言 Mac地址克隆主要是解决运营商绑定mac地址的行为,这种行为就给哥添麻烦. 好了,话题转回,我如何实现这个Mac地址克隆的. OpenWrt中的LAN口以实现Mac地址克隆,所以其相关的设置Mac地址克隆的东西也已经存在了,我们需要做的就是搬到PP

树莓派系统安装及配置

入手树莓派将近一个月了,很折腾,许多资源不好找,也很乱.简单整理一下自己用到的东西,方便以后自己或别人继续折腾. 0. 操作系统下载 树莓派官方 Raspbian 系统下载:http://www.raspberrypi.org/downloads 或直接下载 http://downloads.raspberrypi.org/raspbian_latest.torrent 最新版的 BT 种子. 还有一个选择是由国人制作的超级精简版,更低内存占用:http://pan.baidu.com/shar

pppoe中继代理

PPPoE中继代理--pppoe-relaypppoe-relay [参数]实例1:中继网络接口eth0上的PPPoE客户端与网络接口eth1上的PPPoE服务器间的帧.[[email protected] ~]# pppoe-relay –C eth0 –S eth1其中"-C eth0"表示eth0网络的客户端,而"-S eth1"表示eth1网络的服务端.实例2:实现透明中继.中继任何组合的客户端和服务器之间的网络eth0和eth1.[[email prote