i have a docker network in my host1 (172.16.0.0/16), and my host1 is connected also to another LAN network(192.168.1.0/24)
i want to access from an other host2 (in the same LAN with my host1) to the docker network, by setting my original host1 as a router how can i do that, knowing that i am using a Linux host.
sudo sysctl -w net.ipv4.ip_forward=1
sudo iptables -t docker0 -A POSTROUTING -o eth0 -j MASQUERADE
sudo iptables -A FORWARD -i eth0 -o docker0 -m state –state RELATED,ESTABLISHED -j ACCEPT
sudo iptables -A FORWARD -i docker0 -o eth0 -j ACCEPT