Find the answer to your Linux question:
Results 1 to 3 of 3
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 ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Jun 2013
    Posts
    5

    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.
    e.g.
    my client IP 10.201.1.106 with rtp port 6000 initiates RTP packets to my proxy 10.201.102.25 (configured on eth0) on port 10002.
    What I want to achieve here is these rtp packets to be forwarded to 10.201.1.57 (server) on port 6000. i.e.

    10.201.1.106:6000--->10.201.102.25:10002--->10.201.1.57:6000
    10.201.1.57:6000--->10.201.102.25:10000--->10.201.1.106:6000

    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 10.201.1.57:6000
    iptables -t nat -A PREROUTING -i eth0 -p udp -m udp --dport 10000 -j DNAT --to-destination 10.201.1.106:6000

    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 -- * * 0.0.0.0/0 0.0.0.0/0
    6608 1850K DNAT udp -- eth0 * 0.0.0.0/0 0.0.0.0/0 udp dpt:10002 to:10.201.1.57:6000
    0 0 DNAT udp -- eth0 * 0.0.0.0/0 0.0.0.0/0 udp dpt:10000 to:10.201.1.106:6000



    Looking forward to any suggestion(s)

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

  2. #2
    Linux Engineer
    Join Date
    Apr 2012
    Location
    Virginia, USA
    Posts
    910
    --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
    Just Joined!
    Join Date
    Jun 2013
    Posts
    5
    @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.

    Regards,
    Ayush

  4. $spacer_open
    $spacer_close

Posting Permissions

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