-
Notifications
You must be signed in to change notification settings - Fork 185
Description
I tried adding a rule with iptc.easy.add_rule(table, chain, rule_d) which has got a 'recent' match, but end up either with the error iptc.errors.XTablesError: b'recent'.x6_fcheck has failed if the name attribute is given as first argument or with an iptables rule with name DEFAULT instead of the one i've given it.
the rule as dictionary which produces the rule below:
>>> rule_d = {'protocol': 'udp', 'recent': {'mask': '255.255.255.255', 'update': '', 'seconds': '60', 'rsource': '', 'name': 'UDP-PORTSCAN'}, 'target': {'REJECT':{'reject-with': 'icmp-port-unreachable'}}}
and the result.
0 0 REJECT udp -- * * 0.0.0.0/0 0.0.0.0/0 recent: SET name: DEFAULT side: source mask: 255.255.255.255 reject-with icmp-port-unreachable
the rule as dictionary which produces the error iptc.errors.XTablesError: b'recent'.x6_fcheck has failed
>>> rule_d = {'protocol': 'udp', 'recent': {'name': 'UDP-PORTSCAN', 'mask': '255.255.255.255', 'update': '', 'seconds': '60', 'rsource': ''}, 'target': {'REJECT':{'reject-with': 'icmp-port-unreachable'}}}