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?

1 Answer 1

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.

2
  • Nice, but won't you also need a POSTROUTING and a FORWARD rule?
    – dgo.a
    Commented Dec 11, 2017 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
    Commented Dec 11, 2017 at 13:47

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .