Hi,
I would like to route all traffic for a particular service on my server through a wireguard VPN, without changing the routing for other traffic. (How) can I achieve this?
I have tried looking into parameters for
It sounds like what I want can be achieved using jails, but I have been avoiding them because they seem quite resource intensive and I do not have much storage space on my VPS. I only tried those new service jails and played around with
This seems related to this question, which has had no answer for 3 years.
Alternatively, what may also work for my case is to route all traffic through the VPN that has a particular domain as its destination, but from what I understand routing takes place on lower network layers so for that I'd have to constantly query the IP the domain resolves to and update the routing based on that. This sounds a bit complicated to implement, and in general I'd prefer to route only the traffic of that particular service.
I would like to route all traffic for a particular service on my server through a wireguard VPN, without changing the routing for other traffic. (How) can I achieve this?
I have tried looking into parameters for
wg-quick and route more generally, but from what I understand their purpose is to route based on the destination of the traffic, which seems to be a different task.It sounds like what I want can be achieved using jails, but I have been avoiding them because they seem quite resource intensive and I do not have much storage space on my VPS. I only tried those new service jails and played around with
_svcj_ipaddrs= to assign an ip address to the service or somehow force the service to communicate only via the wireguard interface, possibly using pf, but I haven't understood those tools well enough to know if this even is the right approach.This seems related to this question, which has had no answer for 3 years.
Alternatively, what may also work for my case is to route all traffic through the VPN that has a particular domain as its destination, but from what I understand routing takes place on lower network layers so for that I'd have to constantly query the IP the domain resolves to and update the routing based on that. This sounds a bit complicated to implement, and in general I'd prefer to route only the traffic of that particular service.