| @@ -0,0 +1,25 @@ | |||
| 1 | + | jail_net = "192.168.123.0/24" | |
| 2 | + | jail_net6 = "fd42:1234:5678:1::/64" | |
| 3 | + | vpn_net = "10.8.0.0/24" | |
| 4 | + | ||
| 5 | + | set skip on lo | |
| 6 | + | ||
| 7 | + | # NAT so jails can access internet | |
| 8 | + | nat on wg0 inet from $jail_net to any -> (wg0) | |
| 9 | + | nat on em0 inet from $jail_net to any -> (em0) | |
| 10 | + | ||
| 11 | + | # IPv6 NAT | |
| 12 | + | nat on wg0 inet6 from $jail_net6 to any -> (wg0) | |
| 13 | + | nat on em0 inet6 from $jail_net6 to any -> (em0) | |
| 14 | + | ||
| 15 | + | # VPN NAT | |
| 16 | + | nat on wg0 inet from $vpn_net to any -> (wg0) | |
| 17 | + | nat on em0 inet from $vpn_net to any -> (em0) | |
| 18 | + | ||
| 19 | + | # Forward games ports to its jail (and route to em0) | |
| 20 | + | rdr pass on em0 proto udp from any to any port 30000:40000 -> 192.168.123.11 port 30000:40000 | |
| 21 | + | rdr pass on em0 proto tcp from any to any port 30000:40000 -> 192.168.123.11 port 30000:40000 | |
| 22 | + | pass in quick on bridge1 route-to (em0 10.0.0.1) from 192.168.123.11 to any keep state | |
| 23 | + | ||
| 24 | + | pass in all | |
| 25 | + | pass out all | |
swee revised this gist 2 hours ago · 7fbf2ac
1 file changed, 25 insertions