1
我嘗試設置我的服務器,因此它將端口80的流量重定向到端口8080,但它不起作用。 (如果我telnet到端口80,並且「無法連接」,我會得到「連接被拒絕」錯誤。)無法獲得nftables將端口80重定向到8080
我已經能夠使用iptables使其工作,但更喜歡使用nftables。有人知道這個問題可能是什麼嗎? (如果它是相關的,在服務器上運行linode.com,通過提供的Linode內核。)
我得在/etc/nftables.conf如下:
#!/usr/sbin/nft -f
flush ruleset
table ip fw {
chain in {
type filter hook input priority 0;
# accept any localhost traffic
iif lo accept
# accept traffic originated from us
ct state established,related accept
# accept ssh, alternative http
tcp dport { ssh, http, http-alt } ct state new counter accept
counter drop
}
}
table ip nat {
chain prerouting {
type nat hook prerouting priority 0;
tcp dport http redirect to http-alt
}
chain postrouting {
type nat hook postrouting priority 0;
}
}