ldx / python-iptables

Python bindings for iptables
730 stars 182 forks source link

How to set match LOCAL #338

Open Konrad-Ziarko opened 1 year ago

Konrad-Ziarko commented 1 year ago

Hi, Is it possible to set 'ADDRTYPE match dst-type LOCAL' for with iptx?

jllorente commented 1 year ago

I don't have an access to a Linux box at the moment, but could you try adding the rule via the CLI with the iptables command and then use the library to iptc.easy.dump_chain() and share the output ? 🙏

Konrad-Ziarko commented 1 year ago
>>>pprint(iptc.easy.dump_chain('nat', 'OUTPUT'))
[{'addrtype': {'dst-type': 'LOCAL'},
  'counters':(3242, 301756),
  'target': 'CNI-HOSTPORT-DNAT'}]
jllorente commented 1 year ago

Does that answer your question ? :)

Konrad-Ziarko commented 1 year ago

I do not see those props in Rule object. So i do not think so.