Openwrt PPPOE拨号ipv6上网
root@OpenWrt:~# cat /etc/config/network
config interface 'loopback'
option ifname 'lo'
option proto 'static'
option ipaddr '127.0.0.1'
option netmask '255.0.0.0'
config globals 'globals'
config interface 'lan'
option type 'bridge'
option ifname 'eth0.1'
option proto 'static'
option netmask '255.255.255.0'
option ipaddr '192.168.0.1'
option delegate '0'
option ip6assign '64'
config interface 'wan'
option ifname 'eth1'
option proto 'pppoe'
option username '0378xxxxxx'
option password 'xxxxxx'
option ipv6 'auto'
option delegate '0'
config interface 'wan6'
option ifname '@wan'
option proto 'dhcpv6'
root@OpenWrt:~# cat /etc/firewall.user
# This file is interpreted as shell script.
# Put your custom iptables rules here, they will
# be executed with each firewall (re-)start.
# Internal uci firewall chains are flushed and recreated on reload, so
# put custom rules into the root chains e.g. INPUT or FORWARD or into the
# special user chains, e.g. input_wan_rule or postrouting_lan_rule.
iptables -t nat -A PREROUTING -p udp --dport 53 -j REDIRECT --to-ports 53
iptables -t nat -A PREROUTING -p tcp --dport 53 -j REDIRECT --to-ports 53
ip6tables -F
ip6tables -X
ip6tables -P INPUT ACCEPT
ip6tables -P FORWARD ACCEPT
ip6tables -P OUTPUT ACCEPT
root@OpenWrt:~# cat user.sh
#!/bin/sh
sleep 60
destination_ip=2408:8888::8
if ping6 -c1 $destination_ip &>/dev/null
then
echo "$destinaion_ip is online."
else
/etc/init.d/firewall restart
fi
root@OpenWrt:~# cat /etc/rc.local
# Put your custom commands here that should be executed once
# the system init finished. By default this file does nothing.
/root/user.sh &
exit 0
最后由qwertyuildy修改于2022-11-25 19:39
此处评论已关闭