Someone asked me for the configuration to make
Sonic 6rd work on a Ubiquiti EdgeRouter, and I figured I'd share it publicly.
I mostly followed the
basic instructions on this page to get it working.
You first need to use
https://alephs.org/6rdcalc.html to calculate the right values using 2602:240::/28 and your Sonic-assigned local IPv4 address. If your Sonic-assigned IPv4 address was 198.51.100.33, you'd put this in that calculator:
Provider prefix IPv6: 2602:240:: / 28
Customer IPv4: IP: 198.51.100.33 using 32 bits
And it would tell you that your "Calculated IPv6 Prefix" is "
2602:24C:6336:4210::". That's the magic thing you need.
Then run this on the EdgeRouter, but replace "
2602:24C:6336:4210::" with your calculated prefix, and replace "
198.51.100.33" with your IPv4 address:
Code: Select all
set interfaces tunnel tun0 6rd-prefix '2602:240::/28'
set interfaces tunnel tun0 address '2602:24C:6336:4210::1/28'
set interfaces tunnel tun0 encapsulation sit
set interfaces tunnel tun0 local-ip 198.51.100.33
set interfaces tunnel tun0 mtu 1472
set interfaces tunnel tun0 multicast disable
set interfaces tunnel tun0 ttl 255
set interfaces tunnel tun0 6rd-default-gw ::184.23.144.1
set interfaces switch switch0 address '2602:24C:6336:4210::1/64'
set interfaces switch switch0 ipv6 dup-addr-detect-transmits 1
set interfaces switch switch0 ipv6 router-advert cur-hop-limit 64
set interfaces switch switch0 ipv6 router-advert link-mtu 1472
set interfaces switch switch0 ipv6 router-advert managed-flag false
set interfaces switch switch0 ipv6 router-advert max-interval 300
set interfaces switch switch0 ipv6 router-advert other-config-flag false
set interfaces switch switch0 ipv6 router-advert prefix '2602:24C:6336:4210::1/64' autonomous-flag true
set interfaces switch switch0 ipv6 router-advert prefix '2602:24C:6336:4210::1/64' on-link-flag true
set interfaces switch switch0 ipv6 router-advert prefix '2602:24C:6336:4210::1/64' valid-lifetime 2592000
set interfaces switch switch0 ipv6 router-advert reachable-time 0
set interfaces switch switch0 ipv6 router-advert retrans-timer 0
set interfaces switch switch0 ipv6 router-advert send-advert true
commit
save
Note you'll need to update this if your Sonic-assigned local IPv4 address changes. Mine hasn't changed for months (yay Sonic!).
(Obligatory "I'd still prefer native IPv6.")