0

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).

StarDust
  • 101
  • 1

1 Answers1

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
  • Yes, but I want to access it on my localhost. – StarDust Dec 20 '21 at 04:23
  • 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