当我用已安装的docker启动ubuntu时,我有几个HWaddr。从哪里来?

时间:2017-11-23 09:55:15

标签: ubuntu docker

当我使用已安装的docker启动ubuntu时,我有几个HWaddr。我理解docker0需要什么,但是谁运行接口br-8e0d47e4a3eb,br-ac0f4344eb57,br-ca6e16c79073?

br-8e0d47e4a3eb Link encap:Ethernet  HWaddr 02:42:09:ec:49:6e  
          inet addr:172.21.0.1  Bcast:0.0.0.0  Mask:255.255.0.0

br-ac0f4344eb57 Link encap:Ethernet  HWaddr 02:42:ca:f6:b7:18  
          inet addr:172.22.0.1  Bcast:0.0.0.0  Mask:255.255.0.0

br-ca6e16c79073 Link encap:Ethernet  HWaddr 02:42:7a:36:50:5b  
          inet addr:172.20.0.1  Bcast:0.0.0.0  Mask:255.255.0.0

br-ce3b6827d42e Link encap:Ethernet  HWaddr 02:42:a9:df:8e:0d  
          inet addr:172.18.0.1  Bcast:0.0.0.0  Mask:255.255.0.0

docker0   Link encap:Ethernet  HWaddr 02:42:97:ac:f1:17  
          inet addr:172.17.0.1  Bcast:0.0.0.0  Mask:255.255.0.0
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

如果我执行docker ps -a,我看不到有人在运行docker容器。 感谢。

添加: 如果运行docker network ls:

NETWORK ID          NAME                 DRIVER              SCOPE
8e0d47e4a3eb        backoffice_default   bridge              local
927c43376b37        bridge               bridge              local
ac0f4344eb57        docker_default       bridge              local
3c2763a40a53        dockertest_default   bridge              local
27a582e0cbb1        host                 host                local
ca6e16c79073        jars_default         bridge              local
b68697f7a105        none                 null                local
ce3b6827d42e        normatives_default   bridge              local

1 个答案:

答案 0 :(得分:1)

这些可能是bridge个网络。

如果您尚未创建任何网络,则图片如下:

$ docker network ls
NETWORK ID          NAME                DRIVER              SCOPE
7b24145828f1        bridge              bridge              local    <-- this is docker0
412040f6cf69        host                host                local
1cbabce12616        none                null                local

让我们创建2个额外的桥接网络......

$ docker network create test-net-1
4d070d73233ebc17251e8c45f93c73b73b2d6b542d92a655688d89aa186944c2

$ docker network create test-net-2
9f6c773e92bd689f3bdbaf16f11533e86c94885e00a3895e35bd1dddbcb1cb24


$ docker network ls
NETWORK ID          NAME                DRIVER              SCOPE
7b24145828f1        bridge              bridge              local
412040f6cf69        host                host                local
1cbabce12616        none                null                local
4d070d73233e        test-net-1          bridge              local   <-- this is a new bridge network
9f6c773e92bd        test-net-2          bridge              local   <-- this is a new bridge network

ifconfig输出:

$ ifconfig
br-4d070d73233e Link encap:Ethernet  HWaddr 02:42:1e:c9:11:3e  
          inet addr:172.18.0.1  Bcast:0.0.0.0  Mask:255.255.0.0
...

br-9f6c773e92bd Link encap:Ethernet  HWaddr 02:42:a9:da:2f:71  
          inet addr:172.19.0.1  Bcast:0.0.0.0  Mask:255.255.0.0
...

docker0   Link encap:Ethernet  HWaddr 02:42:35:23:00:42  
          inet addr:172.17.0.1  Bcast:0.0.0.0  Mask:255.255.0.0