Score:0

How to bypass wireguard vpn except some ports

jp flag

I have some ubuntu hosts that are connected to a wireguard vpn. Each of them has a openssh server on port 22 and another service that serve in tcp on port 19999. Is there a way that all the traffic except the one from/to port 22 and 19999 bypass the vpn and goes trough their current connection? I think I have to set something with the ip route command but I don't know how it works at all and even if it is the one to use. I have already blocked the traffic in the wireguard server using iptables so the hosts at the moment just go on timeout when I like try to navigate on any website.

Let assume that a host has a vpn ip 10.13.1.1/32, local ip 192.168.1.2/24 and vpn gateway at 10.13.254.1. The local ip network could change.

Score:-1
fo flag

ip route is used to specify a route through a network or an interface , in your case you need to do a port forwarding using iptables and some nat rules

Ripper346 avatar
jp flag
Ok, can you elaborate how?
I sit in a Tesla and translated this thread with Ai:

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.