Linux Netfilter discussions
 help / color / mirror / Atom feed
From: Martin Tomasek <mtd@mk.cvut.cz>
To: Pavel Mores <pvl@uh.cz>, netfilter@lists.samba.org
Subject: Re: how to delete *some* netfilter rules?
Date: Fri, 5 Jul 2002 15:57:43 +0200	[thread overview]
Message-ID: <20020705135743.GB4851@mt.mk.cvut.cz> (raw)
In-Reply-To: <02070513492203.14428@Lms>

[-- Attachment #1: Type: text/plain, Size: 833 bytes --]

using iptables without full path is insecure, I would modify this script
this way:

> Your bash script could look like this:
> 
> #!/bin/bash
+IPT=/usr/sbin/iptables
> 
-> ADD=-A
+ADD="$IPT -A"
-> INS=-I
+INS="$IPT -I"
> 
> if [ -n "$1" ]; then
> 	if [  "$1" != "delete" ]; then
> 		echo usage: $0 [delete]
> 		exit 1
> 	fi

these two too:
> 	ADD=-D
> 	INS=-D

> fi
> 
> #examples:
-> iptables $ADD INPUT -i eth0 10.0.0.0/8 -j DROP
+$ADD INPUT -i eth0 10.0.0.0/8 -j DROP
-> iptables $INS OUTPUT -i eth0 192.168.0.0/16 -j DROP
+$INS OUTPUT -i eth0 192.168.0.0/16 -j DROP
> 

there is other way of rules deletion:

iptables -D chain num

where num is rule number in chain. in some cases it is better to
use this command.

-- 
Martin Tomasek, mtd@email.cz
BOFH excuse #27:
radiosity depletion

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

      reply	other threads:[~2002-07-05 13:57 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-06-14 16:18 how to delete *some* netfilter rules? Pavel Mores
2002-07-05 11:49 ` Jan Humme
2002-07-05 13:57   ` Martin Tomasek [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=20020705135743.GB4851@mt.mk.cvut.cz \
    --to=mtd@mk.cvut.cz \
    --cc=netfilter@lists.samba.org \
    --cc=pvl@uh.cz \
    /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