Köra iptables script i shorewall?
jag kör för närvarande shorewall på en burk och varken orkar eller vill skrota användandet av shorewall.
Men dilemmat är att jag skulle vilja köra ett iptables script utöver de regler jag redan konfigurerat i shorewall.
Det script jag vill köra är det nedan som någon hade skrivit här på swec då jag inte hittar något bra alternativ på hur man kan skriva något sådant i shorewall.
iptables -A INPUT -p tcp -m state --state NEW --dport 22 -m recent --update --seconds 60 --hitcount 3 --rttl -j DROP
iptables -A INPUT -p tcp -m state --state NEW --dport 22 -m recent --set -j ACCEPT
Har läst lite av dokumentationen men inte riktigt förstått hur man ska göra..
You can place these commands in one of the Shorewall Extension Scripts. Be sure that you look at the contents of the chain(s) that you will be modifying with your commands to be sure that the commands will do what they are intended. Many iptables commands published in HOWTOs and other instructional material use the -A command which adds the rules to the end of the chain. Most chains that Shorewall constructs end with an unconditional DROP, ACCEPT or REJECT rule and any rules that you add after that will be ignored. Check “man iptables” and look at the -I (--insert) command.
http://www.shorewall.net/2.0/shorewall_extension_scripts.htm är länken till extension scripts...
som jag förstår det kan jag skapa filen "start" i /etc/shorewall/ och skriva in iptables scriptet men byta ut -A mot -I (med kanske en siffra typ 1 eller 2 för vilken ordning den ska ha?) eller har jag fattat helt fel? eller kommer få några andra problem med att göra detta?
kör shorewall 2.x
-------------------------------------------------------------
fixade det själv om någon skulle söka upp tråden så är det bara skapa en fil "start" i /etc/shorewall/
iptables -I [kedjenamn] [position] -p tcp -m state --state NEW --dport 22 -m recent --update --seconds 60 --hitcount 3 --rttl -j DROP
iptables -I [kedjenamn] [position] -p tcp -m state --state NEW --dport 22 -m recent --set -j ACCEPT
inte så svårt mao...