Docker Swarm Containers are not having external/Outbound connectivity in Windows server 2022

We are setting up the Docker Swarm Orchestration in the Windows server 2022 (Version 21H2 and OS Build:20348.2340) with MS SQL Server (2022) and Docker Engine version (25.0.3).
We are using .NetCore 8.0, RabbitMQ (For Message Queuing) and docker-compose files.
Each application is deployed as a Microservice.

Issue Description:
We initialized the Swarm (Single Manager node) with VM IP address and it run in Windows server 2022.
We deployed the services using command - docker stack deploy docker-compose.yml <app_name>.We can see the docker service got created with replicated status (1/1) and all the containers are launched successfully (in swarm overlay network)

However we cannot see any outbound connectivity/external traffic from docker swarm containers. It is unable to communicate even to localhost,1433 SQL port or any other ports.
We have tested using Test-NetConnection -ComputerName -Port 1433 command by running the swarm container.
Even swarm containers are showing UP status , It is not working as expected and seeing failures on SQL connectivity and others .(from docker logs <container_name).
We also found the swarm containers are not using WinNAT/NAT network for External connectivity. Please help us to resolve this issue

Steps we tried:

  1. Added required firewall connectivity for swarm setup with TCP and UDP ports opened
  2. Created overlay network for swarm services and use that network for deploying docker swarm
    3)Added required Firewall for SQL Server- port 1433 and also RabbitMQ.
  3. Non Swarm Container are running fine in same windows 2022 server and it is using NAT network for outbound connectivity

Note: We also have same setup running successfully in Windows server 2016 with SQL server 2016 and Docker Version 20.10.9. In that 2016 server , we can see the swarm containers are using ‘WinNAT’ network/vEthernet NIC adapter for the Outbound connectivity but same step is missing in the 2022 server.

I had the same problem, have you tried creating a network for outbound connectivity? The command is: docker network create -d nat --gateway --subnet -o, -o mynat , see part of my book here: Hands-on Data Virtualization with Polybase: Administer Big Data, SQL Queries ... - Pablo Alejandro Echeverria Barrios - Google Books

If we enable the Hyper-V before the docker installation, we are getting the below error in docker service itself. Docker service ps --no-trunc <docker_service_id>
“failed during hnsCallRawResponse: hnsCall failed in Win32: An adapter was not found. (0x803b0006)”

Hi @pabechevb … I have executed the above command for creating the network and ran command: docker network connect mynat … I can see the Network got attached to container (by command docker container inspect .

I am still Seeing the Timeout issue when running “ping OR Test-NetConnection -ComputerName -Port 1433” inside the container and it is still uses Overlay network created by Swarm and not the “mynat” network created by us.