Create a virtual Docker network and connect to containers using assigned their IP?

I’m trying to create several Docker containers that are running an SSH server. My host machine is on a network and I’d like to create several Docker containers that reside on another network (for example and be able to communicate with each Docker container with an IP address I set it. I want this setup to test a tool that will connect to multiple machines with an IP range. Do you know how I could achieve something like this or if there is a better setup I should try?

I am not sure I understand your question. Can you explain it in more details? If you just want the SSH ports to be available remotely, you can publish the SSH ports (port forward) by using the -p HOST_PORT:CONTAINER_PORT parameter of docker run or the ports section in Docker Compose.

I What do you mean by “connect … with an IP range”?

If you need the containers to be running on LAN network you can try Use macvlan networks | Docker Documentation but it is often required because of a bad design or compatibility issues so I would avoid using it unless it is absolutely necessary.