问题原文
原帖链接 · Nathan · CC BY-SA 3.0
I created a user-defined bridge using the docker command:
docker network create --driver bridge mynetwork
This command resulted in a bridge being created, as shown by netstat -i:
Iface MTU RX-OK RX-ERR RX-DRP RX-OVR TX-OK TX-ERR TX-DRP TX-OVR Flg
br-000f1 1500 0 0 0 0 0 0 0 0 BMRU
In the same way that I previously trusted the docker0 bridge, I need to add this new bridge to my firewall trust zone:
firewall-cmd --permanent --zone=trusted --add-interface=Docker0
I don't see a way to infer or specify the bridge device name, so I'm not sure how I can add it to my trust zone in an automated way.
I would appreciate any help.
社区高分解答
原帖链接 · Ian Williams · CC BY-SA 4.0
Elaborating on Marek's Answer of setting the bridge name at creation time.
docker network create --driver bridge -o \
"com.docker.network.bridge.name"="mynetwork_name" mynetwork
or if using a docker-compose file the following in the networks section
version: '3'
.
.
.
networks:
mynetwork:
driver_opts:
com.docker.network.bridge.name: mynetwork_name
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
