mirror of
https://github.com/nftables-rs/nftables-rs.git
synced 2026-10-21 00:01:25 +00:00
21 lines
367 B
Plaintext
21 lines
367 B
Plaintext
#!/sbin/nft -f
|
|
|
|
# https://wiki.nftables.org/wiki-nftables/index.php/Maps
|
|
|
|
flush ruleset
|
|
|
|
table ip nat {
|
|
map porttoip {
|
|
type inet_service : ipv4_addr
|
|
elements = { 80 : 192.168.1.100, 8888 : 192.168.1.101 }
|
|
}
|
|
|
|
chain prerouting {
|
|
dnat to tcp dport map { 80 : 192.168.1.100, 8888 : 192.168.1.101 }
|
|
}
|
|
|
|
chain postrouting {
|
|
snat to tcp dport map @porttoip
|
|
}
|
|
}
|