as long as the devices doing the NAT support port translation, it should work fine. I guess your linux server is dual homed and functioning as a router?
Main Topics
Browse All TopicsIs the concept of double port forwarding a valid one ?
For example, i forward a port 5161 on one device (i.e Router) to a second device's port 1161 (i.e. Linux Server) and that second device port forwards 1161 to another device's port 161 .... (i.e. Wireless access point) ... Is it practically possible to do such a thing ? i.e Double Port forwarding ?
It seems to work with 1 device (i.e If i port forward from router to Linux server) but doesn't work if I port forward that port further from second device (i.e. Linux Server) to another third device ...
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Absolutely it will work, HOWEVER, when you do that, the listening device at the end must be configured to listen on that port instead of the initial one that your translating. In other words if you have FTP coming in on port 21 and 22 but you port forward twice to a computer and the ending port number your forwarding is 2100 and 2101, the computers FTP service must be configured to be listening on those ports so it can respond.
Linux server is dual homed and functioning as a router .... Yes, thats correct
Hmm, I think I must be doing something wrong in the port forwarding rules on the Linux Server .... This is what I used.
iptables -A FORWARD -d 192.0.0.2 -p udp --dport 161 -j ACCEPT
iptables -t nat -A PREROUTING -d 10.156.13.101 -p udp --dport 1161 -j DNAT --to-destination 192.0.0.2:161
and then did service iptables restart
I'm new to Linux so am not sure If I need to change script files of IPTables to make this rule functional or what ..... My Router is able to port forward 5161 to 1161 but my linux cant port forward 1161 to 161 to an access point ... Access Point is a normal D-link configured with the correct community string ....
By the way, this port forwarding am doing is to basically make SNMP work; I'm interested in monitoring the access points rather than the Linux Server or the Router ! and these access points are Natted behind the Linux Server and the Linux Server is natted behind the Cisco router (and then out to the internet ofcourse)
Linux box shows my iptable rule for iptables -A FORWARD -d 192.0.0.2 -p udp --dport 161 -j ACCEPT but doesnt show the iptables -t nat -A PREROUTING -d 10.156.13.101 -p udp --dport 1161 -j DNAT --to-destination 192.0.0.2:161 rule in its output ... Plus How can I move it up in the order ..?
[root@pxe sysconfig]# iptables -L -v
Chain INPUT (policy ACCEPT 481 packets, 42165 bytes)
pkts bytes target prot opt in out source destination
0 0 ACCEPT udp -- tun0 any anywhere 172.20.0.1 udp dpt:domain
0 0 ACCEPT udp -- tun0 any anywhere 255.255.255.255 udp dpts:bootps:bootpc
0 0 ACCEPT tcp -- tun0 any anywhere 172.20.0.1 tcp dpt:bv-smcsrv
0 0 ACCEPT tcp -- tun0 any anywhere 172.20.0.1 tcp dpt:bv-is
0 0 DROP all -- tun0 any anywhere 172.20.0.1
0 0 DROP all -- tun0 any anywhere anywhere
Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
0 0 ACCEPT tcp -- tun0 any anywhere anywhere tcp dpt:pptp
0 0 ACCEPT gre -- tun0 any anywhere anywhere
0 0 DROP all -- tun0 !eth0 anywhere anywhere
0 0 TCPMSS tcp -- any any anywhere anywhere tcp flags:SYN,RST/SYN TCPMSS clamp to PMTU
0 0 ACCEPT all -- any tun0 anywhere anywhere
0 0 ACCEPT all -- tun0 any anywhere anywhere
0 0 DROP all -- any eth1 anywhere anywhere
0 0 DROP all -- eth1 any anywhere anywhere
0 0 ACCEPT udp -- any any anywhere 192.0.0.2 udp dpt:snmp
Chain OUTPUT (policy ACCEPT 471 packets, 62709 bytes)
pkts bytes target prot opt in out source destination
Business Accounts
Answer for Membership
by: jdroger2Posted on 2009-08-25 at 19:27:32ID: 25184035
as long as the devices doing the NAT support port translation, it should work fine. I guess your linux server is dual homed and functioning as a router?