Skip to content
This repository was archived by the owner on Jan 15, 2025. It is now read-only.

Commit eb6bcda

Browse files
committed
Change README.md file
1 parent 5019202 commit eb6bcda

File tree

2 files changed

+33
-1
lines changed

2 files changed

+33
-1
lines changed

README.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,36 @@ By default rules are added to the filter table but the nat and mangle tables are
100100
rule "-p tcp -o eth0 -d 10/8 --jump REJECT --reject-with tcp-reset"
101101
end
102102

103+
By default rules are added to the chain, in the order in which its occur in the recipes.
104+
You may use the weight parameter for control the order of the rules in chains. For example:
105+
106+
simple_iptables_rule "reject" do
107+
chain "INPUT"
108+
rule ""
109+
jump "REJECT --reject-with icmp-host-prohibited"
110+
weight 90
111+
end
112+
113+
simple_iptables_rule "established" do
114+
chain "INPUT"
115+
rule "-m conntrack --ctstate ESTABLISHED,RELATED"
116+
jump "ACCEPT"
117+
weight 1
118+
end
119+
120+
simple_iptables_rule "icmp" do
121+
chain "INPUT"
122+
rule "--proto icmp"
123+
jump "ACCEPT"
124+
weight 2
125+
end
126+
127+
This would generate the rules:
128+
-A INPUT --jump ACCEPT -m conntrack --ctstate ESTABLISHED,RELATED
129+
-A INPUT --jump ACCEPT --proto icmp
130+
-A INPUT --jump REJECT --reject-with icmp-host-prohibited
131+
132+
103133
`simple_iptables_policy` Resource
104134
---------------------------------
105135

@@ -265,6 +295,8 @@ Which results in the following iptables configuration:
265295
Changes
266296
=======
267297

298+
* 0.6.1 (April 14, 2014)
299+
* Add support mechanism weights.
268300
* 0.6.0 (March 19, 2014)
269301
* Add support for the raw table (#33 - Ray Ruvinskiy)
270302
* Add :delete semantics to iptables rules (#34 - Michael Parrott)

metadata.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,5 @@
2929
},
3030
"recipes": {
3131
},
32-
"version": "0.6.0"
32+
"version": "0.6.1"
3333
}

0 commit comments

Comments
 (0)