python-iptables icon indicating copy to clipboard operation
python-iptables copied to clipboard

How to set match LOCAL

Open Konrad-Ziarko opened this issue 2 years ago • 4 comments

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

Konrad-Ziarko avatar Apr 26 '23 13:04 Konrad-Ziarko

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 ? 🙏

jllorente avatar Aug 20 '23 11:08 jllorente

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

Konrad-Ziarko avatar Aug 21 '23 08:08 Konrad-Ziarko

Does that answer your question ? :)

jllorente avatar Aug 21 '23 18:08 jllorente

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

Konrad-Ziarko avatar Aug 22 '23 06:08 Konrad-Ziarko