问题描述
在泊坞窗1.10中使用新的网络功能,可以创建隔离的重叠网络 - 这样做效果非常好。两个不同网络中的容器无法相互通信。然而,是否可以否认覆盖网络中的容器到达公共互联网?例如,将平台主机连接到互联网时,Ping 8.8.8.8失败。如果添加<$ c $在使用 docker network create
命令创建网络时,c> - 内部标志,则该网络将不具有出站网络访问权限:
docker network create --internal --subnet 10.1.1.0/24 mynetwork
我假设 - 但没有测试 - 这适用于覆盖网络以及主机 - 本地网络。
With new network feature in docker 1.10 it is possible to create isolated overlay networks - which works very well. Containers in 2 separate networks can not talk to each other. Is it possible, however, to deny container in overlay network to reach public internet? Eg to make ping 8.8.8.8 fail, while having docker host connected to internet.
If you add the --internal
flag when creating a network with the docker network create
command, then that network will not have outbound network access:
docker network create --internal --subnet 10.1.1.0/24 mynetwork
I assume -- but have not tested -- that this works for overlay networks as well as for host-local networks.
这篇关于是否可以在外部互联网上将用户定义的覆盖网络中的docker容器隔离开来?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!