diff --git a/manifests/init.pp b/manifests/init.pp index 9329427..36df784 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -48,7 +48,7 @@ table => 'nat', } - firewall { '100 handle uturn traffic for containers': + firewall { '100 handle uturn traffic for containers and localhost': chain => 'OUTPUT', jump => 'DOCKER_EXPOSE', dst_type => 'LOCAL', @@ -89,6 +89,10 @@ iniface => "! ${bridge_name}", } + sysctl::setting { "net.ipv4.conf.${bridge_name}.route_localnet": + value => '1', + } + exec { 'create docker network': command => "/usr/bin/docker network create --subnet ${bridge_subnet} -o com.docker.network.bridge.name=${bridge_name} ${bridge_name}", unless => "/usr/bin/docker network inspect ${bridge_name}",