top level rules
Is there any way to insert a new rule at the top of a table...
For instance, I have rules...
RULE 1
RULE 2
RULE 3
RULE 4
in order... but what if I want to place a rule before rule 1? Is that possible?
Thanks,
-Patrick
Quoted 11 lines · Patrick Ahler
Is there any way to insert a new rule at the top of a table...
For instance, I have rules...
RULE 1
RULE 2
RULE 3
RULE 4in order... but what if I want to place a rule before rule 1? Is that possible?
Yes, just use the -I (insert) option of iptablesinstead of -A (append).
Regards,
Filip
From the netfilter help (iptables --help)
"
--insert -I chain [rulenum]
Insert in chain as rulenum (default
1=first)
"
So ... iptable -I instead of iptables -A ....
Quoted 16 lines · Patrick Ahler
Is there any way to insert a new rule at the top of a table...
For instance, I have rules...
RULE 1
RULE 2
RULE 3
RULE 4in order... but what if I want to place a rule before rule 1? Is that possible?
Thanks,
-Patrick
Quoted 1 line
Is there any way to insert a new rule at the top of a table...
iptables -I INPUT 1 ...
See : man iptables.
Gr,
Rob
Quoted 9 lines · Patrick Ahler
Is there any way to insert a new rule at the top of a table...
For instance, I have rules...
RULE 1
RULE 2
RULE 3
RULE 4
Quoted 4 lines
in order... but what if I want to place a rule before rule 1? Is that possible?
Thanks,
-Patrick
/sbin/iptables -I <table> 1........
you can substitute the number for any position in the table: 2, 3 4 etc etc.
cheers
Zander
iptables -L -n --line0numbers will list the rule numbers iptables -I CHAINNAME rulenumber_to_insert REST OF RULE
----- Original Message -----
From: "Filip Sneppe" <[email protected]>
To: "Patrick Ahler" <[email protected]>
Cc: "netfilter EMAIL" <[email protected]>
Sent: Monday, May 12, 2003 8:49 AM
Subject: Re: top level rules
Quoted 21 lines · Patrick Ahler
Quoted 11 lines
Is there any way to insert a new rule at the top of a table...
For instance, I have rules...
RULE 1
RULE 2
RULE 3
RULE 4in order... but what if I want to place a rule before rule 1? Is that possible?
Yes, just use the -I (insert) option of iptablesinstead of -A (append).
Regards,
Filip