--------------080902080307010704020902
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 8bit
Thank you Martin, but an other thing how delete this type of rule :
32761: from all to 172.18.200.6 lookup main
When I try with your script and the command : ip rule del from all to
172.18.200.6 lookup main
the result is the same : Error: an inet prefix is expected rather than
"all"
thks
Fabio
Martin A. Brown a écrit:
>Fabio,
>
>I use a short snippet of shell to do it:
>
># ip rule show | grep -Ev '^(0|3276(6|7)):' \
>
>
>> | while read PRIO RULE ; do \
>> ip rule del prio ${PRIO%:} $RULE
>> done
>>
>>
>
>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
> : if I must delete manually all the rule ?
> : thanks
> :
> : Fabien
> :
> : _______________________________________________
> : LARTC mailing list / LARTC@mailman.ds9a.nl
> : http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
> :
>
>
>
--------------080902080307010704020902
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type"
content="text/html;charset=ISO-8859-1">
<title></title>
</head>
<body>
Thank you Martin, but an other thing how delete this type of rule :<br>
32761: from all to 172.18.200.6 lookup main<br>
<br>
When I try with your script and the command :<b> ip rule del
from all to
172.18.200.6 lookup main</b><br>
the result is the same : <b>Error: an inet prefix is expected
rather than
"all"</b><br>
thks<br>
<br>
Fabio<br>
<br>
Martin A. Brown a écrit:<br>
<blockquote type="cite"
cite="midPine.LNX.4.44.0211191600290.25259-100000@gargoyle.wi.securepipe.com">
<pre wrap="">Fabio,
I use a short snippet of shell to do it:
# ip rule show | grep -Ev '^(0|3276(6|7)):' \
</pre>
<blockquote type="cite">
<pre wrap=""> | while read PRIO RULE ; do \
ip rule del prio ${PRIO%:} $RULE
done
</pre>
</blockquote>
<pre wrap=""><!---->
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
: if I must delete manually all the rule ?
: thanks
:
: Fabien
:
: _______________________________________________
: LARTC mailing list / <a class="moz-txt-link-abbreviated"
href="mailto:LARTC@mailman.ds9a.nl">LARTC@mailman.ds9a.nl</a>
: <a class="moz-txt-link-freetext"
href="http://mailman.ds9a.nl/mailman/listinfo/lartc">http://mailman.ds9a.nl/mailman/listinfo/lartc</a>
HOWTO: <a class="moz-txt-link-freetext"
href="http://lartc.org/">http://lartc.org/</a>
:
</pre>
</blockquote>
<br>
</body>
</html>
--------------080902080307010704020902--
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
all rules, but I'll leave that as an exercise to you:
<snip>
ip rule show | grep map-to | while read PRIO NATRULE; do
ip rule del prio ${PRIO%%:*} $( echo $NATRULE | sed 's|all|0/0|' )
done
</snip>
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
:
: When I try with your script and the command : ip rule del from all to
: 172.18.200.6 lookup main
: the result is the same : Error: an inet prefix is expected rather than
: "all"
: thks
:
: Fabio
:
: Martin A. Brown a écrit:
:
: >Fabio,
: >
: >I use a short snippet of shell to do it:
: >
: ># ip rule show | grep -Ev '^(0|3276(6|7)):' \
: >
: >
: >> | while read PRIO RULE ; do \
: >> ip rule del prio ${PRIO%:} $RULE
: >> done
: >>
: >>
: >
: >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
: > : if I must delete manually all the rule ?
: > : thanks
: > :
: > : Fabien
: > :
: > : _______________________________________________
: > : LARTC mailing list / LARTC@mailman.ds9a.nl
: > : http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
: > :
: >
: >
: >
:
:
--
Martin A. Brown --- SecurePipe, Inc. --- mabrown@securepipe.com