polycule-network/templates/rules.nft

37 lines
774 B
Text
Raw Normal View History

2024-05-02 09:31:34 +00:00
flush ruleset
table ip filter {
map ip_map_snat {
type ipv4_addr : ipv4_addr
}
map ip_map_dnat {
type ipv4_addr : ipv4_addr
}
set local_range {
type ipv4_addr
flags interval
}
set remote_range {
type ipv4_addr
flags interval
}
set local_translated_range {
type ipv4_addr
flags interval
}
chain postrouting {
type nat hook postrouting priority 100; policy accept;
ip saddr @local_range ip daddr @remote_range snat to ip saddr map @ip_map_snat
}
chain prerouting {
type nat hook prerouting priority 100; policy accept;
ip saddr @remote_range ip daddr @local_translated_range dnat to ip daddr map @ip_map_dnat
}
}