lisaac / luci-app-dockerman

Docker Manager interface for LuCI
GNU Affero General Public License v3.0
836 stars 233 forks source link

lean选择bridge不能连外网,选择host没问题 #6

Closed tcsr200722 closed 4 years ago

tcsr200722 commented 4 years ago

lean选择bridge不能连外网,选择host没问题

tcsr200722 commented 4 years ago

之前有一版解决这个问题的,现在更新版本后,再次出现不能联网

lisaac commented 4 years ago

你指的是dockerman的版本更新导致问题?

tcsr200722 commented 4 years ago

嗯,上个版本没问题

---原始邮件--- 发件人: "lisaac"<notifications@github.com> 发送时间: 2020年1月26日 20:59:05 收件人: "lisaac/luci-app-dockerman"<luci-app-dockerman@noreply.github.com>; 抄送: "Author"<author@noreply.github.com>;"tcsr200722"<350524166@qq.com>; 主题: Re: [lisaac/luci-app-dockerman] lean选择bridge不能连外网,选择host没问题 (#6)

你指的是dockerman的版本更新导致问题?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

lisaac commented 4 years ago

用命令行创建是否存在这个问题 如果命令行创建没问题,麻烦分别贴一下两个容器的信息,方便对比

docker inspect 容器名
tcsr200722 commented 4 years ago

大佬,我不会用命令行

---原始邮件--- 发件人: "lisaac"<notifications@github.com> 发送时间: 2020年1月26日 21:24:33 收件人: "lisaac/luci-app-dockerman"<luci-app-dockerman@noreply.github.com>; 抄送: "Author"<author@noreply.github.com>;"tcsr200722"<350524166@qq.com>; 主题: Re: [lisaac/luci-app-dockerman] lean选择bridge不能连外网,选择host没问题 (#6)

用命令行创建是否存在这个问题 如果命令行创建没问题,麻烦分别贴一下两个容器的信息,方便对比 docker inspect 容器名
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

lisaac commented 4 years ago

上个版本是哪个版本,我这里测试都是没有问题的

tcsr200722 commented 4 years ago
root@Openwrt:~# docker inspect baidupcs
[
    {
        "Id": "e414fb06e0a94f1b413c33fae131ca7e39e2c529714e282eeb8c5eb695265a5f"                                                                                                                                                             ,
        "Created": "2019-09-06T13:58:24.327704393Z",
        "Path": "/tini",
        "Args": [
            "--",
            "/entrypoint.sh"
        ],
        "State": {
            "Status": "running",
            "Running": true,
            "Paused": false,
            "Restarting": false,
            "OOMKilled": false,
            "Dead": false,
            "Pid": 21256,
            "ExitCode": 0,
            "Error": "",
            "StartedAt": "2020-01-26T13:34:38.115915738Z",
            "FinishedAt": "2020-01-23T07:29:55.178332173+08:00"
        },
        "Image": "sha256:0bd383974ad935c140c43db7e4c4a55322365f01d815611c9bfa593                                                                                                                                                             d40c760c9",
        "ResolvConfPath": "/mnt/sdb1/docker/data/containers/e414fb06e0a94f1b413c                                                                                                                                                             33fae131ca7e39e2c529714e282eeb8c5eb695265a5f/resolv.conf",
        "HostnamePath": "/mnt/sdb1/docker/data/containers/e414fb06e0a94f1b413c33                                                                                                                                                             fae131ca7e39e2c529714e282eeb8c5eb695265a5f/hostname",
        "HostsPath": "/mnt/sdb1/docker/data/containers/e414fb06e0a94f1b413c33fae                                                                                                                                                             131ca7e39e2c529714e282eeb8c5eb695265a5f/hosts",
        "LogPath": "/mnt/sdb1/docker/data/containers/e414fb06e0a94f1b413c33fae13                                                                                                                                                             1ca7e39e2c529714e282eeb8c5eb695265a5f/e414fb06e0a94f1b413c33fae131ca7e39e2c52971                                                                                                                                                             4e282eeb8c5eb695265a5f-json.log",
        "Name": "/baidupcs",
        "RestartCount": 0,
        "Driver": "overlay2",
        "Platform": "linux",
        "MountLabel": "",
        "ProcessLabel": "",
        "AppArmorProfile": "",
        "ExecIDs": null,
        "HostConfig": {
            "Binds": [
                "/mnt/sdb1/baidupcs-web/config:/app/.config/BaiduPCS-Go",
                "/mnt/sdc1/baidupcs:/app/Downloads"
            ],
            "ContainerIDFile": "",
            "LogConfig": {
                "Type": "json-file",
                "Config": {}
            },
            "NetworkMode": "default",
            "PortBindings": {
                "5299/tcp": [
                    {
                        "HostIp": "",
                        "HostPort": "5299"
                    }
                ]
            },
            "RestartPolicy": {
                "Name": "no",
                "MaximumRetryCount": 0
            },
            "AutoRemove": false,
            "VolumeDriver": "",
            "VolumesFrom": null,
            "CapAdd": null,
            "CapDrop": null,
            "Dns": [],
            "DnsOptions": [],
            "DnsSearch": [],
            "ExtraHosts": null,
            "GroupAdd": null,
            "IpcMode": "shareable",
            "Cgroup": "",
            "Links": null,
            "OomScoreAdj": 0,
            "PidMode": "",
            "Privileged": false,
            "PublishAllPorts": false,
            "ReadonlyRootfs": false,
            "SecurityOpt": null,
            "UTSMode": "",
            "UsernsMode": "",
            "ShmSize": 67108864,
            "Runtime": "runc",
            "ConsoleSize": [
                0,
                0
            ],
            "Isolation": "",
            "CpuShares": 0,
            "Memory": 0,
            "NanoCpus": 0,
            "CgroupParent": "",
            "BlkioWeight": 0,
            "BlkioWeightDevice": [],
            "BlkioDeviceReadBps": null,
            "BlkioDeviceWriteBps": null,
            "BlkioDeviceReadIOps": null,
            "BlkioDeviceWriteIOps": null,
            "CpuPeriod": 0,
            "CpuQuota": 0,
            "CpuRealtimePeriod": 0,
            "CpuRealtimeRuntime": 0,
            "CpusetCpus": "",
            "CpusetMems": "",
            "Devices": [],
            "DeviceCgroupRules": null,
            "DiskQuota": 0,
            "KernelMemory": 0,
            "MemoryReservation": 0,
            "MemorySwap": 0,
            "MemorySwappiness": null,
            "OomKillDisable": false,
            "PidsLimit": 0,
            "Ulimits": null,
            "CpuCount": 0,
            "CpuPercent": 0,
            "IOMaximumIOps": 0,
            "IOMaximumBandwidth": 0,
            "MaskedPaths": [
                "/proc/asound",
                "/proc/acpi",
                "/proc/kcore",
                "/proc/keys",
                "/proc/latency_stats",
                "/proc/timer_list",
                "/proc/timer_stats",
                "/proc/sched_debug",
                "/proc/scsi",
                "/sys/firmware"
            ],
            "ReadonlyPaths": [
                "/proc/bus",
                "/proc/fs",
                "/proc/irq",
                "/proc/sys",
                "/proc/sysrq-trigger"
            ]
        },
        "GraphDriver": {
            "Data": {
                "LowerDir": "/mnt/sdb1/docker/data/overlay2/9a92907ae6c79e54a63b                                                                                                                                                             158124bd741167f7d52d7f4c085d1ffd307cf4cc9b8f-init/diff:/mnt/sdb1/docker/data/ove                                                                                                                                                             rlay2/88fb2fd75a5bfd0ea43119ebcbac127908cf5e16e05a9456e76fae69dc19c899/diff:/mnt                                                                                                                                                             /sdb1/docker/data/overlay2/288a7e0c162650fe31a199fea3eceb647e4ee8df0fdf12ec07b6d                                                                                                                                                             60b7e8ab94f/diff:/mnt/sdb1/docker/data/overlay2/018c1f65f03e7e68e864800f6f3362f1                                                                                                                                                             ea42566d7f8154a1c812fb617134d9f8/diff:/mnt/sdb1/docker/data/overlay2/51261bf6d39                                                                                                                                                             4420101fc390353cb80f35a7def11224597bb7d0d2e593a531aae/diff",
                "MergedDir": "/mnt/sdb1/docker/data/overlay2/9a92907ae6c79e54a63                                                                                                                                                             b158124bd741167f7d52d7f4c085d1ffd307cf4cc9b8f/merged",
                "UpperDir": "/mnt/sdb1/docker/data/overlay2/9a92907ae6c79e54a63b                                                                                                                                                             158124bd741167f7d52d7f4c085d1ffd307cf4cc9b8f/diff",
                "WorkDir": "/mnt/sdb1/docker/data/overlay2/9a92907ae6c79e54a63b1                                                                                                                                                             58124bd741167f7d52d7f4c085d1ffd307cf4cc9b8f/work"
            },
            "Name": "overlay2"
        },
        "Mounts": [
            {
                "Type": "bind",
                "Source": "/mnt/sdb1/baidupcs-web/config",
                "Destination": "/app/.config/BaiduPCS-Go",
                "Mode": "",
                "RW": true,
                "Propagation": "rprivate"
            },
            {
                "Type": "bind",
                "Source": "/mnt/sdc1/baidupcs",
                "Destination": "/app/Downloads",
                "Mode": "",
                "RW": true,
                "Propagation": "rprivate"
            }
        ],
        "Config": {
            "Hostname": "e414fb06e0a9",
            "Domainname": "",
            "User": "root",
            "AttachStdin": false,
            "AttachStdout": false,
            "AttachStderr": false,
            "ExposedPorts": {
                "5299/tcp": {}
            },
            "Tty": false,
            "OpenStdin": false,
            "StdinOnce": false,
            "Env": [
                "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/b                                                                                                                                                             in",
                "BAIDUPCS_VERSION=3.6.11",
                "TINI_VERSION=v0.18.0",
                "MY_TZ=Asia/Shanghai",
                "TERM=xterm",
                "WEB_PORT=5299",
                "UMASK_SET=002",
                "PUID=1000",
                "PGID=1000"
            ],
            "Cmd": [
                "/entrypoint.sh"
            ],
            "Image": "80x86/baidupcs",
            "Volumes": {
                "/app/.config/BaiduPCS-Go": {},
                "/app/Downloads": {}
            },
            "WorkingDir": "/app/Downloads",
            "Entrypoint": [
                "/tini",
                "--"
            ],
            "OnBuild": null,
            "Labels": {
                "org.label-schema.build-date": "20190821-2103",
                "org.label-schema.description": "baidupcs web for container",
                "org.label-schema.maintainer": "荒野無燈 <HuangYeWuDeng#nanodm.n                                                                                                                                                             et>",
                "org.label-schema.name": "80x86/baidupcs",
                "org.label-schema.schema-version": "1.0",
                "org.label-schema.url": "http://nanodm.net",
                "org.label-schema.vcs-ref": "014cac8",
                "org.label-schema.vendor": "NanoDM"
            }
        },
        "NetworkSettings": {
            "Bridge": "",
            "SandboxID": "be649aa821a499b9c19aa126ed143e39036362d4b9ea5d37b3aaf9                                                                                                                                                             f4df27b826",
            "HairpinMode": false,
            "LinkLocalIPv6Address": "",
            "LinkLocalIPv6PrefixLen": 0,
            "Ports": {
                "5299/tcp": [
                    {
                        "HostIp": "0.0.0.0",
                        "HostPort": "5299"
                    }
                ]
            },
            "SandboxKey": "/mnt/sdb1/docker/data/run/netns/be649aa821a4",
            "SecondaryIPAddresses": null,
            "SecondaryIPv6Addresses": null,
            "EndpointID": "cf9cbb45547f123b4a713dfd82865a9d74df5fd88aefce01d7d97                                                                                                                                                             eabe8546b82",
            "Gateway": "172.17.0.1",
            "GlobalIPv6Address": "",
            "GlobalIPv6PrefixLen": 0,
            "IPAddress": "172.17.0.4",
            "IPPrefixLen": 16,
            "IPv6Gateway": "",
            "MacAddress": "02:42:ac:11:00:04",
            "Networks": {
                "bridge": {
                    "IPAMConfig": null,
                    "Links": null,
                    "Aliases": null,
                    "NetworkID": "7d30cc16965d6b22ff52b6caa7c389923331f4ccca2aa6                                                                                                                                                             ae7ab291698e92c4d3",
                    "EndpointID": "cf9cbb45547f123b4a713dfd82865a9d74df5fd88aefc                                                                                                                                                             e01d7d97eabe8546b82",
                    "Gateway": "172.17.0.1",
                    "IPAddress": "172.17.0.4",
                    "IPPrefixLen": 16,
                    "IPv6Gateway": "",
                    "GlobalIPv6Address": "",
                    "GlobalIPv6PrefixLen": 0,
                    "MacAddress": "02:42:ac:11:00:04",
                    "DriverOpts": null
                }
            }
        }
    }
]
tcsr200722 commented 4 years ago

这个是lean自带的luci-docker-ce的输出结果

tcsr200722 commented 4 years ago
root@OpenWrt:~# docker inspect baidupcs
[
    {
        "Id": "a7a4bf4cc33d1de6ad4e410bcef6c7db67e6cf02a457367f596a269baa944b81",
        "Created": "2020-01-26T12:20:58.315716316Z",
        "Path": "/tini",
        "Args": [
            "--",
            "/entrypoint.sh"
        ],
        "State": {
            "Status": "running",
            "Running": true,
            "Paused": false,
            "Restarting": false,
            "OOMKilled": false,
            "Dead": false,
            "Pid": 3613,
            "ExitCode": 0,
            "Error": "",
            "StartedAt": "2020-01-26T13:39:14.995421089Z",
            "FinishedAt": "2020-01-26T13:39:09.839310801Z"
        },
        "Image": "sha256:0bd383974ad935c140c43db7e4c4a55322365f01d815611c9bfa593d40c760c9",
        "ResolvConfPath": "/opt/docker/containers/a7a4bf4cc33d1de6ad4e410bcef6c7db67e6cf02a457367f596a269baa944b81/resolv.conf",
        "HostnamePath": "/opt/docker/containers/a7a4bf4cc33d1de6ad4e410bcef6c7db67e6cf02a457367f596a269baa944b81/hostname",
        "HostsPath": "/opt/docker/containers/a7a4bf4cc33d1de6ad4e410bcef6c7db67e6cf02a457367f596a269baa944b81/hosts",
        "LogPath": "/opt/docker/containers/a7a4bf4cc33d1de6ad4e410bcef6c7db67e6cf02a457367f596a269baa944b81/a7a4bf4cc33d1de6ad4e410bcef6c7db67e6cf02a457367f596a269baa944b81-json.log",
        "Name": "/baidupcs",
        "RestartCount": 0,
        "Driver": "overlay2",
        "Platform": "linux",
        "MountLabel": "",
        "ProcessLabel": "",
        "AppArmorProfile": "",
        "ExecIDs": null,
        "HostConfig": {
            "Binds": [
                "/mnt/sdb1/baidupcs:/app/.config/BaiduPCS-Go",
                "/mnt/sdc1/baidupcs:/app/Downloads"
            ],
            "ContainerIDFile": "",
            "LogConfig": {
                "Type": "json-file",
                "Config": {}
            },
            "NetworkMode": "bridge",
            "PortBindings": {
                "5299/tcp": [
                    {
                        "HostIp": "",
                        "HostPort": "5299"
                    }
                ]
            },
            "RestartPolicy": {
                "Name": "unless-stopped",
                "MaximumRetryCount": 0
            },
            "AutoRemove": false,
            "VolumeDriver": "",
            "VolumesFrom": null,
            "CapAdd": null,
            "CapDrop": null,
            "Capabilities": null,
            "Dns": [],
            "DnsOptions": [],
            "DnsSearch": [],
            "ExtraHosts": null,
            "GroupAdd": null,
            "IpcMode": "private",
            "Cgroup": "",
            "Links": null,
            "OomScoreAdj": 0,
            "PidMode": "",
            "Privileged": false,
            "PublishAllPorts": false,
            "ReadonlyRootfs": false,
            "SecurityOpt": null,
            "UTSMode": "",
            "UsernsMode": "",
            "ShmSize": 67108864,
            "Runtime": "runc",
            "ConsoleSize": [
                0,
                0
            ],
            "Isolation": "",
            "CpuShares": 0,
            "Memory": 0,
            "NanoCpus": 0,
            "CgroupParent": "",
            "BlkioWeight": 0,
            "BlkioWeightDevice": null,
            "BlkioDeviceReadBps": null,
            "BlkioDeviceWriteBps": null,
            "BlkioDeviceReadIOps": null,
            "BlkioDeviceWriteIOps": null,
            "CpuPeriod": 0,
            "CpuQuota": 0,
            "CpuRealtimePeriod": 0,
            "CpuRealtimeRuntime": 0,
            "CpusetCpus": "",
            "CpusetMems": "",
            "Devices": null,
            "DeviceCgroupRules": null,
            "DeviceRequests": null,
            "KernelMemory": 0,
            "KernelMemoryTCP": 0,
            "MemoryReservation": 0,
            "MemorySwap": 0,
            "MemorySwappiness": null,
            "OomKillDisable": false,
            "PidsLimit": null,
            "Ulimits": null,
            "CpuCount": 0,
            "CpuPercent": 0,
            "IOMaximumIOps": 0,
            "IOMaximumBandwidth": 0,
            "MaskedPaths": [
                "/proc/asound",
                "/proc/acpi",
                "/proc/kcore",
                "/proc/keys",
                "/proc/latency_stats",
                "/proc/timer_list",
                "/proc/timer_stats",
                "/proc/sched_debug",
                "/proc/scsi",
                "/sys/firmware"
            ],
            "ReadonlyPaths": [
                "/proc/bus",
                "/proc/fs",
                "/proc/irq",
                "/proc/sys",
                "/proc/sysrq-trigger"
            ]
        },
        "GraphDriver": {
            "Data": {
                "LowerDir": "/opt/docker/overlay2/f092c61780b646409b80ea808462fa4dc7f924b201a4ceebf12b72ddd68d6449-init/diff:/opt/docker/overlay2/7ec99d2503fa4fa2aea6d6737149180e88c0e5f61167ab53d8f8494b9d1a6d8b/diff:/opt/docker/overlay2/a2be860b8eeb3bc960358d84373e2f8bd6fb2868d480c63bf1dd663943e1b0d6/diff:/opt/docker/overlay2/dffcf30669cb069b68dee8f168ce4141562fa6e7e0a36eac0649a0561e1128f8/diff:/opt/docker/overlay2/fb7b90a77f589ced8a33832f42f6b8ae5f9d866bfb621baea5510f9c1a661e92/diff",
                "MergedDir": "/opt/docker/overlay2/f092c61780b646409b80ea808462fa4dc7f924b201a4ceebf12b72ddd68d6449/merged",
                "UpperDir": "/opt/docker/overlay2/f092c61780b646409b80ea808462fa4dc7f924b201a4ceebf12b72ddd68d6449/diff",
                "WorkDir": "/opt/docker/overlay2/f092c61780b646409b80ea808462fa4dc7f924b201a4ceebf12b72ddd68d6449/work"
            },
            "Name": "overlay2"
        },
        "Mounts": [
            {
                "Type": "bind",
                "Source": "/mnt/sdc1/baidupcs",
                "Destination": "/app/Downloads",
                "Mode": "",
                "RW": true,
                "Propagation": "rprivate"
            },
            {
                "Type": "bind",
                "Source": "/mnt/sdb1/baidupcs",
                "Destination": "/app/.config/BaiduPCS-Go",
                "Mode": "",
                "RW": true,
                "Propagation": "rprivate"
            }
        ],
        "Config": {
            "Hostname": "baidupcs",
            "Domainname": "",
            "User": "root",
            "AttachStdin": false,
            "AttachStdout": false,
            "AttachStderr": false,
            "ExposedPorts": {
                "5299/tcp": {}
            },
            "Tty": false,
            "OpenStdin": false,
            "StdinOnce": false,
            "Env": [
                "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
                "BAIDUPCS_VERSION=3.6.11",
                "TINI_VERSION=v0.18.0",
                "MY_TZ=Asia/Shanghai",
                "TERM=xterm",
                "WEB_PORT=5299",
                "UMASK_SET=002",
                "PUID=1000",
                "PGID=1000"
            ],
            "Cmd": [
                "/entrypoint.sh"
            ],
            "Image": "80x86/baidupcs:amd64",
            "Volumes": {
                "/app/.config/BaiduPCS-Go": {},
                "/app/Downloads": {}
            },
            "WorkingDir": "/app/Downloads",
            "Entrypoint": [
                "/tini",
                "--"
            ],
            "OnBuild": null,
            "Labels": {
                "org.label-schema.build-date": "20190821-2103",
                "org.label-schema.description": "baidupcs web for container",
                "org.label-schema.maintainer": "荒野無燈 <HuangYeWuDeng#nanodm.net>",
                "org.label-schema.name": "80x86/baidupcs",
                "org.label-schema.schema-version": "1.0",
                "org.label-schema.url": "http://nanodm.net",
                "org.label-schema.vcs-ref": "014cac8",
                "org.label-schema.vendor": "NanoDM"
            }
        },
        "NetworkSettings": {
            "Bridge": "",
            "SandboxID": "b3665ba00dcca9c3fe7da275b30103fdbe2dcc5519f4b1f7efa2e4fe534c1aab",
            "HairpinMode": false,
            "LinkLocalIPv6Address": "",
            "LinkLocalIPv6PrefixLen": 0,
            "Ports": {
                "5299/tcp": [
                    {
                        "HostIp": "0.0.0.0",
                        "HostPort": "5299"
                    }
                ]
            },
            "SandboxKey": "/var/run/docker/netns/b3665ba00dcc",
            "SecondaryIPAddresses": null,
            "SecondaryIPv6Addresses": null,
            "EndpointID": "345e41df72046c5fe379d681951253aec02a64ac84273a0933595667921ebfc5",
            "Gateway": "172.17.0.1",
            "GlobalIPv6Address": "",
            "GlobalIPv6PrefixLen": 0,
            "IPAddress": "172.17.0.2",
            "IPPrefixLen": 16,
            "IPv6Gateway": "",
            "MacAddress": "02:42:ac:11:00:02",
            "Networks": {
                "bridge": {
                    "IPAMConfig": null,
                    "Links": null,
                    "Aliases": null,
                    "NetworkID": "a9ab29ded149dc3f5aac3f7aba1b2822d828c39215486c1b1d36a584bff5fc74",
                    "EndpointID": "345e41df72046c5fe379d681951253aec02a64ac84273a0933595667921ebfc5",
                    "Gateway": "172.17.0.1",
                    "IPAddress": "172.17.0.2",
                    "IPPrefixLen": 16,
                    "IPv6Gateway": "",
                    "GlobalIPv6Address": "",
                    "GlobalIPv6PrefixLen": 0,
                    "MacAddress": "02:42:ac:11:00:02",
                    "DriverOpts": null
                }
            }
        }
    }
]
tcsr200722 commented 4 years ago

这个是dockerman的结果

tcsr200722 commented 4 years ago

不知道能不能帮上忙

tcsr200722 commented 4 years ago

错误代码: -1, 消息: 网络请求失败, Post https://wappass.baidu.com/wp/api/login: dial tcp 112.34.111.63:443: connect: connection refused

tcsr200722 commented 4 years ago

Release v0.1.6 bridge可以上网的

tcsr200722 commented 4 years ago

大佬是用lean的op编译的么?几个版本测试都没有问题?

---原始邮件--- 发件人: "lisaac"<notifications@github.com> 发送时间: 2020年1月26日 21:36:04 收件人: "lisaac/luci-app-dockerman"<luci-app-dockerman@noreply.github.com>; 抄送: "Author"<author@noreply.github.com>;"tcsr200722"<350524166@qq.com>; 主题: Re: [lisaac/luci-app-dockerman] lean选择bridge不能连外网,选择host没问题 (#6)

上个版本是哪个版本,我这里测试都是没有问题的

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

lisaac commented 4 years ago

错误代码: -1, 消息: 网络请求失败, Post https://wappass.baidu.com/wp/api/login: dial tcp 112.34.111.63:443: connect: connection refused

应该不是同一个系统吧? 能否在容器中ping通路由器?

请用ubuntu镜像或者alpine镜像进行测试一下

lisaac commented 4 years ago

大佬是用lean的op编译的么?几个版本测试都没有问题?

大概率docker-ce问题 我是在luci-in-docker环境下测试的,系统是debian

tcsr200722 commented 4 years ago

哦!我试试换个版本的docker-ce

lisaac commented 4 years ago

哦!我试试换个版本的docker-ce

在有问题的命令行上测试以下命令

docker exec baidupcs ping -c3 114.114.114.114
docker run --rm -t alpine ping -c3 114.114.114.114
tcsr200722 commented 4 years ago

root@OpenWrt:~# docker exec baidupcs ping -c3 114.114.114.114 PING 114.114.114.114 (114.114.114.114): 56 data bytes

--- 114.114.114.114 ping statistics --- 3 packets transmitted, 0 packets received, 100% packet loss

lisaac commented 4 years ago

root@OpenWrt:~# docker exec baidupcs ping -c3 114.114.114.114 PING 114.114.114.114 (114.114.114.114): 56 data bytes

--- 114.114.114.114 ping statistics --- 3 packets transmitted, 0 packets received, 100% packet loss

重点是下一条命令的结果

tcsr200722 commented 4 years ago

syBox v1.30.0 () built-in shell (ash)


| |.-----.-----.-----.| | | |.----.| | | - || | -| || | | || || | |___|| |_||||____||| |__| |__| W I R E L E S S F R E E D O M

OpenWrt SNAPSHOT, r1896-85ca0440

root@OpenWrt:~# docker run --rm -t alpine ping -c3 114.114.114.114 Unable to find image 'alpine:latest' locally

latest: Pulling from library/alpine c9b1b535fdd9: Pull complete Digest: sha256:ab00606a42621fb68f2ed6ad3c88be54397f981a7b70a79db3d1172b11c4367d Status: Downloaded newer image for alpine:latest PING 114.114.114.114 (114.114.114.114): 56 data bytes

--- 114.114.114.114 ping statistics --- 3 packets transmitted, 0 packets received, 100% packet loss

lisaac commented 4 years ago

syBox v1.30.0 () built-in shell (ash)

| |.-----.-----.-----.| | | |.----.| |_

| - || | -**| || | | || || _| |____|| |**||||__**||| |____| |**| W I R E L E S S F R E E D O M

OpenWrt SNAPSHOT, r1896-85ca0440

root@OpenWrt:~# docker run --rm -t alpine ping -c3 114.114.114.114 Unable to find image 'alpine:latest' locally

latest: Pulling from library/alpine c9b1b535fdd9: Pull complete Digest: sha256:ab00606a42621fb68f2ed6ad3c88be54397f981a7b70a79db3d1172b11c4367d Status: Downloaded newer image for alpine:latest PING 114.114.114.114 (114.114.114.114): 56 data bytes

--- 114.114.114.114 ping statistics --- 3 packets transmitted, 0 packets received, 100% packet loss

与插件无关

lisaac commented 4 years ago

今天有空接触了一下 lean 的 lede 可能是应该 docker-ce 的 bug,也有可能是 docker-ce 和其他插件的一些冲突,导致 iptable 中没有开启 SNAT, 通过这条命令可以修复

iptables -t nat -A POSTROUTING -s 172.17.0.0/16 ! -o docker0 -j MASQUERADE

具体原因就不查了

lisaac commented 4 years ago

@tcsr200722

另外 刚刚又测试了一下 发现删除 docker0 并重启,docker 会添加上 SNAT,即可正常使用

ip link del docker0
reboot
tcsr200722 commented 4 years ago

已经通过删除 docker0 并重启解决问题,谢谢lisaac大