1

Currently I try to setup docker-swarm using two nodes and deploy portainer on them.

Both nodes are virtual machines on the same host and are on the same network (172.16.255.255). Addtionally there is a firewall in these local network providing a VPN server (255.255.0.0). The VPN routes requests to 172.16.255.255 in the local network (e. g. 10.0.0.3 can access 172.16.0.80). No ports are blocked.
I have no trouble accessing the virtual machines (e. g. by ssh).

I followed the installation instructions on portainer.io.

Compose File:

version: '3.2'

services:
  agent:
    image: portainer/agent
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
      - /var/lib/docker/volumes:/var/lib/docker/volumes
    networks:
      - agent_network
    deploy:
      mode: global
      placement:
        constraints: [node.platform.os == linux]

  portainer:
    image: portainer/portainer-ce
    command: -H tcp://tasks.agent:9001 --tlsskipverify
    ports:
      - 9000:9000
      - 8000:8000
    volumes:
      - portainer_data:/data
    networks:
      - agent_network
    deploy:
      mode: replicated
      replicas: 1
      placement:
        constraints: [node.role == manager]

networks:
  agent_network:
    driver: overlay
    attachable: true

volumes:
  portainer_data:

Run command:

docker stack deploy --compose-file=portainer-agent-stack.yml portainer

The stack is successfully deployed and I can access the portainer UI as long as I'm in the local network. The UI is even accessible from other virtual machines, which are not part of the swarm.

But when I try to access the UI from my VPN, I get a timeout (SYN, but no ACK).
This happen for other container as well (e. g. I tried to test it with jwilder/whoami for different ports).

When I setup a container, with identical settings, without swarm, the service is accessiable via VPN.

1 Answer 1

1

The problem was that the vpn network has the subnet 10.0.0.0/8 and the ingress network of docker swarm has the subnet 10.0.0.0/24. So there were a conflict.

Fix: Changing either the vpn subnet or the ingress network subnet.

2
  • How to change that though?
    – Soerendip
    Aug 12, 2021 at 4:40
  • @Sören I Donät remeber which aproach I choosed.. but changing the ip of your vpn network depends on the vpn server. And take a look at this post for changing the ingress network
    – D. Weber
    Aug 13, 2021 at 5:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.