Score:0

SSH connection is broken down when wireguard is connected

in flag

I am going to connect to the vps by ssh and connect to the wireguard vpn service on it.

But as soon as I execute the wireguard client, ssh connection is broken down.

Of course I know this is because routing rules are changed, and fixed those issues in case of OpenVPN, but it doesn't work at the moment.

What is different in wireguard?

This is the client config file.

# TorGuard WireGuard Config
[Interface]
PrivateKey = uEHhYaGQy9eV5NP++IDlf/ffWrF8siKE0q79PYXHfWY=
ListenPort = 51820
DNS = 1.1.1.1
Address = 10.10.7.15/24

[Peer]
PublicKey = dHeUCCVg8iBJWTOGOY3KpqlSQhvK6+rug9p44hHUbS0=
AllowedIPs = 0.0.0.0/0
Endpoint = 46.107.90.26:1443
PersistentKeepalive = 25

Thanks in advance.

Bravo avatar
us flag
if you use `AllowedIPS = 0.0.0.0/1, 128.0.0.0/1` does that fix your issue?
DevShine avatar
in flag
They are essentially the same, aren't they?
DevShine avatar
in flag
yeah, that would be good solution also, but is there any other one without modifing conf?
A.B avatar
cl flag
A.B
Probably add a routing exception for the IP addresses (source and/or dest) used by ssh. As details are not provided in the question, can't guess more. You could provide the results of `ip -br link; ip -br address; ip route; ip rule` and any additional table if any to get an idea. Once before and once after having WireGuard up (eg: through an `at` command).
Michael Hampton avatar
cz flag
Use a different device, which is not using wireguard, to ssh in and make changes.
Score:0
bn flag

Just add a PostUp/Down step to always route traffic to your IP through the main interface and not though the wireguard's interface.

PostUp   = ip route add <your public ip>/32 dev eth0
PostDown = ip route del <your public ip>/32 dev eth0
Score:0
ng flag

Perhaps you can do this

route add -host <Your-Public-IP> gw <SSH-Server-Gateway-IP>

This way at least, your PC can stay connected

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.