LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 02-07-2020, 02:31 AM   #1
kalicatzaros
LQ Newbie
 
Registered: Feb 2020
Posts: 1

Rep: Reputation: Disabled
Iptables rule with hashlimit and NAT doesn't work


Hello all,

I'm trying to create a PREROUTING rule in order to re-direct the traffic to another port based on hashlimit.

This works fine and redirect everything from port 53 to 1053.

Code:
iptables -I PREROUTING -t nat -p udp --src 0/0 --dport 53 -j DNAT --to-destination 10.0.2.4:1053
This using hashlimit seems to work (burst needs some tuning but still is doing what it has to do):

Code:
iptables -I PREROUTING -t raw -p udp --dport 53 -m hashlimit --hashlimit-mode srcip --hashlimit-srcmask 32 --hashlimit-above 100/second --hashlimit-burst 1 --hashlimit-name OL_Proc -j DROP
But the following doesn't work at all:

Code:
iptables -I PREROUTING -t nat -p udp --dport 53 -m hashlimit --hashlimit-mode srcip --hashlimit-srcmask 32 --hashlimit-above 100/second --hashlimit-burst 1 --hashlimit-name OL_Proc -j DNAT --to-destination 10.0.2.4:1053
Am I doing something wrong here?

Any comment/idea is more than welcome since i'm fighting days with this.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
IPTables hashlimit-above incorrect count Davisn23 Linux - Security 3 09-21-2016 02:56 PM
[SOLVED] iptables/ipset configuration with hashlimit/limit not behaving properly freeindy Linux - Security 1 03-06-2014 06:29 AM
NAT and NAT Server behind its own NAT(private network) zeusys Linux - Networking 1 06-08-2011 06:22 PM
IPTables (connLimit vs hashlimit) nanogoo Linux - Security 3 01-24-2011 04:51 AM
Netfilter hashlimit match not working in 2.6.36.2? Third of Five Linux - Networking 0 12-10-2010 04:21 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 10:24 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration