From: "Joe Patterson" <jpatterson@asgardgroup.com>
To: lee@ricis.com, netfilter@lists.samba.org
Subject: RE: Dynamicly Updating Rules
Date: Thu, 27 Jun 2002 14:50:34 -0400 [thread overview]
Message-ID: <NJEFLNJDIFFNMHDEBKMJIEIPDOAA.jpatterson@asgardgroup.com> (raw)
In-Reply-To: <200206271331.09893.lee@ricis.com>
I came up with an interesting method for doing this recently. I haven't
tried it out yet, and it may or may not work for you, but the general method
would be something like:
$IPT -A INPUT -p tcp --tcp-flags ALL SYN,ACK -m state --state ESTABLISHED -m
recent --name validconn --set
$IPT -A INPUT -m recent --name validconn -rcheck --seconds 20 -p tcp --dport
113 -j REJECT --reject-with tcp-reset
with rules specifically for what you want being something more like:
$IPT -A INPUT -p tcp --tcp-flags ALL SYN,ACK -m state --state ESTABLISHED -m
recent --name validconn --set -p tcp --sport 22 -s $SERVER_IP
$IPT -A INPUT -m recent --name validconn -rcheck --seconds 20 -p tcp --dport
113 -j ACCEPT
It's not exactly what you're asking for, but it's fairly close. Whenever
you make a tcp connection to port 22 on the server, it'll open up port 113
from that server for the next 20 seconds. (20 seconds was chosen randomly,
put whatever value you want there.)
If you try it and it works, let me know.
-Joe
> -----Original Message-----
> From: netfilter-admin@lists.samba.org
> [mailto:netfilter-admin@lists.samba.org]On Behalf Of Lee Leahu
> Sent: Thursday, June 27, 2002 2:31 PM
> To: netfilter@lists.samba.org
> Subject: Dynamicly Updating Rules
>
>
> Is there a way to dynamically add and remove rules to an iptables
> live configuration?
>
> For example:
>
> I have a server and a workstion. the workstation is locked down
> tightly. I would like for
> when i ssh to a remote server, that iptables automatically opens
> the ident port on the workstation
> to that remote server, and after a connection is made, to
> automatically close it back up again.
>
> Is this possible???
>
> --
> Lee Leahu
> Internet Technologies Specialist
> RICIS, Inc.
>
> email--> lee@ricis.com
> voice--> 708-444-2690
> fax--> 708-444-2697
>
>
>
>
prev parent reply other threads:[~2002-06-27 18:50 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-06-27 18:31 Dynamicly Updating Rules Lee Leahu
2002-06-27 18:26 ` Doug Monroe
2002-06-27 18:30 ` Dynamically " Antony Stone
2002-06-27 18:35 ` Dynamicly " Patrick Schaaf
2002-06-27 18:50 ` Joe Patterson [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=NJEFLNJDIFFNMHDEBKMJIEIPDOAA.jpatterson@asgardgroup.com \
--to=jpatterson@asgardgroup.com \
--cc=lee@ricis.com \
--cc=netfilter@lists.samba.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox