Centos6.5 pppoe-server

Posted zfplost

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Centos6.5 pppoe-server相关的知识,希望对你有一定的参考价值。

[[email protected] network-scripts]# rpm -q rp-pppoe
package rp-pppoe is not installed

-----------------

[[email protected] network-scripts]# yum list |grep pppoe
rp-pppoe.x86_64                    3.10-16.el6                 base

-----------------

[[email protected] network-scripts]# yum install rp-pppoe -y

-----------------

[[email protected] network-scripts]# rpm -q rp-pppoe
rp-pppoe-3.10-16.el6.x86_64

-----------------设置支持ip转发
vi /etc/sysctl.conf
net.ipv4.ip_forward = 1

-----------------修改服务器配置----------------
vi /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
ms-dns 8.8.8.8
ms-dns 114.114.114.114

--------------------添加用户名密码,修改/etc/ppp/chap-secrets文件,

[email protected] * "[email protected]" *

[email protected] * "[email protected]" *

[email protected] * "[email protected]" *

--------------------添加防火墙规则,做nat转换
iptables -t nat -A POSTROUTING -s 10.10.10.0/24 -j MASQUERADE           (iptables -t nat -A POSTROUTING -s 10.10.10.0/24 -o eth1 -j SNAT --to-source 192.172.1.172)
iptables -A FORWARD -p tcp --syn -s 10.10.10.0/24 -j TCPMSS --set-mss 1256

iptables-save   保存防火墙规则到配置文件/etc/sysconfig/iptables
echo 1 > /proc/sys/net/ipv4/ip_forward
sysctl -w net.ipv4.ip_forward=1

第一条是添加nat,转换来自10.10.10.0/24网段的ip        (MASQUERADE是针对连接公网的接口是自动获取地址)
或者:iptables -t nat -A POSTROUTING -s 10.10.10.0/24 -o eth1 -j SNAT --to-source 192.172.1.172
第二条是修改mtu
第四条打开转发
第五条是修改转发文件

--------------------启动pppoe-server
pppoe-server -I eth0 -L 10.10.10.1 -R 10.10.10.100-200

--------------------查看pppoe-server的进程
[[email protected] network-scripts]# ps -aux |grep pppoe-server
root       7481  0.0  0.0   4104   224 ?        S    15:31   0:00 pppoe-server -I eth0 -L 10.10.10.1 -R 10.10.10.100-200
root       7484  0.0  0.0 103260   848 pts/1    S+   15:33   0:00 grep ppp

[[email protected] network-scripts]# service pppoe-server status
pppoe-server (pid 1573) 正在运行...
[[email protected] network-scripts]#































以上是关于Centos6.5 pppoe-server的主要内容,如果未能解决你的问题,请参考以下文章

CentOS6.5添加rbd模块

CentOS6.5搭建LNMP

centOS6.5

CentOS6.5 安装Storm集群

CENTOS6.5安装ocserv

centos6.5 安装python3.5