好物优选点击查看详情 京东购买

暂无内容

OpenWrt搭建PPPOE Server

搭建IPv6 PPPOE Server环境

IPv4 PPPOE Server环境基础上做以下修改。

重启路由器后,按以下步骤搭建IPv6 PPPOE Server环境。

a. 修改/etc/ppp/pppoe-server-options
打开此文件vi /etc/ppp/pppoe-server-options,将配置按如下方式修改:

  require-chap login lcp-echo-interval 10 lcp-echo-failure 2 mru 1492 mtu 1492 ms-dns 8.8.8.8 ms-dns 114.114.114.114 +ipv6 ipv6 ::1,::2 

b. 拷贝插件

输入以下命令:

cp /usr/lib/pppd/2.4.8/rp-pppoe.so /etc/ppp/plugins/ 

c. 修改/etc/config/network

添加ppp0节点,然后绑定到odhcpd,用于向下级分配ipv6地址,vi /etc/config/network,最后面添加:

config interface 'ppp0' option proto 'static' option device 'ppp0' 

d. 修改/etc/config/dhcp

添加ppp0节点,然后绑定/etc/config/network中的ppp0节点,vi /etc/config/dhcp,最后面添加:

config dhcp 'ppp0' option interface 'ppp0' option start '100' option limit '150' option leasetime '12h' option force '1' option ra_management '1' option dhcpv6 'server' option ra 'server' option ra_default '1' list dns '2400:3200:baba::1' list dns '2400:3200::1' 

其中,list dns的意思是ipv6 dns server,根据实际情况填写。这里填的是阿里的DNS。

e. 重启network、dhcp、odhcpd

输入以下命令:

/etc/init.d/network restart /etc/init.d/dnsmasq restart /etc/init.d/odhcpd restart 

f. 启动PPPOE Server

输入以下命令:

killall pppoe-server pppoe-server -k -T 60 -I br-lan -N 100 -C Myp -L 10.0.0.1 -R 10.0.0.2 -S ppp0 

其中 -S ppp0 表示绑定ppp0接口。

g. 节点绑定

给ppp0添加ipv6并将ppp0绑定到/etc/config/network中的ppp0节点:

ip -6 addr add `uci get network.globals.ula_prefix | sed 's/\/48//g'`5/64 dev ppp0 ubus call network.interface.ppp0 add_device "{\"name\":\"ppp0\"}" 

此时,路由器下挂设备可以通过PPPOE拨号获取IPv6地址。

原文链接:https://blog.csdn.net/Amosstan/article/details/131568580?ops_request_misc=%257B%2522request%255Fid%2522%253A%2522171836740016800225512489%2522%252C%2522scm%2522%253A%252220140713.130102334.pc%255Fblog.%2522%257D&request_id=171836740016800225512489&biz_id=0&utm_medium=distribute.pc_search_result.none-task-blog-2~blog~first_rank_ecpm_v1~times_rank-9-131568580-null-null.nonecase&utm_term=%E8%B7%AF%E7%94%B1%E5%99%A8%E3%80%81openwrt

© 版权声明
THE END
喜欢就支持一下吧
点赞6 分享