Fix Applications(docker) default route with external interfaces

manami

Cadet
Joined
Apr 22, 2022
Messages
3
Same issue
It is a common sense a docker need dedicated ip when user adds a new interface with external(bridge) ip, but gui don't allow user to configure default route.
It should work when set destination to 0.0.0.0/0(that should overwirte default route).
defaultRoute.png

Why? Because some docker apps don't work well with current default route.
Example:
when launch [linuxserver/qbittorrent] docker with external interface(like bridge) in truenas scale,Listening Port will not reached from public ip:port even upnp worked,correct bind and nic settings in qBittorrent Advanced.
We need modify route manually before official fix it.
A.Container Entrypoint should be able to fix this issue just in GUI but when I added correct CMD and args docker will hung in Deploying(I can't find any official example)
Entrypoint.png

B.Add a startup script to docker. I don't know whether other docker images include this feature.
go inside and run cmd route to check container route
shellgetroute.png

0.stop your docker
1.go to host config path(/path/to/appdata/config:/config) with root user, you will get this folder[custom-cont-init.d custom-services.d qBittorrent].
2.create a xxx.sh(xxx is a name you like) file in [custom-cont-init.d] with root user(in this image xxx.sh will be execed only if xxx.sh is own by root), content like
Code:
#!/bin/sh
echo "******** Fixing default route ********"
ip route del default
ip route add default via 192.168.2.1 dev net1

fixroute.sh.png

3.edit your docker, add a capability in Configure Capabilities, value is NET_ADMIN
NET_ADMIN.png

4.start your docker,qbittorrent will work well like original docker birdge
qbw.png
.:grin:
 

manami

Cadet
Joined
Apr 22, 2022
Messages
3

murzik

Dabbler
Joined
Jun 25, 2017
Messages
39
That is true, I would not be using it if setting default route would work properly from GUI. Hopefully issue that will be fixed .
 
Top