is there a possibility to add an additional route to the host table after starting a container?
I used the search of course. Similar topics are mentioned but unfortunately there are no responses.
- Docker version 20.10.12, build e91ed57
- installed wireguard as container (image: lscr.io/linuxserver/wireguard)
- wireguard container has IP 172.19.0.2
- wireguard network is 10.14.14.0
- wireguard host peer has ip 10.14.14.1
- wireguard clients peers have 10.14.14.2 3 4 and so on
- a standard route will be created to route from host network to container network ( 192.168.2.0 → 172.19.0.0)
- Setup Is Working so far, as long as all connections are built up by wireguard clients (they can connect to NAS in home network etc)
As soon as I want to use RDP, VoIP-client or other protocols where the server (e.g. rdp server) wants to establish a connection back to the client (rdp client) the setup isn’t working anymore.
EXCEPT I activate IP forwarding and set a route to 10.14.14.0 via 172.19.0.2 then also RDP and so on is working.
so far so good…
but after a reboot the route disappears / is not there of course. I am not able to set the route via netplan or so because the target isn’t available.
Is there an option or possibility with docker toolset to run a script with the routing statement as soon as the wireguard container was started? Maybe I missed something.
This would be an more elegant option then to use standard linux approaches due to it relates to an docker context.
best regards and thank you for your support