From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Martin A. Brown" Date: Wed, 20 Nov 2002 19:46:09 +0000 Subject: Re: [LARTC] reset rules ? Message-Id: List-Id: References: In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable To: lartc@vger.kernel.org Yes, I rarely use "all", but have used it for NAT rules in the past. Here's a snippet I've used for NAT rules, you'll need to fix it to handle=20 all rules, but I'll leave that as an exercise to you: ip rule show | grep map-to | while read PRIO NATRULE; do ip rule del prio ${PRIO%%:*} $( echo $NATRULE | sed 's|all|0/0|' ) done If you wish to see the entire script, check out: script file: http://plorf.net/linux-ip/html/scripts/nat config file: http://plorf.net/linux-ip/html/scripts/static-nat Good luck, -Martin On Wed, 20 Nov 2002, fabio wrote: : Thank you Martin, but an other thing how delete this type of rule : : 32761: from all to 172.18.200.6 lookup main :=20 : When I try with your script and the command : ip rule del from all to=20 : 172.18.200.6 lookup main : the result is the same : Error: an inet prefix is expected rather than = : "all" : thks :=20 : Fabio : =20 : Martin A. Brown a =E9crit: :=20 : >Fabio, : > : >I use a short snippet of shell to do it: : > : ># ip rule show | grep -Ev '^(0|3276(6|7)):' \ : > =20 : > : >> | while read PRIO RULE ; do \ : >> ip rule del prio ${PRIO%:} $RULE : >> done : >> =20 : >> : > : >I'm not aware of a more elegant way to do this. Anybody else? : > : >-Martin : > : >On Tue, 19 Nov 2002, fabio wrote: : > : > : Dear All : > : Do you know if its possible to reset the rule with a single command= or=20 : > : if I must delete manually all the rule ? : > : thanks : > :=20 : > : Fabien : > :=20 : > : _______________________________________________ : > : LARTC mailing list / LARTC@mailman.ds9a.nl : > : http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.or= g/ : > :=20 : > : > =20 : > :=20 :=20 --=20 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/