Creating Docker network bridge to route outgoing traffic via specific interface

Solution 1:

I fixed it by adding new ip rule on main host that route traffic to the container subnet into the main table.

ip rule add to 172.18.0.0/16 lookup main priority 10