Linux Netfilter discussions
 help / color / mirror / Atom feed
From: Pablo Neira Ayuso <pablo@netfilter.org>
To: Pankaj Yadav <pankajdnapster@gmail.com>
Cc: netfilter@vger.kernel.org
Subject: Re: nftables DNAT change destport
Date: Mon, 16 Nov 2015 11:39:37 +0100	[thread overview]
Message-ID: <20151116103937.GA2907@salvia> (raw)
In-Reply-To: <CAAPqxJwz30Lw5uaF05D=yBxeQ7p_O7EsTEMom1LavERYHgbT5w@mail.gmail.com>

On Sun, Nov 15, 2015 at 04:16:06PM +0530, Pankaj Yadav wrote:
> I am trying to make a DNAT port map using nftables
> 
> flush table ip nat
> table ip nat {
>         chain prerouting {
>                 type nat hook prerouting priority 0; policy accept;
>                 dnat tcp dport map { 10737 : 62.210.105.235:8080,
> 10738 : 62.210.105.257:8081 }
>         }
> 
>         chain postrouting {
>                 type nat hook postrouting priority 0; policy accept;
>                 masquerade
>         }
> }
> 
> but this ruleset produces error: Error: syntax error, unexpected
> colon, expecting comma or '}'
> 
> What should be the correct syntax if i want to change destport also
> corresponding to IPTABLE's (-j DNAT --to 62.210.105.235:8080 ) ?
> I have tried several combinations but none works and Google also didnt
> help much.Please help me .

Have a look at:

http://wiki.nftables.org/wiki-nftables/index.php/Multiple_NATs_using_nftables_maps

      reply	other threads:[~2015-11-16 10:39 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-15 10:46 nftables DNAT change destport Pankaj Yadav
2015-11-16 10:39 ` Pablo Neira Ayuso [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20151116103937.GA2907@salvia \
    --to=pablo@netfilter.org \
    --cc=netfilter@vger.kernel.org \
    --cc=pankajdnapster@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox