1024hex
V2EX  ›  问与答

为什么 docker 切换网络模式为 bridge 会启动失败?

  •  
  •   1024hex · Apr 29, 2022 via Android · 1535 views
    This topic created in 1491 days ago, the information mentioned may be changed or developed.

    一开始是以 host 创建的容器,后来想切换成 bridge

    命令:

    docker network connect bridge ubuntu20
    docker container start ubuntu
    

    报错: Error response from daemon: failed to add interface veth4569079 to sandbox: error setting interface "veth4569079" IP to 172.17.0.3/16: cannot program address 172.17.0.3/16 in sandbox interface because it conflicts with existing route {Ifindex: 16 Dst: 172.17.0.0/16 Src: 172.17.0.1 Gw: <nil> Flags: [] Table: 254} Error: failed to start containers: ubuntu20

    但是换回 host 之后又能正常启动

    --network bridge新创建的容器,inspect 查看配置由网关,而 host->bridge 的容器却没看到有网关的信息

    2 replies    2022-05-05 13:50:23 +08:00
    Nnq
        1
    Nnq  
       Apr 30, 2022
    不是写了🈶️冲突么
    julyclyde
        2
    julyclyde  
       May 5, 2022
    bridge 的话你需要换一个 IP 地址了,和主网卡同网段的“隔壁”的 IP 地址
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1104 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 31ms · UTC 17:59 · PVG 01:59 · LAX 10:59 · JFK 13:59
    ♥ Do have faith in what you're doing.