Skip to main content
typos and grammar, spaelling and formatting
Source Link
Dave M
  • 13.2k
  • 25
  • 37
  • 48

I gothave an OpenWRT router. 

What iI 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

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

Can someone figure it out,explain how to approach this silly problem?

Thanks

I got 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 figure it out, how to approach this silly problem?

Thanks

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?

I got OpenWRT router. What i need to archeiveachieve is a port redirection within my lanLAN zone. What iI mean is, every time iI hit local adresaddress on port 40413 it hasshould to be redirected to 192.168.1.111:443 For example iif 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'

butBut still no effect... Can someone figure it out, how to approach this silly problem?

Thanks

I got OpenWRT router. What i need to archeive is a port redirection within my lan zone. What i mean, every time i hit local adres on port 40413 it has to be redirected to 192.168.1.111:443 For example 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 figure it out, how to approach this silly problem?

Thanks

I got 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 figure it out, how to approach this silly problem?

Thanks

Source Link

OpenWRT port redirection

I got OpenWRT router. What i need to archeive is a port redirection within my lan zone. What i mean, every time i hit local adres on port 40413 it has to be redirected to 192.168.1.111:443 For example 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 figure it out, how to approach this silly problem?

Thanks