Need help

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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



[Index of Archives]     [Linux Netfilter Development]     [Linux Kernel Networking Development]     [Netem]     [Berkeley Packet Filter]     [Linux Kernel Development]     [Advanced Routing & Traffice Control]     [Bugtraq]

  Powered by Linux