From: "Chris Bennett" Date: Tue, 23 Nov 2004 20:23:20 +0000 Subject: Re: [LARTC] how to remove rules Message-Id: <000a01c4d19a$4664b3b0$7502080a@CEBNC6000> List-Id: References: In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: lartc@vger.kernel.org Cool, thanks. I've never been too good at "complex" scripting myself (I have a mental block of seeing all complex scripting as inelegant and sub-optimal by nature, so I understand your comment about "inelegance"), but I see exactly what you're doing, and it seems about as elegant as possible with a script. Very nice. That goes right into my routing script. Chris ----- Original Message ----- From: "Martin A. Brown" To: "Chris Bennett" Cc: Sent: Tuesday, November 23, 2004 1:30 PM Subject: Re: [LARTC] how to remove rules > Hello all! > > : I've had the same problem. I sorta wish there was an "ip rule flush" > : command that would leave only the default rules. > > I have a function called "flush" which flushes all tables and all rules > other than the main routing table. Here's the "rule" flush portion. It > won't win any points for elegance, but it should get the job done: > > ip rule show | grep -Ev '^(0|32766|32767):' \ > | while read PRIO RULE; do > ip rule del prio ${PRIO%%:*} $( echo $RULE | sed 's|all|0/0|' ) > done > > -Martin > > -- > Martin A. Brown --- SecurePipe, Inc. --- mabrown@securepipe.com > > _______________________________________________ > LARTC mailing list / LARTC@mailman.ds9a.nl > http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/ > _______________________________________________ LARTC mailing list / LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/