docker 网络管理

1 网络通信

容器与容器的交互

  docker0  网桥, 相当于交换机, 不同容器的数据通信通过它交换, 

     vetchx     一段固定容器的虚拟网卡, 一段固定在docker0. 每个容器有一个

[root@izwz97j0sus9exlvpgweqpz ~]# ifconfig
docker0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 172.17.0.1  netmask 255.255.0.0  broadcast 0.0.0.0
        ether 02:42:fd:b5:e3:6b  txqueuelen 0  (Ethernet)
        RX packets 28766  bytes 14584874 (13.9 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 28408  bytes 6915699 (6.5 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.1.250  netmask 255.255.255.0  broadcast 192.168.1.255
        ether 00:16:3e:04:a1:55  txqueuelen 1000  (Ethernet)
        RX packets 17713096  bytes 3710239255 (3.4 GiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 15783439  bytes 5332758803 (4.9 GiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536

vetha91557d: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        ether 7e:8d:64:f7:24:6a  txqueuelen 0  (Ethernet)
        RX packets 782  bytes 116368 (113.6 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 1029  bytes 153360 (149.7 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

vethee6ce6c: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        ether fa:fe:74:84:92:fe  txqueuelen 0  (Ethernet)
        RX packets 1025  bytes 110190 (107.6 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 1308  bytes 98128 (95.8 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

   容器网络访问通过NAT实现

2 网络模式修改

  

  

3 网络隔离

原文地址:https://www.cnblogs.com/eason-d/p/11721076.html