使用 iptable 和網域將流量伺服器轉送到另一台伺服器

使用 iptable 和網域將流量伺服器轉送到另一台伺服器

我想將所有流量從 server1 轉送到具有相同網域的 server2:

sysctl net.ipv4.ip_forward=1
iptables -t nat -A PREROUTING -p tcp --dport 22 -j DNAT --to-destination IpServer1
iptables -t nat -A PREROUTING -j DNAT --to-destination DomainServer2
iptables -t nat -A POSTROUTING -j MASQUERADE

但輸出:錯誤的 IP 位址 iptables -t nat

相關內容