V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
chenluo0429
V2EX  ›  Docker

docker 同一 network 下的 container 无法互通

  •  
  •   chenluo0429 · 2022-08-11 16:42:46 +08:00 via Android · 1116 次点击
    这是一个创建于 866 天前的主题,其中的信息可能已经有所发展或是发生改变。
    之前一直没问题的,昨天试了一下 openwrt 的 docker 镜像,把 network_mode 设成了 host ,结果把我宿主环境 debian 的网络搞出问题了。

    一个是 lo 的 127.0.0.1 地址丢失,被我加回来了,还有不知道哪里出的问题,导致同 network 下的 container 无法互相通信了。

    现在本地环境用 docker 部署的 seafile 和 harbor 都趴窝了。

    有没有对网络有研究的大佬可以指点下?不胜感激。

    以下是 ip a sh 的结果



    1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000

    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00

    inet 127.0.0.1/8 scope host lo

    valid_lft forever preferred_lft forever

    inet6 ::1/128 scope host

    valid_lft forever preferred_lft forever

    2: enp2s0f0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000

    link/ether 54:80:28:50:c4:a6 brd ff:ff:ff:ff:ff:ff

    inet 192.168.1.110/24 brd 192.168.1.255 scope global enp2s0f0

    valid_lft forever preferred_lft forever

    inet6 fe80::5680:28ff:fe50:c4a6/64 scope link

    valid_lft forever preferred_lft forever

    3: enp2s0f1: <BROADCAST,MULTICAST> mtu 1500 qdisc mq state DOWN group default qlen 1000

    link/ether 54:80:28:50:c4:a7 brd ff:ff:ff:ff:ff:ff

    11: docker0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default

    link/ether 02:42:51:7a:44:f2 brd ff:ff:ff:ff:ff:ff

    inet 172.17.0.1/16 brd 172.17.255.255 scope global docker0

    valid_lft forever preferred_lft forever

    inet6 fe80::42:51ff:fe7a:44f2/64 scope link

    valid_lft forever preferred_lft forever

    280: vethbe66043@if279: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master br-12b095940582 state UP group default

    link/ether be:91:02:37:d2:17 brd ff:ff:ff:ff:ff:ff link-netnsid 6

    inet6 fe80::bc91:2ff:fe37:d217/64 scope link

    valid_lft forever preferred_lft forever

    1306: veth898fd93@if1305: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master br-3643175fee9c state UP group default

    link/ether 86:a3:a8:d3:8b:27 brd ff:ff:ff:ff:ff:ff link-netnsid 21

    inet6 fe80::84a3:a8ff:fed3:8b27/64 scope link

    valid_lft forever preferred_lft forever

    285: docker_gwbridge: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default

    link/ether 02:42:45:82:66:f6 brd ff:ff:ff:ff:ff:ff

    inet 192.168.208.1/20 brd 192.168.223.255 scope global docker_gwbridge

    valid_lft forever preferred_lft forever

    inet6 fe80::42:45ff:fe82:66f6/64 scope link

    valid_lft forever preferred_lft forever

    306: veth7f2a64e@if305: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master br-12b095940582 state UP group default

    link/ether d2:c1:0e:06:26:cb brd ff:ff:ff:ff:ff:ff link-netnsid 11

    inet6 fe80::d0c1:eff:fe06:26cb/64 scope link

    valid_lft forever preferred_lft forever

    308: veth21c2307@if307: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master br-12b095940582 state UP group default

    link/ether 52:24:d9:2c:50:3e brd ff:ff:ff:ff:ff:ff link-netnsid 10

    inet6 fe80::5024:d9ff:fe2c:503e/64 scope link

    valid_lft forever preferred_lft forever

    316: vethbaa4a89@if315: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master br-12b095940582 state UP group default

    link/ether fa:85:81:bb:f0:60 brd ff:ff:ff:ff:ff:ff link-netnsid 4

    inet6 fe80::f885:81ff:febb:f060/64 scope link

    valid_lft forever preferred_lft forever

    318: veth1d4e6b6@if317: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master br-6f346c0cb116 state UP group default

    link/ether e6:73:fc:74:d1:a2 brd ff:ff:ff:ff:ff:ff link-netnsid 0

    inet6 fe80::e473:fcff:fe74:d1a2/64 scope link

    valid_lft forever preferred_lft forever

    1350: veth05be788@if1349: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master br-45e48075d829 state UP group default

    link/ether 0e:65:55:f8:e3:ec brd ff:ff:ff:ff:ff:ff link-netnsid 22

    inet6 fe80::c65:55ff:fef8:e3ec/64 scope link

    valid_lft forever preferred_lft forever

    1354: veth640367f@if1353: <BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue master br-45e48075d829 state UNKNOWN group default

    link/ether 72:7b:f3:e9:40:ed brd ff:ff:ff:ff:ff:ff link-netnsid 20

    inet6 fe80::707b:f3ff:fee9:40ed/64 scope link tentative

    valid_lft forever preferred_lft forever

    79: ztyouzynrj: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 2800 qdisc pfifo_fast state UNKNOWN group default qlen 1000

    link/ether 1a:10:60:36:cd:27 brd ff:ff:ff:ff:ff:ff

    inet 10.10.11.2/24 brd 10.10.11.255 scope global ztyouzynrj

    valid_lft forever preferred_lft forever

    inet6 fe80::1810:60ff:fe36:cd27/64 scope link

    valid_lft forever preferred_lft forever

    82: zt6uvkhse4: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 2800 qdisc pfifo_fast state UNKNOWN group default qlen 1000

    link/ether d6:7d:95:4c:5e:ed brd ff:ff:ff:ff:ff:ff

    inet 10.10.10.2/24 brd 10.10.10.255 scope global zt6uvkhse4

    valid_lft forever preferred_lft forever

    inet6 fe80::d47d:95ff:fe4c:5eed/64 scope link

    valid_lft forever preferred_lft forever

    393: vethf3a8fe6@if392: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master br-12b095940582 state UP group default

    link/ether e6:0b:11:9a:e4:ba brd ff:ff:ff:ff:ff:ff link-netnsid 2

    inet6 fe80::e40b:11ff:fe9a:e4ba/64 scope link

    valid_lft forever preferred_lft forever

    409: veth2a2ea0f@if408: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master br-3643175fee9c state UP group default

    link/ether 26:6a:2f:38:94:db brd ff:ff:ff:ff:ff:ff link-netnsid 8

    inet6 fe80::246a:2fff:fe38:94db/64 scope link

    valid_lft forever preferred_lft forever

    413: veth2d369e0@if412: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master br-3643175fee9c state UP group default

    link/ether b2:71:6a:88:99:3d brd ff:ff:ff:ff:ff:ff link-netnsid 7

    inet6 fe80::b071:6aff:fe88:993d/64 scope link

    valid_lft forever preferred_lft forever

    425: veth4c3577c@if424: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master br-3643175fee9c state UP group default

    link/ether 66:09:48:a8:62:04 brd ff:ff:ff:ff:ff:ff link-netnsid 30

    inet6 fe80::6409:48ff:fea8:6204/64 scope link

    valid_lft forever preferred_lft forever

    439: br-887ad38547b6: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default link/ether 02:42:8f:89:16:1d brd ff:ff:ff:ff:ff:ff

    inet 172.19.0.1/16 brd 172.19.255.255 scope global br-887ad38547b6

    valid_lft forever preferred_lft forever

    inet6 fe80::42:8fff:fe89:161d/64 scope link

    valid_lft forever preferred_lft forever

    441: vethe956399@if440: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master br-887ad38547b6 state UP group default

    link/ether 9e:73:2a:56:9b:5d brd ff:ff:ff:ff:ff:ff link-netnsid 3

    inet6 fe80::9c73:2aff:fe56:9b5d/64 scope link

    valid_lft forever preferred_lft forever

    185: br-6f346c0cb116: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default link/ether 02:42:86:50:f9:16 brd ff:ff:ff:ff:ff:ff

    inet 192.168.144.1/20 brd 192.168.159.255 scope global br-6f346c0cb116

    valid_lft forever preferred_lft forever

    inet6 fe80::42:86ff:fe50:f916/64 scope link

    valid_lft forever preferred_lft forever

    187: vethd41e976@if186: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master br-6f346c0cb116 state UP group default

    link/ether 02:7f:e4:75:45:c2 brd ff:ff:ff:ff:ff:ff link-netnsid 15

    inet6 fe80::7f:e4ff:fe75:45c2/64 scope link

    valid_lft forever preferred_lft forever

    444: br-45e48075d829: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default link/ether 02:42:58:c3:1d:cc brd ff:ff:ff:ff:ff:ff

    inet 172.20.0.1/16 brd 172.20.255.255 scope global br-45e48075d829

    valid_lft forever preferred_lft forever

    inet6 fe80::42:58ff:fec3:1dcc/64 scope link

    valid_lft forever preferred_lft forever

    189: veth825cd43@if188: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master br-6f346c0cb116 state UP group default

    link/ether 46:51:00:98:c1:5f brd ff:ff:ff:ff:ff:ff link-netnsid 14

    inet6 fe80::4451:ff:fe98:c15f/64 scope link

    valid_lft forever preferred_lft forever

    446: veth9cd5511@if445: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master br-45e48075d829 state UP group default

    link/ether aa:5d:12:7e:8d:03 brd ff:ff:ff:ff:ff:ff link-netnsid 5

    inet6 fe80::a85d:12ff:fe7e:8d03/64 scope link

    valid_lft forever preferred_lft forever

    190: br-12b095940582: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default link/ether 02:42:a4:d4:8a:a6 brd ff:ff:ff:ff:ff:ff

    inet 192.168.160.1/20 brd 192.168.175.255 scope global br-12b095940582

    valid_lft forever preferred_lft forever

    inet6 fe80::42:a4ff:fed4:8aa6/64 scope link

    valid_lft forever preferred_lft forever

    191: br-3643175fee9c: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default link/ether 02:42:02:61:59:06 brd ff:ff:ff:ff:ff:ff

    inet 192.168.176.1/20 brd 192.168.191.255 scope global br-3643175fee9c

    valid_lft forever preferred_lft forever

    inet6 fe80::42:2ff:fe61:5906/64 scope link

    valid_lft forever preferred_lft forever

    448: veth95c99d1@if447: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master br-45e48075d829 state UP group default

    link/ether 22:05:ba:70:24:94 brd ff:ff:ff:ff:ff:ff link-netnsid 13

    inet6 fe80::2005:baff:fe70:2494/64 scope link

    valid_lft forever preferred_lft forever

    450: veth2dd786f@if449: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master br-45e48075d829 state UP group default

    link/ether f2:04:a2:0b:80:5b brd ff:ff:ff:ff:ff:ff link-netnsid 17

    inet6 fe80::f004:a2ff:fe0b:805b/64 scope link

    valid_lft forever preferred_lft forever

    452: vethc79ee12@if451: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master br-45e48075d829 state UP group default

    link/ether 7a:61:bf:ae:39:a5 brd ff:ff:ff:ff:ff:ff link-netnsid 16

    inet6 fe80::7861:bfff:feae:39a5/64 scope link

    valid_lft forever preferred_lft forever

    454: vethccb17b8@if453: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master br-45e48075d829 state UP group default

    link/ether 2a:16:08:05:17:4f brd ff:ff:ff:ff:ff:ff link-netnsid 18

    inet6 fe80::2816:8ff:fe05:174f/64 scope link

    valid_lft forever preferred_lft forever

    456: veth541a22f@if455: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master br-45e48075d829 state UP group default

    link/ether fe:8f:a2:2e:dd:5d brd ff:ff:ff:ff:ff:ff link-netnsid 19

    inet6 fe80::fc8f:a2ff:fe2e:dd5d/64 scope link

    valid_lft forever preferred_lft forever

    201: veth7fdc222@if200: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master br-12b095940582 state UP group default

    link/ether 7e:2e:ac:c1:2d:9b brd ff:ff:ff:ff:ff:ff link-netnsid 9

    inet6 fe80::7c2e:acff:fec1:2d9b/64 scope link

    valid_lft forever preferred_lft forever

    462: vethee3a61f@if461: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master br-45e48075d829 state UP group default

    link/ether 1a:51:85:84:3d:4d brd ff:ff:ff:ff:ff:ff link-netnsid 23

    inet6 fe80::1851:85ff:fe84:3d4d/64 scope link

    valid_lft forever preferred_lft forever

    213: veth83e670e@if212: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master br-12b095940582 state UP group default

    link/ether b2:1a:d4:4d:07:ee brd ff:ff:ff:ff:ff:ff link-netnsid 12

    inet6 fe80::b01a:d4ff:fe4d:7ee/64 scope link

    valid_lft forever preferred_lft forever

    241: veth71805cc@if240: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master br-12b095940582 state UP group default

    link/ether 1e:3c:f5:0c:da:fa brd ff:ff:ff:ff:ff:ff link-netnsid 1

    inet6 fe80::1c3c:f5ff:fe0c:dafa/64 scope link

    valid_lft forever preferred_lft forever
    masker
        1
    masker  
       2022-08-11 17:11:00 +08:00 via Android
    ~/.docker/config.json 有没有设置代理
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   3457 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 28ms · UTC 04:49 · PVG 12:49 · LAX 20:49 · JFK 23:49
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.