连接的网络是移动(铁通)的宽带,不同的宽带的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 xxyyzz@magma.ca
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

2.2.网通的配置如下:

DNS1=221.12.1.227

DNS2=221.12.33.227

2.3移动配置如下:

211.138.13.66 移动

211.143.60.56 移动

61.232.206.102 铁通

211.98.4.1 铁通

3.接着配置pppoe

root@raspberrypi:/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

树莓派pppoe的更多相关文章

  1. pppoe应用概述

    PPPOE简述 PPP主要是用来通过拨号或专线方式在两个网络节点之间建立连接.发送数据.PPP是一种分层协议,物理层用来进行实际的点到点连接.由链路控制层(LCP)发起对链路的建立.配置和测试.在LC ...

  2. 树莓派3B安装OpenWrt打造超级路由器

    网上有很多树莓派安装OpenWrt的教程,我这里写一下个人安装体验以及踩过的坑

  3. 详解树莓派Model B+控制蜂鸣器演奏乐曲

    步进电机以及无源蜂鸣器这些都需要脉冲信号才能够驱动,这里将用GPIO的PWM接口驱动无源蜂鸣器弹奏乐曲,本文基于树莓派Mode B+,其他版本树莓派实现时需参照相关资料进行修改! 1 预备知识 1.1 ...

  4. Linux主机上使用交叉编译移植u-boot到树莓派

    0环境 Linux主机OS:Ubuntu14.04 64位,运行在wmware workstation 10虚拟机 树莓派版本:raspberry pi 2 B型. 树莓派OS: Debian Jes ...

  5. 树莓派 基于Web的温度计

    前言:家里的树莓派吃灰很久,于是拿出来做个室内温度展示也不错. 板子是model b型. 使用Python开发,web框架是flask,温度传感器是ds18b20 1 硬件连接 ds18b20的vcc ...

  6. Raspberry Pi(树莓派)上安装Raspbian(无路由器,无显示器)

    一. 准备工作 1. 树莓派主板 型号:树莓派3 B型 处理器:四核64位ARM Cortex-A53 CPU 内核架构:ARMv8 2. 一张大于8G的TF卡(本人用的是32G的,也作为PiLFS用 ...

  7. 树莓派3B的食用方法-1(装系统 网线ssh连接)

    首先要有一个树莓派3B , 在某宝买就行, 这东西基本上找到假货都难,另外国产和英国也没什么差别,差不多哪个便宜买哪个就行. 不要买店家的套餐,一个是配的东西有些不需要,有的质量也不好. 提示:除了G ...

  8. 在树莓派Raspbian下安装支持Hard Float的.NET环境

    [题外话] 最近入了个树莓派玩,系统装的官方推荐的Hard Float的Raspbian,由于衍生自Debian,所以Mono什么的非常好装.但是官方源中的Mono在Hard Float的Raspbi ...

  9. raspberrypi(树莓派)上安装mono和jexus,运行asp.net程序

    参考网址: http://www.linuxdot.net/ http://www.cnblogs.com/mayswind/p/3279380.html http://www.raspberrypi ...

随机推荐

  1. android学习第一篇 基本概念

    一.   1.  Android 四大組件 Activity , Service  , BroadcastReceiver ,ContentProvider 2.  多個Activity組成棧,當前A ...

  2. Java笔记:修饰符

    Synchronized 修饰符 Synchronized 关键字声明的方法同一时间只能被一个线程访问.Synchronized 修饰符可以应用于四个访问修饰符. 实例 public synchron ...

  3. 基因匹配(bzoj 1264)

    Description 基因匹配(match) 卡卡昨天晚上做梦梦见他和可可来到了另外一个星球,这个星球上生物的DNA序列由无数种碱基排列而成(地球上只有4种),而更奇怪的是,组成DNA序列的每一种碱 ...

  4. Oracl中sql书写技巧

    1.写脚本(1)为什么不直接设置回滚点?因为服务器上数据库是很多人使用的,所以除了自己操作外,有很多人操作.如果设置回滚点时,回滚后,很多人操作都消失了,因此savepoint不可以.但是可以自己书写 ...

  5. hadoop2.6.4 搭建伪分布式

    安装jdk1.7 http://www.cnblogs.com/zhangXingSheng/p/6228432.html  ------------------------------------- ...

  6. JQuery UI dialog 弹窗实例及参数说明

    按钮代码: <a id="suprise" style="margin-left: 0.5em;cursor:pointer;">点我会有惊喜< ...

  7. addEventListener详解

    为什么需要addEventListener? 先来看一个片段: html代码 <div id="box">追梦子</div> 用on的代码 window.o ...

  8. div不换行_div同行_div强制不换行

    使用Float <!--已知两个div的宽度使用[Float]使两个DIV同行!注:float使用后需要清除:所以多写一个div--> <div style="width: ...

  9. 如何用 SQL Tuning Advisor (STA) 优化SQL语句

    在Oracle10g之前,优化SQL是个比较费力的技术活,不停的分析执行计划,加hint,分析统计信息等等.在10g中,Oracle推出了自己的SQL优化辅助工具: SQL优化器(SQL Tuning ...

  10. CozyRSS开发记录10-RSS源管理

    CozyRSS开发记录10-RSS源管理 1.RSS源树结构 做解析体力活很多,把RSS解析的优化先放放,先玩一玩RSS源的管理. 虽然在初步的设计中,RSS源是以一个列表的方式来展示,但是,我觉得如 ...