Find the answer to your Linux question:
Results 1 to 3 of 3
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    Unhappy Forwarding UDP packets using iptable

    Hi Folks,

    Am very new with the usage of iptables in Linux.
    What am trying to achieve is to forward some RTP (UDP) packets coming from a client to my proxy to a server.
    my client IP with rtp port 6000 initiates RTP packets to my proxy (configured on eth0) on port 10002.
    What I want to achieve here is these rtp packets to be forwarded to (server) on port 6000. i.e.>>>>

    IPtable configurations for prerouting I have done so far is :
    iptables -t nat -A PREROUTING -i eth0 -p udp -m udp --dport 10002 -j DNAT --to-destination
    iptables -t nat -A PREROUTING -i eth0 -p udp -m udp --dport 10000 -j DNAT --to-destination

    But packets are not getting forwarded to my server and vice versa.

    However, I can see count of those packets getting reflected in iptables output :

    Chain PREROUTING (policy ACCEPT 2265 packets, 735K bytes)
    pkts bytes target prot opt in out source destination
    3210 1000K IP_OVERLAP_PREROUTING all -- * *
    6608 1850K DNAT udp -- eth0 * udp dpt:10002 to:
    0 0 DNAT udp -- eth0 * udp dpt:10000 to:

    Looking forward to any suggestion(s)

    Last edited by jainayush09; 06-05-2013 at 03:34 PM.

  2. #2
    Linux Engineer
    Join Date
    Apr 2012
    Virginia, USA
    --dport should be --sport
    Not sure if the other stuff is right as I've never tried to setup a NAT this way.

  3. #3
    @Mizzle : Thanks for your reply. The problem was related to the Forward Chain, since there was no rule to forward, packets were getting dropped.
    It's working fine now with the same configuration as I have stated above, only thing required was forward chain rule.


  4. $spacer_open

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts