Article 5GE13 Trying to Port Forward with iptables to hardware router

Trying to Port Forward with iptables to hardware router

by
PROBLEMCHYLD
from LinuxQuestions.org on (#5GE13)
I have tried forward chains prerouting and postrouting chains.

I don't want to open up port forwarding on my hardware router because the ports are always open. I want iptables to forward the necessary port 29000 to the hardware router when needed.

How do I allow this?

iptables -t nat -A PREROUTING -d Public IP -p tcp -m tcp --dport 29000 -j DNAT --to-destination 192.168.0.12:29000
iptables -t nat -A PREROUTING -d Public IP -p udp -m udp --dport 29000 -j DNAT --to-destination 192.168.0.12:29000
iptables -A FORWARD -d 192.168.0.12/32 -p tcp -m tcp --dport 29000 -m state --state NEW,RELATED,ESTABLISHED -j ACCEPT
iptables -A FORWARD -d 192.168.0.12/32 -p udp -m udp --dport 29000 -m state --state NEW,RELATED,ESTABLISHED -j ACCEPT
iptables -t nat -A POSTROUTING -s 192.168.0.12/32 -p tcp -m tcp --sport 29000 -j SNAT --to-source Public IP
iptables -t nat -A POSTROUTING -s 192.168.0.12/32 -p udp -m udp --sport 29000 -j SNAT --to-source Public IPlatest?d=yIl2AUoC8zA latest?i=B6MtJrCNXmA:nukzIFtvsIQ:F7zBnMy latest?i=B6MtJrCNXmA:nukzIFtvsIQ:V_sGLiP latest?d=qj6IDK7rITs latest?i=B6MtJrCNXmA:nukzIFtvsIQ:gIN9vFwB6MtJrCNXmA
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments