Changes

From SME Server
Jump to navigationJump to search
405 bytes added ,  17:41, 15 November 2021
no edit summary
Line 463: Line 463:  
  docker network inspect -f '{{range .IPAM.Config}}{{.Subnet}}{{end}}' bridge
 
  docker network inspect -f '{{range .IPAM.Config}}{{.Subnet}}{{end}}' bridge
 
  172.17.0.0/16
 
  172.17.0.0/16
 +
 +
So one way is to add it to the daemon.json file (see above)
 +
 +
{
 +
"iptables": false
 +
}
 +
 +
And note:
 +
 +
Restart the Docker daemon and voila: your containers will not be exposed to every possible interface but you will need to explicitly manipulate your iptables rules if you want the traffic to pass through, e.g.: this is needed to NAT your containers:
 +
 +
 +
-A POSTROUTING -s 172.17.0.0/24 -o eth0 -j MASQUERADE
 +
    
===Docker Compose===
 
===Docker Compose===
Line 536: Line 550:  
  [Install]
 
  [Install]
 
  WantedBy=multi-user.target
 
  WantedBy=multi-user.target
  −
      
   
 
   

Navigation menu