Hi all,

Another Debian Etch fan here, running shorewall (shell) 3.2.6-2 (and Yes I'm 
going to upgrade when Lenny goes stable).

I already have the SSHKnock working, as documented on the website:
http://www.shorewall.net/PortKnocking.html

Thanks, works great!

In addition to the knock to open 22, I want to also ADD a redirect, from 2222 
to 22 on an internal box.  So, when I knock on 1600 (example), I want the 
firewall to BOTH open 22 on the firewall, AND redirect 2222 to 22 on internal 
box.

I think I have it figured out, but since it's a live firewall, I don't want to 
start mucking with it (and no I'm not really using port 1600 for the knock, I 
did change it!).

I think this is what I need, did I get it right?


/etc/shorewall/SSHKnock

if [ -n "$LEVEL" ]; then
    log_rule_limit $LEVEL $CHAIN SSHKnock ACCEPT "" "$TAG" -A -p tcp --dport 22 
  -m recent --rcheck --name SSH
    log_rule_limit $LEVEL $CHAIN SSHKnock ACCEPT "" "$TAG" -A -p tcp --dport 
2222   -m recent --rcheck --name SSH
    log_rule_limit $LEVEL $CHAIN SSHKnock DROP   "" "$TAG" -A -p tcp --dport ! 
22
fi
run_iptables -A $CHAIN -p tcp --dport 22   -m recent --rcheck --seconds 60 
--name SSH          -j ACCEPT
run_iptables -A $CHAIN -p tcp --dport 1599 -m recent                       
--name SSH --remove -j DROP
run_iptables -A $CHAIN -p tcp --dport 1600 -m recent                       
--name SSH --set    -j DROP
run_iptables -A $CHAIN -p tcp --dport 1601 -m recent                       
--name SSH --remove -j DROP
 
(the above log_rule_limit for --dport ! 22 concerns me)


/etc/shorewall/rules

#ACTION          SOURCE            DEST            PROTO       DEST PORT(S)  
SOURCE      ORIGINAL
#                                                                            
PORT(S)     DEST
DNAT-            net               loc:192.168.1.5 tcp         2222          22 
         a.b.c.d
SSHKnock         net               $FW             tcp         22,1599,1600,1601
SSHKnock         net               loc:192.168.1.5 tcp         2222          22 
         a.b.c.d

(and use my WAN IP for a.b.c.d)


In case you are wondering why I want to open two ports with one knock, instead 
of creating another knock setup, I want one knock to open both to simplify 
things, so I can ssh into both the firewall and my desktop from home via one 
knock.

btw Thanks Tom for all the awesome work you continue to do for us, I am very 
grateful!

Regards,

Daryl



      

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Shorewall-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/shorewall-users

Reply via email to