Find the answer to your Linux question:
Results 1 to 2 of 2
Hi, I am trying to figure out a method to redirect UDP traffic to a single socket to userspace app using iptables. My system runs on 2.4 kernel and currently ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Mar 2009
    Posts
    7

    iptables redirecting to different port


    Hi,

    I am trying to figure out a method to redirect UDP traffic to a single socket to userspace app using iptables. My system runs on 2.4 kernel and currently NAT is not used.

    After some analysis i figured out iptables can be used to redirect traffic based on matching rules to a different port. my assumption is that i can add a rule in input chain of filter table to divert udp traffic within source port ranges to a new port.

    when i tried to use the follwing command
    iptables -t filter -A INPUT -i eth0 -p udp --sport 9000:9010 -j REDIRECT --to-ports 9050
    it returns as Invalid argument

    Please help me with the above rule - is my assumption correct?
    will any other method or rule will be required?

    murugan

  2. #2
    Linux Guru Lazydog's Avatar
    Join Date
    Jun 2004
    Location
    The Keystone State
    Posts
    2,672
    Please see this IPTABLES TUTORIAL.

    Regards
    Robert

    Linux
    The adventure of a life time.

    Linux User #296285
    Get Counted

Posting Permissions

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