How do you allow your container to connect to your network?

I would like to build a container that is running Snort3 in order to monitor my network for malicious traffic. I’m still new to Docker so please forgive the newbie question. How do you configure the container to have the ability to connect to your network? I know about port binding but none of the apps in the container like Snort3 or Ubuntu have a “default port”, If they don’t have a default port how do you allow the apps in the container to interact with the network?

You don’t connect to the network of the host. Rather you just don’t ask for a network namespace. In other words, use the host network.

--network host

or in compose

network_mode: host

So you could do something like this? docker run -t -d --network host -p 100:100 --name myubuntu ubuntu:22.04

And this would make the ubuntu running in the container available by using the hosts IP on port 100 correct?

You don’t need -p when using --network: host. When the service opens a port, it’s using host ports directly.

Thank you rimelek and bluepuma77