I am trying to get NAT hairpinning working on my router. I cannot access my local website host on my LAN (192.168.1.3). I am using nftables with the following config:
enp1s0 = WAN enp2s0 = LAN
#!/sbin/nft -f
flush ruleset
table ip nat {
chain prerouting {
type nat hook prerouting priority -100; policy accept;
iifname "enp1s0" tcp dport { 80, 443 } dnat to 192.168.1.3
meta nftrace set 1
}
chain postrouting {
type nat hook postrouting priority 100; policy accept;
ip saddr 192.168.1.0/24 ip daddr 192.168.1.3 tcp dport { http, https } counter snat 192.168.1.1
oifname "enp1s0" masquerade
meta nftrace set 1
}
}
How exactly can I get hairpinning to work? I have seen people use split DNS but I am not too sure how to set that up.