Recently i found this for give to docker a personal ipip addr del 10.1.1.133/24 dev eth0ip link add link eth0 dev eth0m type macvlan mode bridgeip link set eth0m upip addr add 10.1.1.133/24 dev eth0mroute add default gw 10.1.1.1On container i didCID=$(docker run -d ...)pipework eth0 $CID 10.1.1.133/24@10.1.1.1This works fine if host and docker containers all are on same subnet(10.1.1.0/24 in this case)But if i want to use a different subnet for dockers?For example 10.2.2.0/24?I have tried a iptables masquerade,but nothing works,the docker container cannot ping or reach external network(internet).iptables -t nat -A POSTROUTING -m iprange --src-range 10.2.2.2-10.2.2.255 -o eth0 -j MASQUERADEOf course ip forwarding is enabled
Docker: personal ip but another network
iptables;docker