This is an automated archive.
The original was posted on /r/wireguard by /u/DesktopFolder on 2023-12-22 00:00:52+00:00.
Edit: Immediately fixed this, as one generally does right after giving in and posting about an issue. The issue I had [poor explanation, probably] was that my WireGuard server instance was running within a docker container, so when I had initially tried to bind SSHD to 10.13.13.1, I had been using the wrong IP (and it didn't work...) because 10.13.13.1 didn't exist, rather I needed to bind SSHD to 172.17.0.1 (docker0)... finally, SSH success!
Been trying to get SSH to my WG server working recently and have failed despite reading as many Reddit/StackOverflow posts as I could on this issue, hoping someone here can shed some light at least on a misconception or...something.
tl;dr: With WireGuard 'remote server' configured to [Interface] Address = 10.13.13.1
: ping -s 4000 10.13.13.1
while connected to WG VPN, over cellular data -> success, ssh [email protected]
-> immediate Connection refused
, ssh [email protected]
-> success (192.168.0.23 is the local IP of the server running wireguard in docker, and sshd)
TraceRoute shows that 192.168.0.23 goes through my router, then presumably back to the server, whereas 10.13.13.1 just directly goes to the server.
More details:
- Initially tested SSH over mobile data to check if I would be able to SSH into my server while on vacation, worked fine (lol)
- Later found that when not on mobile data, but rather on a remote LAN, SSH hangs indefinitely (which is suggested to be a subnet conflict by posts I've read on similar issues) - I can theoretically change my home network subnet but that feels like I'd be fixing the wrong thing, even if it technically would work, as I would still not really understand the core issue.
- I assume 10.13.13.1 isn't technically the IP of the box I'm trying to get to, but it does respond fine to
ping
s while I'm connected to the VPN, so I don't really understand why I can't also SSH
sshd
on the server logs that it is listening on 0.0.0.0
and ::
port 22
- SSH from my phone on data works with the destination address 192.168.0.23 and then with identical configuration but the virtual (?) IP of the wireguard server, 10.13.13.1, fails with connection refused (with no other configuration changes on the client or server), so I am assuming this cannot be a client configuration issue
- Router does not appear to have any particular configuration that would matter here
I also tried SSHing to the server's internal domain and its IPv6 address, just in case, neither of which worked (perhaps unsurprisingly, lol)
Unfortunately, I do not really have a good enough grasp of linux networking at a high level to really know where to go from here, as it seems to me that a lot of different internal routing issues could be at fault?
Image of my server configuration, autogenerated by a WireGuard docker image: