Reputation: 331
I'm using podman version 3.4.2 on Fedora 35, and trying to expose Firebird server on local network.
I was able to pull containers, do install of SQL server inside, but having trouble to expose this SQL server within container on the local network.
I have eth0
with local network IP 192.168.100.1 (where I want SQL from container to be exposed) and eth1
which is device with public IP 1.2.3.4. I want to do rootfull installation. I used following command:
podman run -it -p 3050:3050 fb_sql bash
Network defined as bridge by default. So after I activated SQL server inside container,
it is only visible on Public IP 1.2.3.4 of the MyServer, and even that not from the server itself, but rather from another computer calling Server's public IP.
I tried creating new network, but option --parent
only available for -d macvlan
How can I define bridge on eth0 (local dev) rather than default eth1 (public IP dev)?
netstat -apen |grep 3050
shows:
tcp 0 0 0.0.0.0:3050 0.0.0.0:* LISTEN 0 1304464 203883/conmon
Upvotes: 0
Views: 2484
Reputation: 130
The command podman run -it -p 3050:3050 fb_sql bash
publishes the port without restriction. The netstat
output confirms this, showing 0.0.0.0:3050
it will respond to any IPv4 address on any interface, so both 192.168.100.1 and 1.2.3.4 have the service on port 3050.
To limit traffic to a specific IP address on the host publish the IP with the port:
podman run -it -p 192.168.100.1:3050:3050 fb_sql bash
Here is usage explanation from man podman-run
--publish, -p=[[ip:][hostPort]:]containerPort[/protocol]
Publish a container's port, or range of ports, to the host.
Upvotes: 1