Forum :
Problems & Answers
Topic :
Port forwarding across multiple nodes
For anyone trying to crack the code to port forwarding across multiple nodes, following is what worked for me in creating the ability to forward from a mesh gateway, across multiple nodes to the node hosting my Echo/IRLP node. #Node Port Monitor
iptables -A input_wan -p tcp --dport 8088 -j ACCEPT
iptables -t nat -A prerouting_wan -p tcp --dport 8088 -j DNAT --to 10.7.55.202:8088
iptables -A forwarding_wan -p tcp --dport 8088 -d 10.7.55.202 -j ACCEPT
iptables -t nat -A postrouting_wan -p tcp -d 10.7.55.202 -j SNAT -dport 8088 --to-source 10.212.63.152
#Echo Ports
iptables -A input_wan -p tcp --dport 5198 -j ACCEPT
iptables -t nat -A prerouting_wan -p tcp --dport 5198 -j DNAT --to 10.7.55.202:5198
iptables -A forwarding_wan -p tcp --dport 5198 -d 10.7.55.202 -j ACCEPT
iptables -t nat -A postrouting_wan -p tcp -d 10.7.55.202 -j SNAT -dport 5198 --to-source 10.212.63.152
iptables -A input_wan -p tcp --dport 5199 -j ACCEPT
iptables -t nat -A prerouting_wan -p tcp --dport 5199 -j DNAT --to 10.7.55.202:5199
iptables -A forwarding_wan -p tcp --dport 5199 -d 10.7.55.202 -j ACCEPT
iptables -t nat -A postrouting_wan -p tcp -d 10.7.55.202 -j SNAT -dport 5199 --to-source 10.212.63.152
iptables -A input_wan -p tcp --dport 5200 -j ACCEPT
iptables -t nat -A prerouting_wan -p tcp --dport 5200 -j DNAT --to 10.7.55.202:5200
iptables -A forwarding_wan -p tcp --dport 5200 -d 10.7.55.202 -j ACCEPT
iptables -t nat -A postrouting_wan -p tcp -d 10.7.55.202 -j SNAT -dport 5200 --to-source 10.212.63.152
#IRLP Control
iptables -A input_wan -p tcp --dport 15425 -j ACCEPT
iptables -t nat -A prerouting_wan -p tcp --dport 15425 -j DNAT --to 10.7.55.202:15425
iptables -A forwarding_wan -p tc --dport 15425 -d 10.7.55.202 -j ACCEPT
iptables -t nat -A postrouting_wan -p tcp -d 10.7.55.202 -j SNAT -dport 15425 --to-source 10.212.63.152
iptables -A input_wan -p tcp --dport 15426 -j ACCEPT
iptables -t nat -A prerouting_wan -p tcp --dport 15426 -j DNAT --to 10.7.55.202:15426
iptables -A forwarding_wan -p tcp --dport 15426 -d 10.7.55.202 -j ACCEPT
iptables -t nat -A postrouting_wan -p tcp -d 10.7.55.202 -j SNAT -dport 15426 --to-source 10.212.63.152
iptables -A input_wan -p tcp --dport 15427 -j ACCEPT
iptables -t nat -A prerouting_wan -p tcp --dport 15427 -j DNAT --to 10.7.55.202:15427
iptables -A forwarding_wan -p tcp --dport 15427 -d 10.7.55.202 -j ACCEPT
iptables -t nat -A postrouting_wan -p tcp -d 10.7.55.202 -j SNAT -dport 15427 --to-source 10.212.63.152
#IRLP Traffic
iptables -A input_wan -p udp --dport 2074 -j ACCEPT
iptables -t nat -A prerouting_wan -p udp --dport 2074 -j DNAT --to 10.7.55.202:2074
iptables -A forwarding_wan -p udp --dport 2074 -d 10.7.55.202 -j ACCEPT
iptables -t nat -A postrouting_wan -p udp -d 10.7.55.202 -j SNAT -dport 2074 --to-source 10.212.63.152
iptables -A input_wan -p udp --dport 2075 -j ACCEPT
iptables -t nat -A prerouting_wan -p udp --dport 2075 -j DNAT --to 10.7.55.202:2075
iptables -A forwarding_wan -p udp --dport 2075 -d 10.7.55.202 -j ACCEPT
iptables -t nat -A postrouting_wan -p udp -d 10.7.55.202 -j SNAT -dport 2075 --to-source 10.212.63.152
iptables -A input_wan -p udp --dport 2076 -j ACCEPT
iptables -t nat -A prerouting_wan -p udp --dport 2076 -j DNAT --to 10.7.55.202:2076
iptables -A forwarding_wan -p udp --dport 2076 -d 10.7.55.202 -j ACCEPT
iptables -t nat -A postrouting_wan -p udp -d 10.7.55.202 -j SNAT -dport 2076 --to-source 10.212.63.152
iptables -A input_wan -p udp --dport 2077 -j ACCEPT
iptables -t nat -A prerouting_wan -p udp --dport 2077 -j DNAT --to 10.7.55.202:2077
iptables -A forwarding_wan -p udp --dport 2077 -d 10.7.55.202 -j ACCEPT
iptables -t nat -A postrouting_wan -p udp -d 10.7.55.202 -j SNAT -dport 2077 --to-source 10.212.63.152
iptables -A input_wan -p udp --dport 2078 -j ACCEPT
iptables -t nat -A prerouting_wan -p udp --dport 2078 -j DNAT --to 10.7.55.202:2078
iptables -A forwarding_wan -p udp --dport 2078 -d 10.7.55.202 -j ACCEPT
iptables -t nat -A postrouting_wan -p udp -d 10.7.55.202 -j SNAT -dport 2078 --to-source 10.212.63.152
iptables -A input_wan -p udp --dport 2079 -j ACCEPT
iptables -t nat -A prerouting_wan -p udp --dport 2079 -j DNAT --to 10.7.55.202:2079
iptables -A forwarding_wan -p udp --dport 2079 -d 10.7.55.202 -j ACCEPT
iptables -t nat -A postrouting_wan -p udp -d 10.7.55.202 -j SNAT -dport 2079 --to-source 10.212.63.152
iptables -A input_wan -p udp --dport 2080 -j ACCEPT
iptables -t nat -A prerouting_wan -p udp --dport 2080 -j DNAT --to 10.7.55.202:2080
iptables -A forwarding_wan -p udp --dport 2080 -d 10.7.55.202 -j ACCEPT
iptables -t nat -A postrouting_wan -p udp -d 10.7.55.202 -j SNAT -dport 2080 --to-source 10.212.63.152
iptables -A input_wan -p udp --dport 2081 -j ACCEPT
iptables -t nat -A prerouting_wan -p udp --dport 2081 -j DNAT --to 10.7.55.202:2081
iptables -A forwarding_wan -p udp --dport 2081 -d 10.7.55.202 -j ACCEPT
iptables -t nat -A postrouting_wan -p udp -d 10.7.55.202 -j SNAT -dport 2081 --to-source 10.212.63.152
iptables -A input_wan -p udp --dport 2082 -j ACCEPT
iptables -t nat -A prerouting_wan -p udp --dport 2082 -j DNAT --to 10.7.55.202:2082
iptables -A forwarding_wan -p udp --dport 2082 -d 10.7.55.202 -j ACCEPT
iptables -t nat -A postrouting_wan -p udp -d 10.7.55.202 -j SNAT -dport 2082 --to-source 10.212.63.152
iptables -A input_wan -p udp --dport 2083 -j ACCEPT
iptables -t nat -A prerouting_wan -p udp --dport 2083 -j DNAT --to 10.7.55.202:2083
iptables -A forwarding_wan -p udp --dport 2083 -d 10.7.55.202 -j ACCEPT
iptables -t nat -A postrouting_wan -p udp -d 10.7.55.202 -j SNAT -dport 2083 --to-source 10.212.63.152
iptables -A input_wan -p udp --dport 2084 -j ACCEPT
iptables -t nat -A prerouting_wan -p udp --dport 2084 -j DNAT --to 10.7.55.202:2084
iptables -A forwarding_wan -p udp --dport 2084 -d 10.7.55.202 -j ACCEPT
iptables -t nat -A postrouting_wan -p udp -d 10.7.55.202 -j SNAT -dport 2084 --to-source 10.212.63.152
iptables -A input_wan -p udp --dport 2085 -j ACCEPT
iptables -t nat -A prerouting_wan -p udp --dport 2085 -j DNAT --to 10.7.55.202:2085
iptables -A forwarding_wan -p udp --dport 2085 -d 10.7.55.202 -j ACCEPT
iptables -t nat -A postrouting_wan -p udp -d 10.7.55.202 -j SNAT -dport 2085 --to-source 10.212.63.152
iptables -A input_wan -p udp --dport 2086 -j ACCEPT
iptables -t nat -A prerouting_wan -p udp --dport 2086 -j DNAT --to 10.7.55.202:2086
iptables -A forwarding_wan -p udp --dport 2086 -d 10.7.55.202 -j ACCEPT
iptables -t nat -A postrouting_wan -p udp -d 10.7.55.202 -j SNAT -dport 2086 --to-source 10.212.63.152
iptables -A input_wan -p udp --dport 2087 -j ACCEPT
iptables -t nat -A prerouting_wan -p udp --dport 2087 -j DNAT --to 10.7.55.202:2087
iptables -A forwarding_wan -p udp --dport 2087 -d 10.7.55.202 -j ACCEPT
iptables -t nat -A postrouting_wan -p udp -d 10.7.55.202 -j SNAT -dport 2087 --to-source 10.212.63.152
iptables -A input_wan -p udp --dport 2088 -j ACCEPT
iptables -t nat -A prerouting_wan -p udp --dport 2088 -j DNAT --to 10.7.55.202:2088
iptables -A forwarding_wan -p udp --dport 2088 -d 10.7.55.202 -j ACCEPT
iptables -t nat -A postrouting_wan -p udp -d 10.7.55.202 -j SNAT -dport 2088 --to-source 10.212.63.152
iptables -A input_wan -p udp --dport 2089 -j ACCEPT
iptables -t nat -A prerouting_wan -p udp --dport 2089 -j DNAT --to 10.7.55.202:2089
iptables -A forwarding_wan -p udp --dport 2089 -d 10.7.55.202 -j ACCEPT
iptables -t nat -A postrouting_wan -p udp -d 10.7.55.202 -j SNAT -dport 2089 --to-source 10.212.63.152
iptables -A input_wan -p udp --dport 2090 -j ACCEPT
iptables -t nat -A prerouting_wan -p udp --dport 2090 -j DNAT --to 10.7.55.202:2090
iptables -A forwarding_wan -p udp --dport 2090 -d 10.7.55.202 -j ACCEPT
iptables -t nat -A postrouting_wan -p udp -d 10.7.55.202 -j SNAT -dport 2090 --to-source 10.212.63.152
iptables -A input_wan -p udp --dport 2091 -j ACCEPT
iptables -t nat -A prerouting_wan -p udp --dport 2091 -j DNAT --to 10.7.55.202:2091
iptables -A forwarding_wan -p udp --dport 2091 -d 10.7.55.202 -j ACCEPT
iptables -t nat -A postrouting_wan -p udp -d 10.7.55.202 -j SNAT -dport 2091 --to-source 10.212.63.152
iptables -A input_wan -p udp --dport 2092 -j ACCEPT
iptables -t nat -A prerouting_wan -p udp --dport 2092 -j DNAT --to 10.7.55.202:2092
iptables -A forwarding_wan -p udp --dport 2092 -d 10.7.55.202 -j ACCEPT
iptables -t nat -A postrouting_wan -p udp -d 10.7.55.202 -j SNAT -dport 2092 --to-source 10.212.63.152
iptables -A input_wan -p udp --dport 2093 -j ACCEPT
iptables -t nat -A prerouting_wan -p udp --dport 2093 -j DNAT --to 10.7.55.202:2093
iptables -A forwarding_wan -p udp --dport 2093 -d 10.7.55.202 -j ACCEPT
iptables -t nat -A postrouting_wan -p udp -d 10.7.55.202 -j SNAT -dport 2093 --to-source 10.212.63.152
#EchoIRLP ╨ Kkasin 03-15-15 |