0

Is it possible to redirect the outgoing HTTP (tcp, port 80) of a client in a lan to another lan client in the same network using OpenWRT Chaos Calmer 15.05?

10.1.1.1 - Router/AP runing OpenWRT
10.1.1.2 - client A - In LAN, tries to connect to xx.xx.xx.xx (port 80) in WAN, but packets are sent to client B in LAN.
10.1.1.9 - client B - In LAN, should receive HTTP traffic from Client A.

Would this be possible using the UCI Firewall using a "config redirect" section? Or would it be better to set it up in the "Custom Rules" iptable script?

0

You could use an iptables rule:

iptables -t nat -I PREROUTING -p tcp --dport 80 -d xxx.xxx.xxx.xxx -j DNAT --to-destination yyy.yyy.yyy.yyy

Where xxx.xxx.xxx.xxx is the address you want to spoof and yyy.yyy.yyy.yyy in the address of the server you want to direct traffic to. You can add this to the custom rules.

  • Nice, but won't you also need a POSTROUTING and a FORWARD rule? – dgo.a Dec 11 '17 at 1:43
  • There is no FOWARD chain in the nat table, only in filter and mangle. The POSTROUTING rules on the other hand, are already present as part of the normal OpenWRT configuration. – Alexis Dec 11 '17 at 13:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.