Force host internet traffic through an lxc
I have an lxc running a VPN, and where the host needs to access the internet (e.g. doing updates) I want to force that through the lxc VPN.
I dont want to interfere with local lan or cluster traffic - so just setting a default route isn't appropriate. Likewise I'm not sure just installing the VPN on the host is the right idea.
I'm pretty sure there is a way of doing it... its just not coming to me 😅
4 replies
i dont know what you know and dont know but at at a high-level. i needed sbanzbd to go through a vpn. so i installed sbanzbd on the same docker vm lxc as gluetun. if a different container needed access to gluetun i woild have to use its builtin proxy
It sounds like you do want to set the default route to the LXC’s address. Then set individual routes for the local LAN and cluster traffic. The routing table will prefer the more specific route (e.g., if you’re trying to get to 192.168.0.14, it will prefer the route you set for 192.168.0.0/24 instead of the default, which is equivalent to 0.0.0.0/0).
Don't
I don't see a usecase
Just because you don’t, doesn’t mean there isn’t one.