OpenWRT配置IPV6

原文链接: https://juejin.im/post/5cc3e4f4518825253d0343fb

准备材料

  1. 智博通 WG3526 路由器 (MT7621A 16M ROM, 512M RAM)
  2. 中国移动光纤入户 (Prefix Delegation前缀委托模式)

刷机

OpenWRT 18.06 for ZBT WG3526

配置

/etc/config/dhcp

config dhcp 'lan'
     ...
    option dhcpv6 'server'
    option ra 'server'
复制代码

dchpv6和ra配置,保持不变,均为'server'

/etc/config/firewall

config defaults
    ...
    # Uncomment this line to disable ipv6 rules
    option disable_ipv6     1
复制代码

关闭IPV6防火墙,否则本机的一些端口无法暴露到公网

/etc/config/network

关闭global prefix

#config globals 'globals'
#   option ula_prefix 'fdca:59d7:4008::/48'
复制代码

配置pppoe(加自动ipv6)

config interface 'wan'
    option ifname 'eth0.2'
    option proto 'pppoe'
    option username '...'
    option password '...'
    option ipv6 'auto'
复制代码

关闭wan6

#config interface 'wan6'
#       option ifname 'eth0.2'
#       option proto 'dhcpv6
复制代码

显示路由表

# ip -6 route show
default from 2409:8a4c:ca02:5e2e::/64 via fe80::6aa8:28ff:fe1d:8f2a dev pppoe-wan  metric 512 
default from 2409:8a4c:ca20:3ed0::/60 via fe80::6aa8:28ff:fe1d:8f2a dev pppoe-wan  metric 512 
2409:8a4c:ca02:5e2e::/64 dev pppoe-wan  metric 256 
2409:8a4c:ca20:3ed0::/64 dev br-lan  metric 1024 
unreachable 2409:8a4c:ca20:3ed0::/60 dev lo  metric 2147483647  error -148
fe80::/64 dev eth0  metric 256 
fe80::/64 dev br-lan  metric 256 
fe80::/64 dev eth0.2  metric 256 
fe80::/10 dev pppoe-wan  metric 1 
fe80::/10 dev pppoe-wan  metric 256 
anycast 2409:8a4c:ca02:5e2e:: dev pppoe-wan  metric 0 
anycast 2409:8a4c:ca20:3ed0:: dev br-lan  metric 0 
anycast fe80:: dev eth0  metric 0 
anycast fe80:: dev br-lan  metric 0 
anycast fe80:: dev pppoe-wan  metric 0 
anycast fe80:: dev eth0.2  metric 0 
ff00::/8 dev eth0  metric 256 
ff00::/8 dev br-lan  metric 256 
ff00::/8 dev eth0.2  metric 256 
ff00::/8 dev pppoe-wan  metric 256 
复制代码

PC上的路由表

$ ip -6 rout show
::1 dev lo proto kernel metric 256 pref medium
2409:8a4c:ca20:3ed0::c00 dev enp10s0 proto kernel metric 100 pref medium
2409:8a4c:ca20:3ed0::/64 dev enp10s0 proto ra metric 100 pref medium
2409:8a4c:ca20:3ed0::/60 via fe80::7aa3:51ff:fe2d:13a dev enp10s0 proto ra metric 100 pref medium
fe80::/64 dev enp10s0 proto kernel metric 100 pref medium
default via fe80::7aa3:51ff:fe2d:13a dev enp10s0 proto ra metric 100 pref medium
复制代码

转载于:https://juejin.im/post/5cc3e4f4518825253d0343fb

你可能感兴趣的:(OpenWRT配置IPV6)