Re: how to do port forwarding using nftables map

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

 



great! it works, thanks.

2015-09-22 4:03 GMT+08:00 Pablo Neira Ayuso <pablo@xxxxxxxxxxxxx>:
> On Mon, Sep 21, 2015 at 11:30:54PM +0800, 神楽坂玲奈 wrote:
>> iptables -t nat -A PREROUTING -p tcp --dport 1000 -j DNAT
>> --to-destination 1.1.1.1:1234
>> iptables -t nat -A PREROUTING -p tcp --dport 1001 -j DNAT
>> --to-destination 1.1.1.1:2222
>> iptables -t nat -A PREROUTING -p tcp --dport 1002 -j DNAT
>> --to-destination 2.2.1.1:1234
>> iptables -t nat -A PREROUTING -p tcp --dport 1234 -j DNAT
>> --to-destination 1.1.1.1:1234
>> iptables -t nat -A PREROUTING -p udp --dport 1000 -j DNAT
>> --to-destination 1.1.1.1:1234
>> iptables -t nat -A PREROUTING -p udp --dport 2000 -j DNAT
>> --to-destination 8.8.8.8:53
>> iptables -t nat -A PREROUTING -p tcp --dport 3000 -j DNAT
>> --to-destination 2.2.2.21234
>> (many of these)
>
> nft add rule nat prerouting dnat \
>         tcp dport map { 1000 : 1.1.1.1, 2000 : 1.1.1.1 } : tcp dport map { 1000 : 1234, 1001 : 2222 }
--
To unsubscribe from this list: send the line "unsubscribe netfilter" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[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