Centos7 配置PPPOE拨号

由于需要做网站数据的抓取,普通的固定代理会容易被封禁,所以我们就用PPPOE通过动态拨号换不同的IP地址来解决该问题,下面PPPOE设置的整个方法过程:

移除NetworkManager安装rp-pppoe

第一步 搜寻pppoe可以找到pppoe相关套件,我们要使用的是rp-pppoe。

yum search pppoe

第二步 使用yum安装rp-pppoe。

yum install rp-pppoe -y

第三步 移除NetworkManaget。

yum erase NetworkManager

第四步 开始配置PPPoE连线。

[email protected] Test ~ # pppoe-setup
Welcome to the PPPoE client setup. First, I will run some checks on
your system to make sure the PPPoE client is installed properly...

LOGIN NAME #需要输入在运营商处购买的宽带账号

Enter your Login Name (default root): 680000038162

INTERFACE #选择关联网卡,默认为eth0可能由于安装多张网卡而非eth0,这个需要根据自己的实际情况而定

Enter the Ethernet interface connected to the PPPoE modem
For Solaris, this is likely to be something like /dev/hme0.
For Linux, it will be ethX, where ‘X‘ is a number.
(default eth0): em2

Do you want the link to come up on demand, or stay up continuously? #拨号类型选择,取决于自己所选套餐,默认为no
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): no

DNS #DNS的配置,如果你知道可以手动输入,如果不知道可以输入Server,让ISP自动分配

Please enter the IP address of your ISP‘s primary DNS server. 
If your ISP claims that ‘the server will provide dynamic 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: 202.106.0.20
Please enter the IP address of your ISP‘s secondary DNS server.
If you just press enter, I will assume there is only one DNS server.
Enter the secondary DNS server address here: 8.8.8.8

PASSWORD #宽带的密码

Please enter your Password:
Please re-enter your Password:

USERCTRL # 用户控制,是否允许普通用户控制账号的连接与断开

Please enter ‘yes‘ (three letters, lower-case.) if you want to allow
normal user to start or stop DSL connection (default yes): no

FIREWALLING # 防火墙配置,这里默认0就好

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

Start this connection at boot time

Do you want to start this connection at boot time? # 是否开机启动,这里选择yes
Please enter no or yes (default no):yes

** Summary of what you entered **

Ethernet Interface: em2
User name: 680000038162
Activate-on-demand: No
Primary DNS: 202.106.0.20
Secondary DNS: 8.8.8.8
Firewalling: NONE
User Control: no
Accept these settings and adjust configuration files (y/n)? # 确认上面配置无误后,保存配置到文件
Adjusting /etc/sysconfig/network-scripts/ifcfg-ppp0
Adjusting /etc/resolv.conf
(But first backing it up to /etc/resolv.conf.bak)
Adjusting /etc/ppp/chap-secrets and /etc/ppp/pap-secrets
(But first backing it up to /etc/ppp/chap-secrets.bak)
(But first backing it up to /etc/ppp/pap-secrets.bak)

Congratulations, it should be all set up! # 操作方法,启动、停止宽带的连接

Type ‘/sbin/ifup ppp0‘ to bring up your xDSL link and ‘/sbin/ifdown ppp0‘
to bring it down.
Type ‘/sbin/pppoe-status /etc/sysconfig/network-scripts/ifcfg-ppp0‘
to see the link status.

[email protected] Test ~ # ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
2: em1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP qlen 1000
link/ether f0:1f:af:d6:01:61 brd ff:ff:ff:ff:ff:ff
inet 192.168.1.252/24 brd 192.168.1.255 scope global em1
valid_lft forever preferred_lft forever
3: em2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP qlen 1000
link/ether f0:1f:af:d6:01:62 brd ff:ff:ff:ff:ff:ff
4: p2p1: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN qlen 1000
link/ether a0:36:9f:94:a4:d8 brd ff:ff:ff:ff:ff:ff
5: p2p2: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN qlen 1000
link/ether a0:36:9f:94:a4:da brd ff:ff:ff:ff:ff:ff
[email protected] Test ~ # ifup ppp0
[email protected] Test ~ # pppoe-status
pppoe-status: Link is up and running on interface ppp0
6: ppp0: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> mtu 1492 qdisc pfifo_fast state UNKNOWN qlen 3
link/ppp
inet 114.252.45.64 peer 114.252.32.1/32 scope global ppp0
valid_lft forever preferred_lft forever
[email protected] Test ~ # ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
2: em1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP qlen 1000
link/ether f0:1f:af:d6:01:61 brd ff:ff:ff:ff:ff:ff
inet 192.168.1.252/24 brd 192.168.1.255 scope global em1
valid_lft forever preferred_lft forever
3: em2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP qlen 1000
link/ether f0:1f:af:d6:01:62 brd ff:ff:ff:ff:ff:ff
4: p2p1: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN qlen 1000
link/ether a0:36:9f:94:a4:d8 brd ff:ff:ff:ff:ff:ff
5: p2p2: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN qlen 1000
link/ether a0:36:9f:94:a4:da brd ff:ff:ff:ff:ff:ff
6: ppp0: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> mtu 1492 qdisc pfifo_fast state UNKNOWN qlen 3
link/ppp
inet 114.252.45.64 peer 114.252.32.1/32 scope global ppp0
valid_lft forever preferred_lft forever

上面是整个PPPOE的连接创建过程,后续可以通过ifdown ppp0和pppoe-status来进行停止连接和状态查看。

时间: 2024-08-29 01:32:51

Centos7 配置PPPOE拨号的相关文章

cisco1941 pppoe拨号上网client端配置

近期公司新购进一台cisco  1941路由器用于网络升级,因专线未布置到位,暂时用于pppoe拨号上网,因设备有限,故Router洪当三个角色:拨号上网,DHCP服务器,DNS服务器,主要配置如下(G0/0 端口为外网端口,G0/1端口为内网端口): 拓扑很简单:Router --Switch--client PC 配置主要分为以下几个方面: 1.配置内部接口G0/1 interface GigabitEthernet0/1 ip address 192.168.0.1 255.255.255

MikroTik RouterOS安装后初始化配置(PPPOE拨号上网)

1.修改登入密码 路由器默认登入账号为admin,密码为空,强烈建议修改登入密码保证安全: 2.修改接口名称 选择Interface,切换到Ethernet标签,找到状态是R(run)的两个端口. 给网口修改名称方便识别 比如我们双击ether2端口,我们发现ether2网卡MAC地址和winbox标题栏显示的MAC地址一致,说明这是连接PC的端口,我们给它改名为lan, 那么剩下的另外一个ether1就是外网了,我们命名为wan 3.配置内网DHCP 我们在内网搭建一个DHCP Server,

openwrt刷机后配置PPPOE上网方法

参考下帖13#的方式: 如何编辑配置openwrt,来实现pppoe拨号上网? 但其中有一句代码有错误: option 'peerdns' '0',其中需将‘0’改为‘1’

OpenWrt之PPPoE拨号

什么是PPPoE拨号: PPPoE发现过程, PPP链接过程,具体的流程参考:协议分析网 参考下面示例图: OpenWRT上的架构: Luci 配置. pppd进程. OpenWrt之PPPoE拨号,布布扣,bubuko.com

破解TP-Link路由-嗅探PPPoE拨号密码

如果你平时都使用路由器直接上网,那么你还记得你的宽带(ADSL)帐户名和密码吗?忘记密码后又该如何找回呢?别急,本文带你一同找回遗忘的ADSL密码.1.安全性较差的路由器(例如腾达的某些路由器):这里所说的安全性较差的路由器,是指没有对HTTP管理页面上显示的拨号密码进行加密(只是显示为星号).对于这类情况,只需要用一些星号密码查看器查看,或者直接查看网页的源代码就可以看到密码了.2.安全性一般的路由器(例如D-Link的某些路由器):这类路由器利用星号密码查看器,或者直接查看网页源代码是看不到

archlinux pppoe拨号连接使用详解[转载]

RouterOS 2.9.27 + archlinux 200806routerOS上架设pppoe server,archlinux当pppoe client,archlinux上有一块网卡eth0 目的:archlinux pppoe拨号到pppoe server pppoe server 配置  service name  :  pppoe-service  local address  :  192.168.88.210  remote address  :  192.168.88.21

如何查看路由器中的pppoe拨号密码?

1 2 3 4 5 6 分步阅读 有时候把宽带的账号密码给忘了,进路由器的拨号页面看了一下,账号能看到,就密码是以"*"号形式显示的,没法用"肉眼"识别出来,怎么办呢?难道真的非得打电话问运营商不可?用不着-- 工具/原料 routerpassview路由器密码查看工具 方法/步骤 首先,登陆路由器,用路由器的"备份配置文件"功能把路由器的配置导出到电脑上,基本上所有的路由器都有这个功能的.配置里肯定包含pppoe拨号账号密码的啦,实际上wifi

PPPoE拨号流程

PPPoE(Point to Point Protocol over Ethernet,基于以太网的点对点协议)的工作流程包含发现(Discovery)和会话(Session)两个阶段,发现阶段是无状态的,目的是获得 PPPoE 终端(在局端的ADSL设备上)的以太网 MAC 地址,并建立一个惟一的 PPPoE SESSION-ID.发现阶段结束后,就进入标准的PPP会话阶段. 1.发现阶段(PPPoED:PPPoE Discovery) 1.1 PADI(PPPoE Active Discov

树莓派实现PPPOE拨号上网

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