pppoe-server + ipv6

pppoe-server + ipv6

安装pppoe 服务

yum install rp-pppoe dibbler-server radvd -y

开启ipv6转发

echo 'net.ipv6.conf.all.forwarding = 1' >> /etc/sysctl.conf
sysctl -p

配置pppoe服务

vi /etc/ppp/pppoe.conf

ETH=eth0
USER=test
LINUX_PLUGIN=/etc/ppp/plugins/rp-pppoe.so
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
+ipv6
ipv6 ::1,::2
vi /etc/ppp/chap-secrets

test            *       123456                  *
vi /etc/ppp/options

#lock
local
#ipv6 ,

开启pppoe服务

pppoe-server -I eth0 -L 192.168.44.1 -R 192.168.44.2-20

开启ipv6支持分发地址

编辑 /etc/ppp/ipv6-up 文件。默认拨号后会调用这个文件执行。
执行dibbler-server 和 radvd 服务给用户分ipv6地址。

LOGDEVICE=$6
REALDEVICE=$1
#在上面信息的下面添加下面所有内容
kill -9 $(ps -ef | grep radvd | awk 'NR==1{print $2}')
kill -9 $(ps -ef | grep dibbler | awk 'NR==1{print $2}')
rm -f /var/lib/dibbler/*
cat > /etc/radvd.conf << EOF
interface $1
{
        AdvSendAdvert on;
        MinRtrAdvInterval 3;
        MaxRtrAdvInterval 10;
        AdvManagedFlag on;
        AdvOtherConfigFlag on;
        prefix 2019:1:2:3::/64
        {
                AdvOnLink on;
                AdvAutonomous on;
                AdvRouterAddr on;
        };
		RDNSS 2019:1:2:3::1 2019:1:2:3::2
        {
        };
};
EOF
cat > /etc/dibbler/server.conf << EOF
log-level 8
iface "$1"{
 t1 180-200
 t2 270-300
 prefered-lifetime 360
 valid-lifetime 720
 class {
   pool 2019:a:b:c::/64
 }
 pd-class {
 pd-pool 2017:1:2:3::/64
 pd-length 64
 }
 option dns-server 1999::a,1999::d
 option domain test.com
}
option fqdn 2 64
		aa.example.com - 2000::1,
		bb.example.com - 2000::1,
		test.com
EOF
#/usr/sbin/radvd
dibbler-server start
ip -6 addr add 2019:a:b:c::1.1.1.1 dev $1
ip -6 route add 2018:1:2:3/64 dev $1
ip -6 route add 2019:a:b:c/64 dev $1

你可能感兴趣的:(Linux)