4d7709ddf6
Copy the most important test cases from OpenBSD's corresponding src/regress/sbin/pfctl, those that run pfctl on a test input file and check correctness of its output. We have also added some new tests using the same format. The tests consist of a collection of input files (pf*.in) and corresponding output files (pf*.ok). We run pfctl -nv on the input files and check that the output matches the output files. If any discrepancy is discovered during future development in the source tree, we know that a regression bug has been introduced into the tree. Submitted by: paggas Sponsored by: Google, Inc (GSoC 2017) Differential Revision: https://reviews.freebsd.org/D11322
20 lines
745 B
Plaintext
20 lines
745 B
Plaintext
# test nat
|
|
|
|
TEST_LIST1 = "{ 192.168.1.5, 192.168.1.6, 192.168.1.7 }"
|
|
TEST_LIST2 = "{ 172.6.1.1, 172.14.1.2/32, 172.16.2.0/24 }"
|
|
|
|
#match out on lo0 from 192.168.1.1 to any nat-to 10.0.0.1
|
|
#match out on lo0 proto tcp from 192.168.1.2 to any nat-to 10.0.0.2
|
|
#match out on lo0 proto udp from 192.168.1.3 to any nat-to 10.0.0.3
|
|
#match out on lo0 proto icmp from 192.168.1.4 to any nat-to 10.0.0.4
|
|
|
|
#match out on lo0 inet from $TEST_LIST1 to $TEST_LIST2 nat-to lo0
|
|
|
|
#match out on lo0 inet from 192.168.0.1/24 to any nat-to (lo0)
|
|
|
|
#match out on lo0 from 192.168.1.8 to ! 172.17.0.0/16 nat-to 10.0.0.8
|
|
|
|
#match out on ! lo0 proto { udp, tcp } from any to any nat-to 10.0.0.8 static-port
|
|
|
|
#match out on { lo0, tun1000000 } from any to any nat-to 10.0.0.8
|