标签:转发 service local 打开 进程 cal interval 保存 ppp
[root@localhost network-scripts]# rpm -q rp-pppoe
package rp-pppoe is not installed
-----------------
[root@localhost network-scripts]# yum list |grep pppoe
rp-pppoe.x86_64 3.10-16.el6 base
-----------------
[root@localhost network-scripts]# yum install rp-pppoe -y
-----------------
[root@localhost 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文件,
pppoe@001 * "pppoe@123" *
pppoe@002 * "pppoe@123" *
pppoe@003 * "pppoe@123" *
--------------------添加防火墙规则,做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的进程
[root@localhost 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
[root@localhost network-scripts]# service pppoe-server status
pppoe-server (pid 1573) 正在运行...
[root@localhost network-scripts]#
标签:转发 service local 打开 进程 cal interval 保存 ppp
原文地址:https://www.cnblogs.com/zfplost/p/10031632.html