},
},
'long_rule_1' => {
- :line => '-A INPUT -s 1.1.1.1/32 -d 1.1.1.1/32 -p tcp -m multiport --dports 7061,7062 -m multiport --sports 7061,7062 -m comment --comment "000 allow foo" -j ACCEPT',
+ :line => '-A INPUT -s 1.1.1.1/32 -d 1.1.1.1/32 -p tcp -m multiport --dports 7061,7062 -m multiport --sports 7061,7062 -j ACCEPT -m comment --comment "000 allow foo"',
:table => 'filter',
:compare_all => true,
:params => {
:destination => "1.1.1.1/32",
:dport => ["7061","7062"],
:ensure => :present,
- :line => '-A INPUT -s 1.1.1.1/32 -d 1.1.1.1/32 -p tcp -m multiport --dports 7061,7062 -m multiport --sports 7061,7062 -m comment --comment "000 allow foo" -j ACCEPT',
+ :line => '-A INPUT -s 1.1.1.1/32 -d 1.1.1.1/32 -p tcp -m multiport --dports 7061,7062 -m multiport --sports 7061,7062 -j ACCEPT -m comment --comment "000 allow foo"',
:name => "000 allow foo",
:proto => "tcp",
:provider => "iptables",
},
},
'action_drop_1' => {
- :line => '-A INPUT -m comment --comment "000 allow foo" -j DROP',
+ :line => '-A INPUT -j DROP -m comment --comment "000 allow foo"',
:table => 'filter',
:params => {
:jump => nil,
},
},
'action_reject_1' => {
- :line => '-A INPUT -m comment --comment "000 allow foo" -j REJECT',
+ :line => '-A INPUT -j REJECT -m comment --comment "000 allow foo"',
:table => 'filter',
:params => {
:jump => nil,
},
},
'jump_custom_chain_1' => {
- :line => '-A INPUT -m comment --comment "000 allow foo" -j custom_chain',
+ :line => '-A INPUT -j custom_chain -m comment --comment "000 allow foo"',
:table => 'filter',
:params => {
:jump => "custom_chain",
},
},
'log_level_debug' => {
- :line => '-A INPUT -m comment --comment "956 INPUT log-level" -m state --state NEW -j LOG --log-level 7',
+ :line => '-A INPUT -m state --state NEW -j LOG --log-level 7 -m comment --comment "956 INPUT log-level"',
:table => 'filter',
:params => {
:state => ['NEW'],
},
},
'log_level_warn' => {
- :line => '-A INPUT -m comment --comment "956 INPUT log-level" -m state --state NEW -j LOG',
+ :line => '-A INPUT -m state --state NEW -j LOG -m comment --comment "956 INPUT log-level"',
:table => 'filter',
:params => {
:state => ['NEW'],
},
},
'load_limit_module_and_implicit_burst' => {
- :line => '-A INPUT -m multiport --dports 123 -m comment --comment "057 INPUT limit NTP" -m limit --limit 15/hour',
+ :line => '-A INPUT -m multiport --dports 123 -m limit --limit 15/hour -m comment --comment "057 INPUT limit NTP"',
:table => 'filter',
:params => {
:dport => ['123'],
},
},
'limit_with_explicit_burst' => {
- :line => '-A INPUT -m multiport --dports 123 -m comment --comment "057 INPUT limit NTP" -m limit --limit 30/hour --limit-burst 10',
+ :line => '-A INPUT -m multiport --dports 123 -m limit --limit 30/hour --limit-burst 10 -m comment --comment "057 INPUT limit NTP"',
:table => 'filter',
:params => {
:dport => ['123'],
}
},
'load_uid_owner_filter_module' => {
- :line => '-A OUTPUT -m owner --uid-owner root -m comment --comment "057 OUTPUT uid root only" -j ACCEPT',
+ :line => '-A OUTPUT -m owner --uid-owner root -j ACCEPT -m comment --comment "057 OUTPUT uid root only"',
:table => 'filter',
:params => {
:action => 'accept',
},
},
'load_uid_owner_postrouting_module' => {
- :line => '-t mangle -A POSTROUTING -m owner --uid-owner root -m comment --comment "057 POSTROUTING uid root only" -j ACCEPT',
+ :line => '-t mangle -A POSTROUTING -m owner --uid-owner root -j ACCEPT -m comment --comment "057 POSTROUTING uid root only"',
:table => 'mangle',
:params => {
:action => 'accept',
},
},
'load_gid_owner_filter_module' => {
- :line => '-A OUTPUT -m owner --gid-owner root -m comment --comment "057 OUTPUT gid root only" -j ACCEPT',
+ :line => '-A OUTPUT -m owner --gid-owner root -j ACCEPT -m comment --comment "057 OUTPUT gid root only"',
:table => 'filter',
:params => {
:action => 'accept',
},
},
'load_gid_owner_postrouting_module' => {
- :line => '-t mangle -A POSTROUTING -m owner --gid-owner root -m comment --comment "057 POSTROUTING gid root only" -j ACCEPT',
+ :line => '-t mangle -A POSTROUTING -m owner --gid-owner root -j ACCEPT -m comment --comment "057 POSTROUTING gid root only"',
:table => 'mangle',
:params => {
:action => 'accept',
}
},
'iniface_1' => {
- :line => '-A INPUT -i eth0 -m comment --comment "060 iniface" -j DROP',
+ :line => '-A INPUT -i eth0 -j DROP -m comment --comment "060 iniface"',
:table => 'filter',
:params => {
:action => 'drop',
},
},
'iniface_1_negated' => {
- :line => '-A INPUT ! -i eth0 -m comment --comment "060 iniface" -j DROP',
+ :line => '-A INPUT ! -i eth0 -j DROP -m comment --comment "060 iniface"',
:table => 'filter',
:params => {
:action => 'drop',
},
},
'iniface_1_aliased' => {
- :line => '-A INPUT -i eth0:1 -m comment --comment "060 iniface" -j DROP',
+ :line => '-A INPUT -i eth0:1 -j DROP -m comment --comment "060 iniface"',
:table => 'filter',
:params => {
:action => 'drop',
},
},
'iniface_with_vlans_1' => {
- :line => '-A INPUT -i eth0.234 -m comment --comment "060 iniface" -j DROP',
+ :line => '-A INPUT -i eth0.234 -j DROP -m comment --comment "060 iniface"',
:table => 'filter',
:params => {
:action => 'drop',
},
},
'iniface_with_plus_1' => {
- :line => '-A INPUT -i eth+ -m comment --comment "060 iniface" -j DROP',
+ :line => '-A INPUT -i eth+ -j DROP -m comment --comment "060 iniface"',
:table => 'filter',
:params => {
:action => 'drop',
},
},
'outiface_1' => {
- :line => '-A OUTPUT -o eth0 -m comment --comment "060 outiface" -j DROP',
+ :line => '-A OUTPUT -o eth0 -j DROP -m comment --comment "060 outiface"',
:table => 'filter',
:params => {
:action => 'drop',
},
},
'outiface_1_negated' => {
- :line => '-A OUTPUT ! -o eth0 -m comment --comment "060 outiface" -j DROP',
+ :line => '-A OUTPUT ! -o eth0 -j DROP -m comment --comment "060 outiface"',
:table => 'filter',
:params => {
:action => 'drop',
},
},
'outiface_1_aliased' => {
- :line => '-A OUTPUT -o eth0:2 -m comment --comment "060 outiface" -j DROP',
+ :line => '-A OUTPUT -o eth0:2 -j DROP -m comment --comment "060 outiface"',
:table => 'filter',
:params => {
:action => 'drop',
},
},
'outiface_with_vlans_1' => {
- :line => '-A OUTPUT -o eth0.234 -m comment --comment "060 outiface" -j DROP',
+ :line => '-A OUTPUT -o eth0.234 -j DROP -m comment --comment "060 outiface"',
:table => 'filter',
:params => {
:action => 'drop',
},
},
'outiface_with_plus_1' => {
- :line => '-A OUTPUT -o eth+ -m comment --comment "060 outiface" -j DROP',
+ :line => '-A OUTPUT -o eth+ -j DROP -m comment --comment "060 outiface"',
:table => 'filter',
:params => {
:action => 'drop',
},
},
'isfragment_option' => {
- :line => '-A INPUT -f -m comment --comment "010 a-f comment with dashf" -j ACCEPT',
+ :line => '-A INPUT -f -j ACCEPT -m comment --comment "010 a-f comment with dashf"',
:table => 'filter',
:params => {
:name => '010 a-f comment with dashf',
},
},
'connlimit_above' => {
- :line => '-A INPUT -p tcp -m multiport --dports 22 -m comment --comment "061 REJECT connlimit_above 10" -m connlimit --connlimit-above 10 --connlimit-mask 32 -j REJECT --reject-with icmp-port-unreachable',
+ :line => '-A INPUT -p tcp -m multiport --dports 22 -m connlimit --connlimit-above 10 --connlimit-mask 32 -j REJECT --reject-with icmp-port-unreachable -m comment --comment "061 REJECT connlimit_above 10"',
:table => 'filter',
:params => {
:proto => 'tcp',
},
},
'connlimit_above_with_connlimit_mask' => {
- :line => '-A INPUT -p tcp -m multiport --dports 22 -m comment --comment "061 REJECT connlimit_above 10 with mask 24" -m connlimit --connlimit-above 10 --connlimit-mask 24 -j REJECT --reject-with icmp-port-unreachable',
+ :line => '-A INPUT -p tcp -m multiport --dports 22 -m connlimit --connlimit-above 10 --connlimit-mask 24 -j REJECT --reject-with icmp-port-unreachable -m comment --comment "061 REJECT connlimit_above 10 with mask 24"',
:table => 'filter',
:params => {
:proto => 'tcp',
},
},
'connmark' => {
- :line => '-A INPUT -m comment --comment "062 REJECT connmark" -m connmark --mark 0x1 -j REJECT --reject-with icmp-port-unreachable',
+ :line => '-A INPUT -m connmark --mark 0x1 -j REJECT --reject-with icmp-port-unreachable -m comment --comment "062 REJECT connmark"',
:table => 'filter',
:params => {
:proto => 'all',
},
},
'disallow_esp_protocol' => {
- :line => '-t filter ! -p esp -m comment --comment "063 disallow esp protocol" -j ACCEPT',
+ :line => '-t filter ! -p esp -j ACCEPT -m comment --comment "063 disallow esp protocol"',
:table => 'filter',
:params => {
:name => '063 disallow esp protocol',
},
},
'drop_new_packets_without_syn' => {
- :line => '-t filter ! -s 10.0.0.0/8 ! -p tcp -m tcp ! --tcp-flags FIN,SYN,RST,ACK SYN -m comment --comment "064 drop NEW non-tcp external packets with FIN/RST/ACK set and SYN unset" -m state --state NEW -j DROP',
+ :line => '-t filter ! -s 10.0.0.0/8 ! -p tcp -m tcp ! --tcp-flags FIN,SYN,RST,ACK SYN -m state --state NEW -j DROP -m comment --comment "064 drop NEW non-tcp external packets with FIN/RST/ACK set and SYN unset"',
:table => 'filter',
:params => {
:name => '064 drop NEW non-tcp external packets with FIN/RST/ACK set and SYN unset',
},
},
'match_mark' => {
- :line => '-A INPUT -p tcp -m comment --comment "066 REJECT connlimit_above 10 with mask 32 and mark matches" -m mark --mark 0x1 -m connlimit --connlimit-above 10 --connlimit-mask 32 -j REJECT --reject-with icmp-port-unreachable',
+ :line => '-A INPUT -p tcp -m mark --mark 0x1 -m connlimit --connlimit-above 10 --connlimit-mask 32 -j REJECT --reject-with icmp-port-unreachable -m comment --comment "066 REJECT connlimit_above 10 with mask 32 and mark matches"',
:table => 'filter',
:params => {
:proto => 'tcp',
},
},
'clamp_mss_to_pmtu' => {
- :line => '-A INPUT -p tcp -m tcp --tcp-flags SYN,RST SYN -m comment --comment "067 change max segment size" -j TCPMSS --clamp-mss-to-pmtu',
+ :line => '-A INPUT -p tcp -m tcp --tcp-flags SYN,RST SYN -j TCPMSS --clamp-mss-to-pmtu -m comment --comment "067 change max segment size"',
:table => 'filter',
:params => {
:name => '067 change max segment size',
},
},
'mangled_chain_name_with_-f' => {
- :line => '-A foo-filter -p tcp -m comment --comment "068 chain name containing -f" -j ACCEPT',
+ :line => '-A foo-filter -p tcp -j ACCEPT -m comment --comment "068 chain name containing -f"',
:params => {
:name => '068 chain name containing -f',
:action => 'accept',
},
},
'nfqueue_jump1' => {
- :line => '-A INPUT -m tcp -p tcp -s 1.2.3.4/32 -d 4.3.2.1/32 -m comment --comment "000 nfqueue specify queue_num" -j NFQUEUE --queue-num 50',
+ :line => '-A INPUT -m tcp -p tcp -s 1.2.3.4/32 -d 4.3.2.1/32 -j NFQUEUE --queue-num 50 -m comment --comment "000 nfqueue specify queue_num"',
:table => 'filter',
:params => {
:name => "000 nfqueue specify queue_num",
},
},
'nfqueue_jump2' => {
- :line => '-A INPUT -m tcp -p tcp -s 1.2.3.4/32 -d 4.3.2.1/32 -m comment --comment "002 nfqueue specify queue_num and queue_bypass" -j NFQUEUE --queue-num 50 --queue-bypass',
+ :line => '-A INPUT -m tcp -p tcp -s 1.2.3.4/32 -d 4.3.2.1/32 -j NFQUEUE --queue-num 50 --queue-bypass -m comment --comment "002 nfqueue specify queue_num and queue_bypass"',
:table => "filter",
:params => {
:name => "002 nfqueue specify queue_num and queue_bypass",
},
},
'nfqueue_jump3' => {
- :line => '-A INPUT -m tcp -p tcp -s 1.2.3.4/32 -d 4.3.2.1/32 -m comment --comment "003 nfqueue dont specify queue_num or queue_bypass" -j NFQUEUE',
+ :line => '-A INPUT -m tcp -p tcp -s 1.2.3.4/32 -d 4.3.2.1/32 -j NFQUEUE -m comment --comment "003 nfqueue dont specify queue_num or queue_bypass"',
:table => "filter",
:params => {
:name => "003 nfqueue dont specify queue_num or queue_bypass",
:sport => ["7061","7062"],
:table => "filter",
},
- :args => ["-t", :filter, "-s", "1.1.1.1/32", "-d", "1.1.1.1/32", "-p", :tcp, "-m", "multiport", "--sports", "7061,7062", "-m", "multiport", "--dports", "7061,7062", "-m", "comment", "--comment", "000 allow foo", "-j", "ACCEPT"],
+ :args => ["-t", :filter, "-s", "1.1.1.1/32", "-d", "1.1.1.1/32", "-p", :tcp, "-m", "multiport", "--sports", "7061,7062", "-m", "multiport", "--dports", "7061,7062", "-j", "ACCEPT", "-m", "comment", "--comment", "000 allow foo"],
},
'long_rule_2' => {
:params => {
:sport => ["7061","7062"],
:table => "filter",
},
- :args => ["-t", :filter, "-s", "1.1.1.1/32", "-d", "2.10.13.0/24", "-p", :udp, "-m", "multiport", "--sports", "7061,7062", "-m", "multiport", "--dports", "7061", "-m", "comment", "--comment", "700 allow bar", "-j", "my_custom_chain"],
+ :args => ["-t", :filter, "-s", "1.1.1.1/32", "-d", "2.10.13.0/24", "-p", :udp, "-m", "multiport", "--sports", "7061,7062", "-m", "multiport", "--dports", "7061", "-j", "my_custom_chain", "-m", "comment", "--comment", "700 allow bar"],
},
'no_action' => {
:params => {
:table => "filter",
:state => ['ESTABLISHED', 'INVALID']
},
- :args => ["-t", :filter, "-p", :tcp, "-m", "comment", "--comment", "100 states_set_from_array",
- "-m", "state", "--state", "ESTABLISHED,INVALID"],
+ :args => ["-t", :filter, "-p", :tcp, "-m", "state", "--state", "ESTABLISHED,INVALID", "-m", "comment", "--comment", "100 states_set_from_array"],
},
'ctstates_set_from_array' => {
:params => {
:table => "filter",
:ctstate => ['ESTABLISHED', 'INVALID']
},
- :args => ["-t", :filter, "-p", :tcp, "-m", "comment", "--comment", "100 ctstates_set_from_array",
- "-m", "conntrack", "--ctstate", "ESTABLISHED,INVALID"],
+ :args => ["-t", :filter, "-p", :tcp, "-m", "conntrack", "--ctstate", "ESTABLISHED,INVALID", "-m", "comment", "--comment", "100 ctstates_set_from_array"],
},
'comment_string_character_validation' => {
:params => {
:jump => 'LOG',
:log_level => 'debug'
},
- :args => ['-t', :filter, '-p', :tcp, '-m', 'comment', '--comment', '956 INPUT log-level', '-m', 'state', '--state', 'NEW', '-j', 'LOG', '--log-level', '7'],
+ :args => ['-t', :filter, '-p', :tcp, '-m', 'state', '--state', 'NEW', '-j', 'LOG', '--log-level', '7', '-m', 'comment', '--comment', '956 INPUT log-level'],
},
'log_level_warn' => {
:params => {
:jump => 'LOG',
:log_level => 'warn'
},
- :args => ['-t', :filter, '-p', :tcp, '-m', 'comment', '--comment', '956 INPUT log-level', '-m', 'state', '--state', 'NEW', '-j', 'LOG', '--log-level', '4'],
+ :args => ['-t', :filter, '-p', :tcp, '-m', 'state', '--state', 'NEW', '-j', 'LOG', '--log-level', '4', '-m', 'comment', '--comment', '956 INPUT log-level'],
},
'load_limit_module_and_implicit_burst' => {
:params => {
:dport => '123',
:limit => '15/hour'
},
- :args => ['-t', :filter, '-p', :tcp, '-m', 'multiport', '--dports', '123', '-m', 'comment', '--comment', '057 INPUT limit NTP', '-m', 'limit', '--limit', '15/hour'],
+ :args => ['-t', :filter, '-p', :tcp, '-m', 'multiport', '--dports', '123', '-m', 'limit', '--limit', '15/hour', '-m', 'comment', '--comment', '057 INPUT limit NTP'],
},
'limit_with_explicit_burst' => {
:params => {
:limit => '30/hour',
:burst => '10'
},
- :args => ['-t', :filter, '-p', :tcp, '-m', 'multiport', '--dports', '123', '-m', 'comment', '--comment', '057 INPUT limit NTP', '-m', 'limit', '--limit', '30/hour', '--limit-burst', '10'],
+ :args => ['-t', :filter, '-p', :tcp, '-m', 'multiport', '--dports', '123', '-m', 'limit', '--limit', '30/hour', '--limit-burst', '10', '-m', 'comment', '--comment', '057 INPUT limit NTP'],
},
'proto_ipencap' => {
:params => {
:chain => 'OUTPUT',
:proto => 'all',
},
- :args => ['-t', :filter, '-p', :all, '-m', 'owner', '--uid-owner', 'root', '-m', 'comment', '--comment', '057 OUTPUT uid root only', '-j', 'ACCEPT'],
+ :args => ['-t', :filter, '-p', :all, '-m', 'owner', '--uid-owner', 'root', '-j', 'ACCEPT', '-m', 'comment', '--comment', '057 OUTPUT uid root only'],
},
'load_uid_owner_postrouting_module' => {
:params => {
:chain => 'POSTROUTING',
:proto => 'all',
},
- :args => ['-t', :mangle, '-p', :all, '-m', 'owner', '--uid-owner', 'root', '-m', 'comment', '--comment', '057 POSTROUTING uid root only', '-j', 'ACCEPT'],
+ :args => ['-t', :mangle, '-p', :all, '-m', 'owner', '--uid-owner', 'root', '-j', 'ACCEPT', '-m', 'comment', '--comment', '057 POSTROUTING uid root only'],
},
'load_gid_owner_filter_module' => {
:params => {
:action => 'accept',
:proto => 'all',
},
- :args => ['-t', :filter, '-p', :all, '-m', 'owner', '--gid-owner', 'root', '-m', 'comment', '--comment', '057 OUTPUT gid root only', '-j', 'ACCEPT'],
+ :args => ['-t', :filter, '-p', :all, '-m', 'owner', '--gid-owner', 'root', '-j', 'ACCEPT', '-m', 'comment', '--comment', '057 OUTPUT gid root only'],
},
'load_gid_owner_postrouting_module' => {
:params => {
:chain => 'POSTROUTING',
:proto => 'all',
},
- :args => ['-t', :mangle, '-p', :all, '-m', 'owner', '--gid-owner', 'root', '-m', 'comment', '--comment', '057 POSTROUTING gid root only', '-j', 'ACCEPT'],
+ :args => ['-t', :mangle, '-p', :all, '-m', 'owner', '--gid-owner', 'root', '-j', 'ACCEPT', '-m', 'comment', '--comment', '057 POSTROUTING gid root only'],
},
'mark_set-mark_int' => {
:params => {
:chain => 'PREROUTING',
:set_mark => '1000',
},
- :args => ['-t', :mangle, '-p', :tcp, '-m', 'comment', '--comment', '058 set-mark 1000', '-j', 'MARK', '--set-xmark', '0x3e8/0xffffffff'],
+ :args => ['-t', :mangle, '-p', :tcp, '-j', 'MARK', '--set-xmark', '0x3e8/0xffffffff', '-m', 'comment', '--comment', '058 set-mark 1000'],
},
'mark_set-mark_hex' => {
:params => {
:chain => 'PREROUTING',
:set_mark => '0x32',
},
- :args => ['-t', :mangle, '-p', :tcp, '-m', 'comment', '--comment', '058 set-mark 0x32', '-j', 'MARK', '--set-xmark', '0x32/0xffffffff'],
+ :args => ['-t', :mangle, '-p', :tcp, '-j', 'MARK', '--set-xmark', '0x32/0xffffffff', '-m', 'comment', '--comment', '058 set-mark 0x32'],
},
'mark_set-mark_hex_with_hex_mask' => {
:params => {
:chain => 'PREROUTING',
:set_mark => '0x32/0xffffffff',
},
- :args => ['-t', :mangle, '-p', :tcp, '-m', 'comment', '--comment', '058 set-mark 0x32/0xffffffff', '-j', 'MARK', '--set-xmark', '0x32/0xffffffff'],
+ :args => ['-t', :mangle, '-p', :tcp, '-j', 'MARK', '--set-xmark', '0x32/0xffffffff', '-m', 'comment', '--comment', '058 set-mark 0x32/0xffffffff'],
},
'mark_set-mark_hex_with_mask' => {
:params => {
:chain => 'PREROUTING',
:set_mark => '0x32/4',
},
- :args => ['-t', :mangle, '-p', :tcp, '-m', 'comment', '--comment', '058 set-mark 0x32/4', '-j', 'MARK', '--set-xmark', '0x32/0x4'],
+ :args => ['-t', :mangle, '-p', :tcp, '-j', 'MARK', '--set-xmark', '0x32/0x4', '-m', 'comment', '--comment', '058 set-mark 0x32/4'],
},
'iniface_1' => {
:params => {
:chain => 'INPUT',
:iniface => 'eth0',
},
- :args => ["-t", :filter, "-i", "eth0", "-p", :tcp, "-m", "comment", "--comment", "060 iniface", "-j", "DROP"],
+ :args => ["-t", :filter, "-i", "eth0", "-p", :tcp, "-j", "DROP", "-m", "comment", "--comment", "060 iniface"],
},
'iniface_with_vlans_1' => {
:params => {
:chain => 'INPUT',
:iniface => 'eth0.234',
},
- :args => ["-t", :filter, "-i", "eth0.234", "-p", :tcp, "-m", "comment", "--comment", "060 iniface", "-j", "DROP"],
+ :args => ["-t", :filter, "-i", "eth0.234", "-p", :tcp, "-j", "DROP", "-m", "comment", "--comment", "060 iniface"],
},
'iniface_with_plus_1' => {
:params => {
:chain => 'INPUT',
:iniface => 'eth+',
},
- :args => ["-t", :filter, "-i", "eth+", "-p", :tcp, "-m", "comment", "--comment", "060 iniface", "-j", "DROP"],
+ :args => ["-t", :filter, "-i", "eth+", "-p", :tcp, "-j", "DROP", "-m", "comment", "--comment", "060 iniface"],
},
'outiface_1' => {
:params => {
:chain => 'OUTPUT',
:outiface => 'eth0',
},
- :args => ["-t", :filter, "-o", "eth0", "-p", :tcp, "-m", "comment", "--comment", "060 outiface", "-j", "DROP"],
+ :args => ["-t", :filter, "-o", "eth0", "-p", :tcp, "-j", "DROP", "-m", "comment", "--comment", "060 outiface"],
},
'outiface_with_vlans_1' => {
:params => {
:chain => 'OUTPUT',
:outiface => 'eth0.234',
},
- :args => ["-t", :filter, "-o", "eth0.234", "-p", :tcp, "-m", "comment", "--comment", "060 outiface", "-j", "DROP"],
+ :args => ["-t", :filter, "-o", "eth0.234", "-p", :tcp, "-j", "DROP", "-m", "comment", "--comment", "060 outiface"],
},
'outiface_with_plus_1' => {
:params => {
:chain => 'OUTPUT',
:outiface => 'eth+',
},
- :args => ["-t", :filter, "-o", "eth+", "-p", :tcp, "-m", "comment", "--comment", "060 outiface", "-j", "DROP"],
+ :args => ["-t", :filter, "-o", "eth+", "-p", :tcp, "-j", "DROP", "-m", "comment", "--comment", "060 outiface"],
},
'pkttype multicast' => {
:params => {
:iniface => 'eth0',
:pkttype => 'multicast',
},
- :args => ["-t", :filter, "-i", "eth0", "-p", :tcp, "-m", "pkttype", "--pkt-type", :multicast, "-m", "comment", "--comment", "062 pkttype multicast", "-j", "ACCEPT"],
+ :args => ["-t", :filter, "-i", "eth0", "-p", :tcp, "-m", "pkttype", "--pkt-type", :multicast, "-j", "ACCEPT", "-m", "comment", "--comment", "062 pkttype multicast"],
},
'socket_option' => {
:params => {
:chain => 'PREROUTING',
:socket => true,
},
- :args => ['-t', :mangle, '-p', :tcp, '-m', 'socket', '-m', 'comment', '--comment', '050 socket option', '-j', 'ACCEPT'],
+ :args => ['-t', :mangle, '-p', :tcp, '-m', 'socket', '-j', 'ACCEPT', '-m', 'comment', '--comment', '050 socket option'],
},
'isfragment_option' => {
:params => {
:action => 'accept',
:isfragment => true,
},
- :args => ['-t', :filter, '-p', :all, '-f', '-m', 'comment', '--comment', '050 isfragment option', '-j', 'ACCEPT'],
+ :args => ['-t', :filter, '-p', :all, '-f', '-j', 'ACCEPT', '-m', 'comment', '--comment', '050 isfragment option'],
},
'isfragment_option not changing -f in comment' => {
:params => {
:proto => :all,
:action => 'accept',
},
- :args => ['-t', :filter, '-p', :all, '-m', 'comment', '--comment', '050 testcomment-with-fdashf', '-j', 'ACCEPT'],
+ :args => ['-t', :filter, '-p', :all, '-j', 'ACCEPT', '-m', 'comment', '--comment', '050 testcomment-with-fdashf'],
},
'connlimit_above' => {
:params => {
:connlimit_above => '10',
:action => 'reject',
},
- :args => ["-t", :filter, "-p", :tcp, "-m", "multiport", "--dports", "22", "-m", "comment", "--comment", "061 REJECT connlimit_above 10", "-j", "REJECT", "-m", "connlimit", "--connlimit-above", "10"],
+ :args => ["-t", :filter, "-p", :tcp, "-m", "multiport", "--dports", "22", "-j", "REJECT", "-m", "connlimit", "--connlimit-above", "10", "-m", "comment", "--comment", "061 REJECT connlimit_above 10"],
},
'connlimit_above_with_connlimit_mask' => {
:params => {
:connlimit_mask => '24',
:action => 'reject',
},
- :args => ["-t", :filter, "-p", :tcp, "-m", "multiport", "--dports", "22", "-m", "comment", "--comment", "061 REJECT connlimit_above 10 with mask 24", "-j", "REJECT", "-m", "connlimit", "--connlimit-above", "10", "--connlimit-mask", "24"],
+ :args => ["-t", :filter, "-p", :tcp, "-m", "multiport", "--dports", "22", "-j", "REJECT", "-m", "connlimit", "--connlimit-above", "10", "--connlimit-mask", "24", "-m", "comment", "--comment", "061 REJECT connlimit_above 10 with mask 24"],
},
'connmark' => {
:params => {
:connmark => '0x1',
:action => 'reject',
},
- :args => ["-t", :filter, "-p", :all, "-m", "comment", "--comment", "062 REJECT connmark", "-j", "REJECT", "-m", "connmark", "--mark", "0x1"],
+ :args => ["-t", :filter, "-p", :all, "-j", "REJECT", "-m", "connmark", "--mark", "0x1", "-m", "comment", "--comment", "062 REJECT connmark"],
},
'disallow_esp_protocol' => {
:params => {
:action => 'accept',
:proto => '! esp',
},
- :args => ["-t", :filter, "!", "-p", :esp, "-m", "comment", "--comment", "063 disallow esp protocol", "-j", "ACCEPT"],
+ :args => ["-t", :filter, "!", "-p", :esp, "-j", "ACCEPT", "-m", "comment", "--comment", "063 disallow esp protocol"],
},
'drop_new_packets_without_syn' => {
:params => {
:source => '! 10.0.0.0/8',
:tcp_flags => '! FIN,SYN,RST,ACK SYN',
},
- :args => ["-t", :filter, "!", "-s", "10.0.0.0/8", "!", "-p", :tcp, "-m", "tcp", "!", "--tcp-flags", "FIN,SYN,RST,ACK", "SYN", "-m", "comment", "--comment", "064 drop NEW non-tcp external packets with FIN/RST/ACK set and SYN unset", "-m", "state", "--state", "NEW", "-j", "DROP"]
+ :args => ["-t", :filter, "!", "-s", "10.0.0.0/8", "!", "-p", :tcp, "-m", "tcp", "!", "--tcp-flags", "FIN,SYN,RST,ACK", "SYN", "-m", "state", "--state", "NEW", "-j", "DROP", "-m", "comment", "--comment", "064 drop NEW non-tcp external packets with FIN/RST/ACK set and SYN unset"]
},
'negate_dport_and_sport' => {
:params => {
:dport => ['! 67','! 66'],
:proto => 'udp',
},
- :args => ["-t", :filter, "-s", "0.0.0.0/32", "-d", "255.255.255.255/32", "-p", :udp, "-m", "multiport", "!", "--sports", "68,69", "-m", "multiport", "!", "--dports", "67,66", "-m", "comment", "--comment", "065 negate dport and sport", "-j", "ACCEPT"],
+ :args => ["-t", :filter, "-s", "0.0.0.0/32", "-d", "255.255.255.255/32", "-p", :udp, "-m", "multiport", "!", "--sports", "68,69", "-m", "multiport", "!", "--dports", "67,66", "-j", "ACCEPT", "-m", "comment", "--comment", "065 negate dport and sport"],
},
'match_mark' => {
:params => {
:match_mark => '0x1',
:action => 'reject',
},
- :args => ["-t", :filter, "-p", :tcp, "-m", "comment", "--comment", "066 REJECT connlimit_above 10 with mask 32 and mark matches", "-j", "REJECT", "-m", "mark", "--mark", "0x1", "-m", "connlimit", "--connlimit-above", "10", "--connlimit-mask", "32"],
+ :args => ["-t", :filter, "-p", :tcp, "-j", "REJECT", "-m", "mark", "--mark", "0x1", "-m", "connlimit", "--connlimit-above", "10", "--connlimit-mask", "32", "-m", "comment", "--comment", "066 REJECT connlimit_above 10 with mask 32 and mark matches"],
},
'clamp_mss_to_pmtu' => {
:params => {
:jump => 'TCPMSS',
:clamp_mss_to_pmtu => true,
},
- :args => ["-t", :filter, "-p", :tcp, "-m", "tcp", "--tcp-flags", "SYN,RST", "SYN", "-m", "comment", "--comment", "067 change max segment size", "-j", "TCPMSS", "--clamp-mss-to-pmtu"],
+ :args => ["-t", :filter, "-p", :tcp, "-m", "tcp", "--tcp-flags", "SYN,RST", "SYN", "-j", "TCPMSS", "--clamp-mss-to-pmtu", "-m", "comment", "--comment", "067 change max segment size"],
},
'set_dscp_class' => {
:params => {
:jump => 'DSCP',
:set_dscp_class => 'ef',
},
- :args => ["-t", :mangle, "-p", :tcp, "-m", "multiport", '--ports', '997', "-m", "comment", "--comment", "068 set dscp class to EF", "-j", "DSCP", "--set-dscp-class", "ef"],
+ :args => ["-t", :mangle, "-p", :tcp, "-m", "multiport", '--ports', '997', "-j", "DSCP", "--set-dscp-class", "ef", "-m", "comment", "--comment", "068 set dscp class to EF"],
},
'length_1' => {
:params => {
:table => 'filter',
:length => '42000',
},
- :args => ["-t", :filter, "-p", :tcp, "-m", "comment", "--comment", "000 length", "-m", "length", "--length", "42000"],
+ :args => ["-t", :filter, "-p", :tcp, "-m", "length", "--length", "42000", "-m", "comment", "--comment", "000 length"],
},
'length_2' => {
:params => {
:table => 'filter',
:length => '1492-65535',
},
- :args => ["-t", :filter, "-p", :tcp, "-m", "comment", "--comment", "000 length", "-m", "length", "--length", "1492:65535"],
+ :args => ["-t", :filter, "-p", :tcp, "-m", "length", "--length", "1492:65535", "-m", "comment", "--comment", "000 length"],
},
'string_matching_1' => {
:params => {
:table => 'filter',
:string => 'GET /index.html',
},
- :args => ["-t", :filter, "-p", :tcp, "-m", "comment", "--comment", "000 string_matching", "-m", "string", "--string", "'GET /index.html'"],
+ :args => ["-t", :filter, "-p", :tcp, "-m", "string", "--string", "'GET /index.html'", "-m", "comment", "--comment", "000 string_matching"],
},
'string_matching_2' => {
:params => {
:string => 'GET /index.html',
:string_algo => 'bm',
},
- :args => ["-t", :filter, "-p", :tcp, "-m", "comment", "--comment", "000 string_matching", "-m", "string", "--string", "'GET /index.html'", "--algo", :bm],
+ :args => ["-t", :filter, "-p", :tcp, "-m", "string", "--string", "'GET /index.html'", "--algo", :bm, "-m", "comment", "--comment", "000 string_matching"],
},
'string_matching_3' => {
:params => {
:string_from => '1',
:string_to => '65535',
},
- :args => ["-t", :filter, "-p", :tcp, "-m", "comment", "--comment", "000 string_matching", "-m", "string", "--string", "'GET /index.html'", "--from", "1", "--to", "65535"],
+ :args => ["-t", :filter, "-p", :tcp, "-m", "string", "--string", "'GET /index.html'", "--from", "1", "--to", "65535", "-m", "comment", "--comment", "000 string_matching"],
},
'nfqueue_jump1' => {
:params => {
:destination => "4.3.2.1/32",
:queue_num => "50",
},
- :args => ["-t", :filter, "-s", "1.2.3.4/32", "-d", "4.3.2.1/32", "-p", :tcp, "-m", "comment", "--comment", "000 nfqueue specify queue_num", "-j", "NFQUEUE", "--queue-num", "50"]
+ :args => ["-t", :filter, "-s", "1.2.3.4/32", "-d", "4.3.2.1/32", "-p", :tcp, "-j", "NFQUEUE", "--queue-num", "50", "-m", "comment", "--comment", "000 nfqueue specify queue_num"]
},
'nfqueue_jump2' => {
:params => {
:queue_num => "50",
:queue_bypass => true,
},
- :args => ["-t", :filter, "-s", "1.2.3.4/32", "-d", "4.3.2.1/32", "-p", :tcp, "-m", "comment", "--comment", "002 nfqueue specify queue_num and queue_bypass", "-j", "NFQUEUE", "--queue-num", "50", "--queue-bypass"]
+ :args => ["-t", :filter, "-s", "1.2.3.4/32", "-d", "4.3.2.1/32", "-p", :tcp, "-j", "NFQUEUE", "--queue-num", "50", "--queue-bypass", "-m", "comment", "--comment", "002 nfqueue specify queue_num and queue_bypass"]
},
'nfqueue_jump3' => {
:params => {
:source => '1.2.3.4/32',
:destination => '4.3.2.1/32',
},
- :args => ["-t", :filter, "-s", "1.2.3.4/32", "-d", "4.3.2.1/32", "-p", :tcp, "-m", "comment", "--comment", "003 nfqueue dont specify queue_num or queue_bypass", "-j", "NFQUEUE"]
+ :args => ["-t", :filter, "-s", "1.2.3.4/32", "-d", "4.3.2.1/32", "-p", :tcp, "-j", "NFQUEUE", "-m", "comment", "--comment", "003 nfqueue dont specify queue_num or queue_bypass"]
}
-}
\ No newline at end of file
+}