1

I have an OpenWRT router.

What I need to achieve is a port redirection within my LAN zone. What I mean is, every time I hit local address on port 40413 it should to be redirected to 192.168.1.111:443

For example. if I put in browser: https://192.168.1.111:40443 it should point to 192.168.1.111:443 That's pretty easy with plain iptable rule:

iptables -t nat -A PREROUTING -i br-lan -p tcp --dport 40443 -j REDIRECT --to-port 443

I tried to it into /etc/firewall.user but no effect...

I also tried with rule main firewall config: /etc/config/firewall

config redirect
   option name 'owncloud_internal'
   option src 'lan'
   option proto 'tcp'
   option src_dport '40443'
   option dest_ip '192.168.1.111'
   option dest_port '443'
   option target 'DNAT'
   option dest 'lan'

But still no effect.

Can someone explain how to approach this problem?

0

Ok. This is not possible to archive using router settings because communication does not go throught routing, so it is not possible to manipulate it that way. Probably i should setup proxy, but in my case it was easier to reconfigure https server to listen on 40443 port.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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