How to route UDP traffic from one public IP (linux) to another public IP(Windows)
The following section works for TCP only (This was published before Mahendra changed the title
Install rinetd. In this program you can configure incoming port and outgoing port easily. First install the program. Then change /etc/rinetd.conf
Ex:
#bindadress bindport connectaddress connectport
a.b.c.d 6667 e.f.g.h 6668
For UDP check the link below
http://brokestream.com/udp_redirect.html
This is from the chat discussion which actually solved the problem
iptables -t nat -A PREROUTING -i $EXT_IF -p udp -d $EXT_IP --dport 53 -j DNAT --to-destination $INTERNAL_SERVER
and make sure you also have it allowed to pass through the FORWARD chain with something like
#forward traffic
iptables -A FORWARD -i $EXT_IF -o $INT_IF -p udp -d $INTERNAL_SERVER --dport 53 -j ACCEPT
#reply traffic
iptables -A INPUT -o $EXT_IF -i $INT_IF -p udp -s $INTERNAL_SERVER --sport 53 -m state --state ESTABLISHED,RELATED -j ACCEPT
Yes, this is called reverse NAT and is part of the IpTables capabilities of Linux. Every decent NATtins firewall does that to expose services.