Linux Netfilter discussions
 help / color / mirror / Atom feed
From: Brad Knorr <bradley@knorrfamily.org>
To: netfilter@vger.kernel.org
Subject: Need help
Date: Mon, 25 Oct 2021 21:53:13 -0700	[thread overview]
Message-ID: <dc004311d37bb7332b649c4973b0cbed@mail.gmail.com> (raw)

I am new to nft commands.  I wish to use the map feature for port
forwarding.  What I want to achieve is the following

Sftp  incoming  to port 2222 on the public IP to be port forwarded to
private IP on port 22.  So what I found in the docs is this.

% nft add map nat foo { type inet_service : ipv4_addr . inet_service \; }

% nft add element nat foo { \
    1100 : 192.168.1.2 . 5061, \
    1101 : 192.168.1.3 . 5061, \
    1400 : 192.168.1.4 . 5061 \
}
% nft add rule nat pre ip protocol tcp dnat ip addr . port to tcp dport
map @foo


So when I issue the first command I get the following error:
Error: unqualified mapping data type specified in map definition

When I issue the command:  nft add map nat foo { type inet_service :
ipv4_addr \; }

It works just fine.  I am at a loss as to why this is happening.  The
reason I need the mapping is I need to add and remove port forwarding
rules easily with a simple command.

Any help would be greatly appreciated.
Brad

             reply	other threads:[~2021-10-26  4:53 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-26  4:53 Brad Knorr [this message]
2021-10-26  7:14 ` Need help Daniel
  -- strict thread matches above, loose matches on Subject: below --
2004-04-16 19:17 need help Khanh Tran
2004-04-16 18:28 Matt Robineau
2004-04-16 19:26 ` Antony Stone
2003-04-29 10:21 Karthik RC
2003-04-29  6:43 ` hare ram
2003-04-29  7:35 ` Julius Wijaya
2003-04-29  9:27 ` Maciej Soltysiak
2002-09-27 11:08 Need Help Mohammad Shakir
2002-09-29 22:26 ` Davide
2002-09-29 22:40   ` Antony Stone

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=dc004311d37bb7332b649c4973b0cbed@mail.gmail.com \
    --to=bradley@knorrfamily.org \
    --cc=netfilter@vger.kernel.org \
    /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