-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enable split script to use Magic SD-WAN #194
Comments
I tried a few different ways (outputs below are from nexthop from Site B). 10.0.1.0/24 is Site A, 10.0.10.0/24 is B. Magic S2S uses 192.168.X.0 as gateway. wgsts1000 is the interface name for wg Magic S2S. Seems like something needs to be done on perhaps remote site B firewall, but I'm hitting a wall here. @peacey Any help will be much appreciated! Pinging a remote client on B With and without masquerade works- tcpdump -ni any host 10.0.10.64
Without masquerade, pinging an internet IP seems to go through the 192.168.X.X subnet and seems to be dropped. (Pinged 4.2.2.2 from Site A) tcpdump -ni any host 4.2.2.2
With Masquerade Doesn't work, it seems like packets keep getting reflected multiple times? (Pinged 4.2.2.2 from Site A) tcpdump -ni any host 4.2.2.2
|
Hi @sidprax, It's difficult for me to debug with because I don't have two UDMs to try the magic site-to-site on. From the results you show, it's odd that when pinging an external IP (4.2.2.2) with or without masquerate, the request on Site B are being re-routed back through the wireguard tunnel instead of the WAN tunnel.
It says In IP then Out IP out of the same wgsts1000 tunnel... that shouldn't be the case. It should say Out IP out of the WAN tunnel for it to work. So I'm suspecting some weird rules that Unifi has for this tunnel that forces all traffic out of it to go back through it, perhaps...? Or maybe you're using an incorrect gateway. First of all, you said you are using 192.168.X.0 as the gateway in the VPN script? .0 isn't a usable IP though, it's the broadcast address and isn't assigned to any host. Did you mean 192.168.X.1 or something like that? And how did you figure out this gateway? Also, how are you adding a wireguard magic S2S? When I go to S2S options in Unifi, I only see OpenVPN or IPSec options. |
Thanks for replying! See below for some outputs from Site A which may be helpful. Let me know if you want to see some outputs from Site B instead. I see 192.168.X.0 here:
and here:
Wireguard has 0.0.0.0/0 but when using your script, I disabled blackhole.
The Magic S2S is a new option from firmware 3.1.X when you own multiple unifi OS devices. You can choose the option in unifi dashboard. |
Unifi changes the X in 192.168.X.0 when it reconnects, so don't mind that changing from 5 to 0 in last reply. |
I too am having issues while attempting to setup a new remote UDM Pro for my inlaws. I do not know if this makes a difference but using the only S2S IPSec method I would see the following:
But when running the same command when using the new Magic method I see the following:
If I configure vpn.conf to use 192.168.10.1 (Site A) as I am used to with the old S2S IPSec VPN:
If I use 192.168.1.1 everything starts fine but nothing is routed to the internet. |
I think the wireguard implementation is actually great because I'm pretty sure there's some wizardry happening in the back end for CG-NAT. I never got openvpn or IPSec S2S to work for me in the past. The wireguard implementation is working pretty well for connecting to clients on Site B, but I think some rules (either by unifi's design or omission) are blocking external bound traffic. We need a networking wizard to help here 😃 @peacey whenever you have some time! |
@sidprax I did not have time to further investigate and went back to the old IPSec S2S solution. Hopefully this can be resolved because the Magic method makes connecting UDM Pros incredibly easy. |
This is weird, I'm not sure why my ip route shows a via .0 (broadcast address) while yours @jeffdoo shows via .1 😑
|
Magic Sites feels like a much better site-to-site VPN implementation to alternatives as it supports all the scenarios that plague traditional site-to-site VPN setup in Unifi, such as when you failover to your secondary WAN connection, or dynamic IP addresses / FQDN support, etc. But, figuring out how to route traffic over the magic site VPN remains a mystery to me -- if we could get split-vpn to work with magic sites it would be awesome! Running ip route show, I see similar output to @sidprax (my remote network reached via the VPN is 192.168.2.0/24):
The 192.168.1.0 is not a routable address, as @peacey noted, but it's what appears here. Note if you just run
I have noticed that even though the address shown is 192.168.1.0 (not routable), going to 192.168.1.1. brings up the UDM Pro (even though my local network is 192.168.0.1. In vpn.conf, I have experimented getting split-vpn to work with the following settings, to no avail:
By saying "reaching the FORCED destinations does not work", what I mean is, consider this example, whatismyip.com is forced using IP sets, its IP address is 172.67.189.152. I attempt to ping it from my local network host (192.168.0.84) while running tcpdumnp on the local UDM Pro. Behavior when split-vpn is DOWN / turned off (normal, expected behavior, going out over the WAN interface):
Behavior when split-vpn is UP / turned on, with
Sorry I am not much of a networking whiz, but would love to get split-vpn working with the magic site stuff as it is so far superior to any other UDM solution for site-to-site VPN. Feedback / suggestions welcome. |
Looks like this thread is stale. I'm curious if anyone has made any progress here. @peacey - given that the new low-cost express devices support Site Magic, I bet that those of us here who would love to have magic site would sponsor the purchase of one for you so that you can test/implement (if possible) support for magic site ... anyone else game for this? |
I would also be down to chip in if this would help dev work on this. I've tried all combinations as some of previously mentioned to no avail as well. 10.0.1.0/24 via 192.168.1.1 dev wgsts1000 proto ospf metric 20 onlink I do have a routeable address, 192.168.1.1, am able to bring the tunnel up without error, but no dice on the actual connection |
Is there a way to use existing options (wireguard). I cannot get internet traffic to go through the Magic S2S tunnel (both side subnets can talk to each other), but I'd like to access internet on site 1 through the WAN on site 2.
The text was updated successfully, but these errors were encountered: