From b975de80bd1dbf0a04c6cb7a42e46c323c865de8 Mon Sep 17 00:00:00 2001 From: Pablo Neira Ayuso Date: Tue, 21 Nov 2023 20:45:48 +0100 Subject: tests: shell: split nat inet tests Detach nat inet from existing tests not to reduce test coverage. Signed-off-by: Pablo Neira Ayuso --- tests/shell/testcases/optimizations/merge_nat_inet | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100755 tests/shell/testcases/optimizations/merge_nat_inet (limited to 'tests/shell/testcases/optimizations/merge_nat_inet') diff --git a/tests/shell/testcases/optimizations/merge_nat_inet b/tests/shell/testcases/optimizations/merge_nat_inet new file mode 100755 index 00000000..ff1916d3 --- /dev/null +++ b/tests/shell/testcases/optimizations/merge_nat_inet @@ -0,0 +1,21 @@ +#!/bin/bash + +# NFT_TEST_REQUIRES(NFT_TEST_HAVE_inet_nat) + +set -e + +RULESET="table inet nat { + chain prerouting { + oif lo accept + iifname enp2s0 ip daddr 72.2.3.66 tcp dport 53122 dnat to 10.1.1.10:22 + iifname enp2s0 ip daddr 72.2.3.66 tcp dport 443 dnat to 10.1.1.52:443 + iifname enp2s0 ip daddr 72.2.3.70 tcp dport 80 dnat to 10.1.1.52:80 + } + chain postrouting { + oif lo accept + ip daddr 72.2.3.66 snat to 10.2.2.2 + ip daddr 72.2.3.67 snat to 10.2.3.3 + } +}" + +$NFT -o -f - <<< $RULESET -- cgit v1.2.3