google / nftables

This repository contains a Go module to interact with Linux nftables (the iptables successor).
Apache License 2.0
1.11k stars 136 forks source link

NAT: prefix test #252

Closed cheina97 closed 9 months ago

cheina97 commented 10 months ago

This PR adds unit tests for PR #251

In particular it adds a unit test for this rule nft add rule nat prerouting ip daddr 10.0.0.0/24 dnat prefix to 20.0.0.0/24

The PR includes some utilities to get the first and last IP of a subnet (they include unit tests)

cheina97 commented 9 months ago

Hi @stapelberg, I've left a commit with the fixes you asked for. If it is ok I can squash the commits.

stapelberg commented 9 months ago

Thanks! Merged as commit https://github.com/google/nftables/commit/33ee8df9d8e2cbe47a998c97fe6b842cf00b324a with slight adjustments in naming/documentation.