I have two peers in Wireguard -- A and B. A has a service running on 127.0.0.1:2001
. I want to connect A and B, so that B can access that service on 127.0.0.1:2001
as well. Alternatively, I want to forward 127.0.0.1
to a peer -- however, adding 127.0.0.1/32
to AllowedIPs
does not work (at least on MacOS).
Asked
Active
Viewed 1,516 times
0

StarDust
- 101
- 2
-
1You need to set up SSH tunneling for this. – Tero Kilkanen Dec 20 '21 at 07:20
-
@TeroKilkanen SSH Tunneling does not offer ranges. – StarDust Dec 20 '21 at 12:51
-
Especially since I want to port forward everything from `2001-65535`. – StarDust Dec 20 '21 at 13:13
-
I can use a SOCKS proxy, but it wouldn't be global. – StarDust Dec 20 '21 at 14:58
1 Answers
0
Get the IP of peer B within Wireguard, then on peer A you can connect in its browser just to the IP of peer B. Should work since you're connected through Wireshark.

nAZklX
- 1
- 1
-
-
What's stopping B accessing the service on the internal IP instead, e.g. `192.168.1.2:2001`? – shearn89 Dec 20 '21 at 08:51
-
@shearn89 Because it's not connected to that IP, only `127.0.0.1` on A, also, it doesn't allow me to access it on `127.0.0.1` on B. – StarDust Dec 20 '21 at 12:51
-
Would it not make sense to have peer A run the service on the wireguard interface? Then B can access it over WG? – shearn89 Dec 20 '21 at 12:53
-
Binding to the Wireguard interface is the only sensible solution, anything else to access localhost from remote hosts is a hack and quite frankly, a terrible idea. – Ginnungagap Dec 20 '21 at 18:48