Score:0

Remote IP Port Forwarding with SSH but with firewall.cmd or IPTables now

vu flag

The context:

I'm working with Zabbix Server and need to monitor remote servers conected with VPN/SSL tunnel using OpenFortiVPN with Any-Any rule set by our external Datacenter Provider.

Local IP of Zabbix Server: 192.168.2.6/24 Remote IP of monitored server: 10.0.0.1 (available from VPN/SSL Tunnel as said)

Zabbix dropped packets from ppp0 interface (created by openfortivpn connection), but I have succesfully stablished a ssh port forward from 10.0.0.1:10050 to 192.168.2.6:10056 and configurating 10.0.0.1 zabbix agent as server itself (server=10.0.0.1), and in the zabbix server side (192.168.2.6), I have created a host with 192.168.2.6 agent IP on local port 10056, and I have created to zabbix server obtaining 10.0.0.1:10050 agent data in 192.168.2.6:10056

The question and helping request is:

The ssh command line I have used is (with certificate autentication):

ssh -L 192.168.2.6:10056:10.0.0.1:10050 [email protected] -o ServerAliveInterval=60

How can I translate this functional ssh port forwarding (and cheating) rule to an IPtables or firewall-cmd (preferred), considering I have the fully functional vpn/ssl tunnel stablished.

Your help will be greatly appreciated since I have no experience in doing something like this with firewall-cmd or iptables and all my experiments have failed.

Bests,

René

us flag
You should set up proper routing table entries in both ends of the tunnel instead of trying NAT with firewall rules.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.