Is there a way to manually set additional prefixes in the config (my WG GUA) to send out for client SLAAC usage, as I want to route Internet traffic through this tunnel (I’d like to send out the ULA and GUA prefixes to clients).
Please connect to your OpenWRT device using ssh and copy the output of the following commands and post it here using the "Preformatted text </> " button
Remember to redact keys, passwords, MAC addresses and any public IP addresses you may have but do not redact private RFC 1918 IP addresses as that is not needed:
ubus call system board
cat /etc/config/network
cat /etc/config/dhcp
cat /etc/config/firewall
ip route show
ip -6 route show
ip route show table all
ip rule show
wg show
Routing traffic is usually be done with Policy Based Routing but for a site-to-site setup using the Allowed IPs and routing those is also a possibility
Note that WireGuard is a routed solution it needs three different subnets for "client", "server" and the WG subnet
The relevant things I have already are below but the other pieces are not yet in place (but all the other bits I have on other OpenWRT device). This is for a Travel Router.
I’m using a custom script I have already running elsewhere on OpenWRT that add marks to set and I can manipulate which routing table to use based on firewall rules I can dynamically add. This all works on WG clients coming into a OepnWRT router.
e.g.
/sbin/ip -6 route add default via fd91:38a7:1789:2::1 dev wg1 table hiddenlcl
/sbin/ip -6 rule add fwmark 0x2 lookup hiddenlcl
It's possible to add additional IPv6 prefixes (in "ip6prefix") on interfaces with static and dhcpv6 as protocol.
I guess it makes sense to add an static alias interface to the Wireguard tunnel interface, then you can add the prefix in "ip6prefix", since then the prefix will be removed if you take the tunnel down.
That did work mostly with an alias interface for the GUA address but for some reason I ended up setting a “/48” as well as the “/64” on the interface for no reason I can see i.e 2b01:1345:a68a:7::1/64 and a 2b01:1345:a68a::1/48. Despite the ip6hint on the alias set to '7’.
So just for reference by anyone else, for the path of least resistance I switched off “odhcpd”, and installed and enabled uradvd, with “/etc/config/uradvd”.
option enabled '1'
# send router advertisment over this device
# alternative: option device 'lan'
option ifname 'br-lan'
# lifetime of the default route (in seconds)
option default_lifetime '65534'
# option valid_lifetime '86400'
# option preferred_lifetime '14400'
# option max_router_adv_interval '600'
# option min_router_adv_interval '200'
list prefix_on_link ''fd91:38a7:1789:7::/64'
list prefix_on_link '2b01:1345:a68a:7::/64'
list dns 'fd91:38a7:1789:7::1'
, seems to be working fine. Let’s me set static IPv6 and set the prefixes easily.
Simply using a hotplug script to NAT the GUA if there is an ipv6 default route on the WAN side.