Docker error "cannot program address 172.19.0.316 in sandbox interface because it conflicts with existing route&quo

I am trying to run these containers for a ctf on my kali machine, but when I run the command I encounte

I am trying to run these containers for a ctf on my kali machine, but when I run the command I encounter this bunch of errors, tried doing a clean install of docker as I'm new to it, still get the same error, tried troubleshoot with chatgpt still nothing. I don't think its a problem of the compose file as it worked for other people as it is.

It should create 3 containers that are connected to each other in this way: network

The archive with all the files provided is linked here.

$ make up                
docker info >/dev/null 2>/dev/null
Environment created.
docker network prune -f
docker-compose up -d
Creating network "challenge_files_a00_ext" with driver "bridge"
Creating network "challenge_files_a10_net1" with driver "macvlan"
Creating network "challenge_files_a20_net2" with driver "macvlan"
Creating challenge_files_node1_1 ... 
Creating challenge_files_node3_1 ... done
Creating challenge_files_node2_1 ... error

ERROR: for challenge_files_node2_1  Cannot start service node2: failed to create task for container: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: error during container init: error running hook #0: error running hook: exit status 1, stdout: , stderr: failed to add interface veth5913ce4 to sandbox: error setting interface "veth5913ce4Creating challenge_files_node1_1 ... error
 because it conflicts with existing route {Ifindex: 12 Dst: 0.0.0.0/0 Src: <nil> Gw: 172.18.0.1 Flags: [] Table: 254 Realm: 0}: unknown

ERROR: for challenge_files_node1_1  Cannot start service node1: failed to create task for container: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: error during container init: error running hook #0: error running hook: exit status 1, stdout: , stderr: failed to add interface veth0e8efb6 to sandbox: error setting interface "veth0e8efb6" IP to 172.18.0.3/16: cannot program address 172.18.0.3/16 in sandbox interface because it conflicts with existing route {Ifindex: 10 Dst: 0.0.0.0/0 Src: <nil> Gw: 192.168.123.1 Flags: [] Table: 254 Realm: 0}: unknown

ERROR: for node2  Cannot start service node2: failed to create task for container: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: error during container init: error running hook #0: error running hook: exit status 1, stdout: , stderr: failed to add interface veth5913ce4 to sandbox: error setting interface "veth5913ce4" IP to 172.19.0.3/16: cannot program address 172.19.0.3/16 in sandbox interface because it conflicts with existing route {Ifindex: 12 Dst: 0.0.0.0/0 Src: <nil> Gw: 172.18.0.1 Flags: [] Table: 254 Realm: 0}: unknown

ERROR: for node1  Cannot start service node1: failed to create task for container: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: error during container init: error running hook #0: error running hook: exit status 1, stdout: , stderr: failed to add interface veth0e8efb6 to sandbox: error setting interface "veth0e8efb6" IP to 172.18.0.3/16: cannot program address 172.18.0.3/16 in sandbox interface because it conflicts with existing route {Ifindex: 10 Dst: 0.0.0.0/0 Src: <nil> Gw: 192.168.123.1 Flags: [] Table: 254 Realm: 0}: unknown
ERROR: Encountered errors while bringing up the project.
make: *** [Makefile:14: up] Error 1

I have no existing networks using this subnet, and I've even tried defining a completely different subnet upon creation, but it still gives me the same message.

This is route -n on my machine:

Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         192.168.0.1     0.0.0.0         UG    600    0        0 wlan0
172.17.0.0      0.0.0.0         255.255.0.0     U     0      0        0 docker0
192.168.0.0     0.0.0.0         255.255.255.0   U     600    0        0 wlan0

Anyway heres the docker-compose.yaml

version: "3"

services:
  node1:
    build: 
      context: ./ubuntu-ccit
      dockerfile: Dockerfile
    image: ubuntu-ccit
    hostname: node1
    volumes:
      - ./src:/src
    privileged: true
    environment:
     - ROOTPW=ccit
    networks:
     a00_ext:
      ipv4_address: 192.168.123.123
     a10_net1:

  node2:
    build: 
      context: ./ubuntu-ccit
      dockerfile: Dockerfile
    image: ubuntu-ccit
    hostname: node2
    privileged: true
    volumes:
      - ./src:/src
    environment:
     - ROOTPW=ccit
     - REMIP=1
    networks:
     a10_net1:
     a20_net2:

  node3:
    build: 
      context: ./ubuntu-ccit
      dockerfile: Dockerfile
    image: ubuntu-ccit
    hostname: node3
    volumes:
      - ./src:/src
    privileged: true
    environment:
     - ROOTPW=ccit
     - REMIP=1
    networks:
     a20_net2:

networks:
  a00_ext:
   driver: bridge
   ipam:
    driver: default
    config:
     - subnet: 192.168.123.0/24

  a10_net1:
   driver: macvlan
   driver_opts:
     parent: ccit-net.10

  a20_net2:
   driver: macvlan
   driver_opts:
     parent: ccit-net.20

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745044303a4608000.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信