vpn + docker network issue/behaviour on Arch / Omarchy #3089
drupalshift
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hey folks,
there’s a common networking issue/default behaviour on Arch (and Omarchy by extension) when using VPN services alongside docker
Most vpn apps have a “bypass local network” feature but they only detect interfaces and routes based on the current gateway/subnet (like 192.x.x.x) docker runs its own networks in the
172.16.0.0/12range which most vpn clients don’t recognize as local so containers can’t reach the internet or be accessed locally while the vpn is active.I made this bash for myself and run it everytime using sudo
Would it make sense for Omarchy to include this as a default behavior, given the target audience (devs switching from mac / windows where this just works) ? or is there any scenario where this could break something ?
I don’t really know shit about networking or devops there’s a whole bunch of other stuff like Minikube, Podman, LXC, etc ... that might behave differently or have their own quirks so if someone who actually knows this stuff can take a look and point out where this might break or how to do it properly that’d be awesome
I know that omarchy uses
systemd-networkdbelow is just some of my GPT ramblings that I thought I’d drop here maybe someone more experienced with networking could take a quick look and spot any potential opportunities or extra directives worth considering :GPT Solution
I asked how to deteck docker bridge and make it persistDetecting the Docker bridge interface dynamically.
Making the routing configuration persistent across reboots or VPN reconnects.
ip -o link showlists network interfaces; we extract the first one with “docker” in its name.docker network inspect bridgequeries Docker for the subnet used by the default bridge network.Making it Persistent
There are several ways to ensure this setup survives reboots or VPN reconnects:
Systemd Service (recommended):
Create a small unit file in
/etc/systemd/system/docker-vpn-bypass.servicethat runs this script at boot or after Docker starts.NetworkManager Dispatcher Script:
Place it under
/etc/NetworkManager/dispatcher.d/so it runs automatically when a VPN connection comes up.VPN Hook Scripts:
Some VPN clients (like OpenVPN and WireGuard) support
uporPostUpdirectives, where you can directly add these route and rule commands.Each approach ensures Docker’s network remains accessible regardless of VPN configuration changes.
End Of GPT
Beta Was this translation helpful? Give feedback.
All reactions