Hi, I have standalone leap server in my lan with just one eth1. I have ports forwarded from public IP to this server. I’d like to forward some port to other machine in lan.
What I did:
sudo firewall-cmd --add-forward-port=port=55555:proto=tcp:toport=5900:toaddr=10.0.0.163 --permanent
sudo firewall-cmd --add-port=55555/tcp --permanent
sudo firewall-cmd --reload
This is my setup:
me@server:~> sudo sysctl -a |grep -i eth1.forwarding
net.ipv4.conf.eth1.forwarding = 1
net.ipv6.conf.eth1.forwarding = 0
me@server:~> sudo firewall-cmd --list-all
public (active)
target: default
icmp-block-inversion: no
interfaces: eth1
sources:
services: dhcpv6-client samba ssh
ports: 55555/tcp
protocols:
forward: no
masquerade: no
forward-ports:
port=55555:proto=tcp:toport=5900:toaddr=10.0.0.163
source-ports:
icmp-blocks:
rich rules:
I don’t know if I should, but I see nothing listening at 55555 via sudo netstat -tunlp
When I forward using other tool, like socat, I see it listening and it works, it will connect me to remote ip:
me@server:~> socat TCP-LISTEN:55555,fork TCP:10.0.0.163:5900
I’d like to use firewall-cmd, because it will eat less memory, I don’t have to create a service to have socat started on startup, etc. So what is the deal with firewall-cmd? I think I do everything by the book, yet it does not work. I have virtualbox installed on server, apache, samba, nothing unusual.
I came across some thread, that libvirt can interfere with firewall-cmd, but I don’t know, if virtualbox uses it.
Btw. is it possible to forward port somehow and still retain the original ip for the remote machine? When I socat forward I (naturaly) see the connection coming from server ip, not the originating ip, but on server I still see the real originating ip, not the ip of router from my ISP, which made the forward. And sorry for the typo in title, but I don’t know how to edit the thread title.
Thank you.