一、安装软件包
bash
yum -y install rp-pppoe
二、配置服务器
1.修改配置文件
打开/etc/ppp/pppoe-server-options文件
bash
nano /etc/ppp/pppoe-server-options
编辑为以下内容:
PPP options for the PPPoE server
LIC: GPL
require-pap
require-chap
login
lcp-echo-interval 10
lcp-echo-failure 2
logfile /var/log/pppoe.log
2.添加用户
打开/etc/ppp/chap-secrets文件
bash
nano /etc/ppp/chap-secrets
编辑为以下内容:
Secrets for authentication using CHAP
client server secret IP addresses
"pppoe" * "123456" *
客户端连接时需要输入的, 用户名:pppoe,密码:123456
3.启动pppoe 服务
bash
pppoe-server -I eth0 -L 10.10.10.1 -R 10.10.10.100-200
这条命令的作用是:-I eth0 在eth0端口上检测pppoe discover包
-L 10.10.10.1 虚拟网关的意思,就是pppoe服务器端虚拟网关ip
-R 10.10.10.100-200 分配虚拟IP,分别是10.10.10.100到10.10.10.200
还有一些其他的参数你可以参考一下,直接man pppoe-server自己看了,每个参数都有默认值
三、配置客户端
1.配置pppoe
bash
pppoe-setup
进入配置交换页面,配置过程如下图所示:


2.启动pppoe
bash
pppoe-start
3.查看pppoe
使用命令ifconfig查看ppp0网口是否存在,存在ppp0网口说明pppoe建立成功。