前言:

由于需要做网站数据的抓取,普通的固定代理会容易被封禁,所以我们就用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连线。

root@PppoeServer 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. root@PppoeServer 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
root@PppoeServer Test ~ # ifup ppp0
root@PppoeServer 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
root@PppoeServer 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来进行停止连接和状态查看。

注意

本篇全文复制粘贴,非原创——原文地址

Linux实战(11):配置PPPOE拨号的更多相关文章

  1. cisco上配置 pppoe拨号

    r1(config)#vpdnenable                      开启虚拟拨号VPDN r1(config)#vpdn-groupoffice                定义组 ...

  2. 华为AR路由器AR207-S配置pppoe拨号上网图解实例

  3. Linux之Ubuntu下DSL拨号上网

    可视化桌面配置方法 1.编辑连接 2.选择 增加 3.选择 DSL 4.选择 新建连接[cmcc@gx属于移动校园用户的ISP指定后缀] 6.OK 当然,还有其他拨号上网的办法: [Linux/Ubu ...

  4. Linux实战教学笔记11:linux定时任务

    第十一节 linux定时任务 标签(空格分隔): Linux实战教学笔记 ---更多资料点我查看 1.1 定时任务Crond介绍 Crond是linux系统中用来定期执行命令/脚本或指定程序任务的一种 ...

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

    1.修改登入密码 路由器默认登入账号为admin,密码为空,强烈建议修改登入密码保证安全: 2.修改接口名称 选择Interface,切换到Ethernet标签,找到状态是R(run)的两个端口. 给 ...

  6. Linux学习笔记(11)linux网络管理与配置之一——配置路由与默认网关,双网卡绑定(5-6)

    Linux学习笔记(11)linux网络管理与配置之一——配置路由与默认网关,双网卡绑定(5-6) 大纲目录 0.常用linux基础网络命令 1.配置主机名 2.配置网卡信息与IP地址 3.配置DNS ...

  7. Cisco PIX防火墙PPPoE拨号配置视频教学

    Cisco PIX防火墙PPPoE拨号配置视频教学   本文出自 "李晨光原创技术博客" 博客,请务必保留此出处http://chenguang.blog.51cto.com/35 ...

  8. 11 TCP/IP 基础与Linux的网络配置

    1. TCP/IP与OSI参考模型 TCP/IP是Unix/Linux世界的网络基础,在某种意义上Unix网络就是TCP/IP,而TCP/IP就是网络互联的标准.它不是一个独立的协议,而是一组协议.其 ...

  9. 在SUSE Linux Enterprise 11 SP1上用UDEV SCSI配置ASM

    1. 编辑/etc/scsi_id.config文件,如果该文件不存在,则创建该文件,添加如下行: options=–whitelisted –replace-whitespace 2. 获取需要绑定 ...

随机推荐

  1. J20航模遥控器开源项目系列教程(三)开发说明 | 想要自己改造程序,扩充功能,怎么实现?

    我们的开源宗旨:自由 协调 开放 合作 共享 拥抱开源,丰富国内开源生态,开展多人运动,欢迎加入我们哈~ 和一群志同道合的人,做自己所热爱的事! 项目开源地址:https://github.com/C ...

  2. springMVC入门(三)------springMVC的处理器映射器和处理器适配器配置

    简介 springMVC的处理器映射器和处理器适配器存在多种配置,因此在此专门做一个总结 常见处理器映射器.适配器的配置 springmvc多个映射器多个处理器可以并存 所有的映射器都实现了Handl ...

  3. centos yum 安装golang

    rpm -Uvh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm yum install golan ...

  4. Linux 将文件打包、压缩并分割成指定大小

    打包文件: tar -cvf .tar 分割文件: split -b 3G -d -a .tar .tar. //使用split命令,-b 3G 表示设置每个分割包的大小,单位还是可以k // -d ...

  5. better-scroll实现滚动

    通过better-scroll这个插件实现微信好友滚动列表 安装better-scroll npm i better-scroll 初始化better-scroll   //better-scroll ...

  6. 如何处理遇到的错误-lammps

    一.认清模型——data文件: 二.读懂in文件: 三.当遇到error时,we can do: 1.查错: (1)从out文件中,复制里边的错误信息(copy一部分,不用全部): (2)进入到lam ...

  7. MPI实现Jacobi

    一.Jacobi迭代 #include<stdio.h> #include<mpi.h> #include<stdlib.h> #define totalsize ...

  8. [SCOI2013]摩托车交易 题解

    思路分析 为了让交易额尽量大,显然我们需要尽量多地买入.对于每个城市,到达这个城市时携带的黄金受到几个条件的影响:之前卖出的黄金,之前能买入的最多的黄金,前一个城市到当前城市的路径上的最小边权.既然不 ...

  9. 总结java创建文件夹的4种方法及其优缺点-JAVA IO基础总结第三篇

    本文是Java IO总结系列篇的第3篇,前篇的访问地址如下: 总结java中创建并写文件的5种方式-JAVA IO基础总结第一篇 总结java从文件中读取数据的6种方法-JAVA IO基础总结第二篇 ...

  10. e3mall商城的归纳总结4之图片服务器以及文本编辑器

    一.图片服务器 --1.认识图片服务器 大家可能都知道在分布式架构中使用图片上传可能会导致文件存放在某一个项目,而我们的项目基本上都采用集群的方式 ,因此这样会导致图片的问题比较难以存放,在这里我们有 ...