This repository was archived by the owner on Jan 15, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +33
-1
lines changed Expand file tree Collapse file tree 2 files changed +33
-1
lines changed Original file line number Diff line number Diff line change @@ -100,6 +100,36 @@ By default rules are added to the filter table but the nat and mangle tables are
100
100
rule "-p tcp -o eth0 -d 10/8 --jump REJECT --reject-with tcp-reset"
101
101
end
102
102
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
+
103
133
` simple_iptables_policy ` Resource
104
134
---------------------------------
105
135
@@ -265,6 +295,8 @@ Which results in the following iptables configuration:
265
295
Changes
266
296
=======
267
297
298
+ * 0.6.1 (April 14, 2014)
299
+ * Add support mechanism weights.
268
300
* 0.6.0 (March 19, 2014)
269
301
* Add support for the raw table (#33 - Ray Ruvinskiy)
270
302
* Add : delete semantics to iptables rules (#34 - Michael Parrott)
Original file line number Diff line number Diff line change 29
29
},
30
30
"recipes" : {
31
31
},
32
- "version" : " 0.6.0 "
32
+ "version" : " 0.6.1 "
33
33
}
You can’t perform that action at this time.
0 commit comments