halsafar
New Around Here
So I want to take all traffic directed at a 'fake ip' address to a 'real one'. By this I mean 192.168.1.106 is a server hosting a few services. Using dnsmasq I have a set of local redirections going on pointing some sites to an unused 'fake' ip address 192.168.1.222.
Is it not possible to use ip tables to redirect all LAN traffic destined for 192.168.1.222:80 and send it to 192.168.1.106:8181
The following does not work:
Next, the following works on the router and allows me to ping the fake ip address but get a response from the real one. No other machines on the LAN can though.
A solution would be having the router redirect 192.168.1.222:80 to 192.168.1.106:8181 for all clients.
I have done this before but it is not working on this router running merlin-wrt. Likely a chain name or interface issue.
Is it not possible to use ip tables to redirect all LAN traffic destined for 192.168.1.222:80 and send it to 192.168.1.106:8181
The following does not work:
Code:
iptables -t nat -A PREROUTING -p tcp -d 192.168.1.222 --dport 80 -j DNAT --to 192.168.1.106:8181
iptables -t nat -A POSTROUTING -j MASQUERADE
Next, the following works on the router and allows me to ping the fake ip address but get a response from the real one. No other machines on the LAN can though.
Code:
iptables -t nat -A OUTPUT -d 192.168.1.222 -j DNAT --to-destination 192.168.1.106
A solution would be having the router redirect 192.168.1.222:80 to 192.168.1.106:8181 for all clients.
I have done this before but it is not working on this router running merlin-wrt. Likely a chain name or interface issue.
Last edited: