1

I want to forward all traffic from server1 to server2 with domain same:

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

but output: Bad IP address iptables -t nat

vidarlo
  • 6,654
  • 2
  • 18
  • 31
  • `iptables` doesn't do domains. It's - as implied by name - a IP filtering system. It doesn't know or care about DNS. – vidarlo Dec 25 '22 at 09:59
  • Does this answer your question? [I need a reverse proxy solution for SSH](https://serverfault.com/questions/226952/i-need-a-reverse-proxy-solution-for-ssh) – djdomi Dec 25 '22 at 10:11

0 Answers0