netfilter: Redirecting incoming udp packets to other port

Discussion in 'Linux Networking' started by muruga, Dec 11, 2006.

  1. muruga

    muruga Guest

    Hi,
    I want to redirect incoming udp packets comming to router to only
    go out from a praticular port. will it be possible by using iptables
    command. will the command change skbuff contents and tuple. Do reply
    packets will be the routed properly.

    scenario

    client ------------> router -------------------->server
    <----------- <--------------------


    if receive a orignal udp packet from client from client port x to
    router port y, can i use the same port y to forward to server (y acting
    as source port) and then receive the reply packet to port y as
    destination and successfully forward to client port x.

    will the cmd like will work
    iptables -A POSTROUTING -t nat -p udp --dport y --sport y -j MASQUERADE

    can any one give idea

    thanks in advance
    murugan
     
    muruga, Dec 11, 2006
    #1
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.