Dear All,
I've already spent two days trying to resolve my port forwarding problem, unfortunately w/o any success. It seems my OpenWRT does not forward communication on port 443 and I really don't know why.
My network connections are as follows:
1. WAN -> UPC Horizon router (not much configurable)
2. UPC Horizon DMZ -> Linksys with OpenWRT
3. OpenWRT -> NAS & other internal network devices
Horizon's DHCP range: 192.168.1.100-192.168.1.254 (Linksys has 192.168.1.184)
Linksys's WAN interface: DHCP client
Linksys's LAN interface: Static IP, 192.168.2.1/255.255.255.0, DHCP Server enabled
NAT's IP: 192.168.2.10
I'd like to forward ports 80 & 443 to my NAS server, added port forwarding rules:
1. IPv4-TCP, from any host in WAN, via any router IP at port 80 -> IP 192.168.2.10:80
2. IPv4-TCP, from any host in WAN, via any router IP at port 443 -> IP 192.168.2.10:443
Now, results provided by canyouseeme.org:
1. I can see your service on *.*.*.* on port (80)
2. I could not see your service on *.*.*.* on port (443)
I thought it might be an ISP issue, co I connected my NAS to Horizon's DMS for a while.
Results by canyouseeme.org were correct (visible on 80 & 443) - ergo it seems to be a problem with OpenWRT configuration.
Could you please be so kind and give me any advice in this matter?
The second question is: is it achievable to prepare such NAT loopback rules to have my NAS visible from internal network using my WAN IP/domain name (Horizon doesn't support NAT loopback, so everything has to be done on Linksys).
iptables -L -v -n:
Chain INPUT (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
1662 179K delegate_input all -- * * 0.0.0.0/0 0.0.0.0/0
Chain FORWARD (policy DROP 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
7513 2850K delegate_forward all -- * * 0.0.0.0/0 0.0.0.0/0
Chain OUTPUT (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
2038 447K delegate_output all -- * * 0.0.0.0/0 0.0.0.0/0
Chain delegate_forward (1 references)
pkts bytes target prot opt in out source destination
7513 2850K forwarding_rule all -- * * 0.0.0.0/0 0.0.0.0/0 /* user chain for forwarding */
6693 2808K ACCEPT all -- * * 0.0.0.0/0 0.0.0.0/0 ctstate RELATED,ESTABLISHED
819 41739 zone_lan_forward all -- br-lan * 0.0.0.0/0 0.0.0.0/0
1 60 zone_wan_forward all -- eth0 * 0.0.0.0/0 0.0.0.0/0
0 0 reject all -- * * 0.0.0.0/0 0.0.0.0/0
Chain delegate_input (1 references)
pkts bytes target prot opt in out source destination
160 11937 ACCEPT all -- lo * 0.0.0.0/0 0.0.0.0/0
1502 167K input_rule all -- * * 0.0.0.0/0 0.0.0.0/0 /* user chain for input */
1224 149K ACCEPT all -- * * 0.0.0.0/0 0.0.0.0/0 ctstate RELATED,ESTABLISHED
8 368 syn_flood tcp -- * * 0.0.0.0/0 0.0.0.0/0 tcp flags:0x17/0x02
195 12772 zone_lan_input all -- br-lan * 0.0.0.0/0 0.0.0.0/0
83 4974 zone_wan_input all -- eth0 * 0.0.0.0/0 0.0.0.0/0
Chain delegate_output (1 references)
pkts bytes target prot opt in out source destination
160 11937 ACCEPT all -- * lo 0.0.0.0/0 0.0.0.0/0
1878 435K output_rule all -- * * 0.0.0.0/0 0.0.0.0/0 /* user chain for output */
1790 428K ACCEPT all -- * * 0.0.0.0/0 0.0.0.0/0 ctstate RELATED,ESTABLISHED
3 696 zone_lan_output all -- * br-lan 0.0.0.0/0 0.0.0.0/0
85 6040 zone_wan_output all -- * eth0 0.0.0.0/0 0.0.0.0/0
Chain forwarding_lan_rule (1 references)
pkts bytes target prot opt in out source destination
Chain forwarding_rule (1 references)
pkts bytes target prot opt in out source destination
Chain forwarding_wan_rule (1 references)
pkts bytes target prot opt in out source destination
Chain input_lan_rule (1 references)
pkts bytes target prot opt in out source destination
Chain input_rule (1 references)
pkts bytes target prot opt in out source destination
Chain input_wan_rule (1 references)
pkts bytes target prot opt in out source destination
Chain output_lan_rule (1 references)
pkts bytes target prot opt in out source destination
Chain output_rule (1 references)
pkts bytes target prot opt in out source destination
Chain output_wan_rule (1 references)
pkts bytes target prot opt in out source destination
Chain reject (3 references)
pkts bytes target prot opt in out source destination
4 160 REJECT tcp -- * * 0.0.0.0/0 0.0.0.0/0 reject-with tcp-reset
59 4214 REJECT all -- * * 0.0.0.0/0 0.0.0.0/0 reject-with icmp-port-unreachable
Chain syn_flood (1 references)
pkts bytes target prot opt in out source destination
8 368 RETURN tcp -- * * 0.0.0.0/0 0.0.0.0/0 tcp flags:0x17/0x02 limit: avg 25/sec burst 50
0 0 DROP all -- * * 0.0.0.0/0 0.0.0.0/0
Chain zone_lan_dest_ACCEPT (4 references)
pkts bytes target prot opt in out source destination
591 26568 ACCEPT all -- * br-lan 0.0.0.0/0 0.0.0.0/0
Chain zone_lan_forward (1 references)
pkts bytes target prot opt in out source destination
819 41739 forwarding_lan_rule all -- * * 0.0.0.0/0 0.0.0.0/0 /* user chain for forwarding */
819 41739 zone_wan_dest_ACCEPT all -- * * 0.0.0.0/0 0.0.0.0/0 /* forwarding lan -> wan */
0 0 ACCEPT all -- * * 0.0.0.0/0 0.0.0.0/0 ctstate DNAT /* Accept port forwards */
588 25872 zone_lan_dest_ACCEPT all -- * * 0.0.0.0/0 0.0.0.0/0
Chain zone_lan_input (1 references)
pkts bytes target prot opt in out source destination
195 12772 input_lan_rule all -- * * 0.0.0.0/0 0.0.0.0/0 /* user chain for input */
0 0 ACCEPT all -- * * 0.0.0.0/0 0.0.0.0/0 ctstate DNAT /* Accept port redirections */
195 12772 zone_lan_src_ACCEPT all -- * * 0.0.0.0/0 0.0.0.0/0
Chain zone_lan_output (1 references)
pkts bytes target prot opt in out source destination
3 696 output_lan_rule all -- * * 0.0.0.0/0 0.0.0.0/0 /* user chain for output */
3 696 zone_lan_dest_ACCEPT all -- * * 0.0.0.0/0 0.0.0.0/0
Chain zone_lan_src_ACCEPT (1 references)
pkts bytes target prot opt in out source destination
195 12772 ACCEPT all -- br-lan * 0.0.0.0/0 0.0.0.0/0
Chain zone_wan_dest_ACCEPT (2 references)
pkts bytes target prot opt in out source destination
316 21907 ACCEPT all -- * eth0 0.0.0.0/0 0.0.0.0/0
Chain zone_wan_dest_REJECT (1 references)
pkts bytes target prot opt in out source destination
0 0 reject all -- * eth0 0.0.0.0/0 0.0.0.0/0
Chain zone_wan_forward (1 references)
pkts bytes target prot opt in out source destination
1 60 forwarding_wan_rule all -- * * 0.0.0.0/0 0.0.0.0/0 /* user chain for forwarding */
0 0 zone_lan_dest_ACCEPT esp -- * * 0.0.0.0/0 0.0.0.0/0 /* @rule[7] */
0 0 zone_lan_dest_ACCEPT udp -- * * 0.0.0.0/0 0.0.0.0/0 udp dpt:500 /* @rule[8] */
1 60 ACCEPT all -- * * 0.0.0.0/0 0.0.0.0/0 ctstate DNAT /* Accept port forwards */
0 0 zone_wan_dest_REJECT all -- * * 0.0.0.0/0 0.0.0.0/0
Chain zone_wan_input (1 references)
pkts bytes target prot opt in out source destination
83 4974 input_wan_rule all -- * * 0.0.0.0/0 0.0.0.0/0 /* user chain for input */
0 0 ACCEPT udp -- * * 0.0.0.0/0 0.0.0.0/0 udp dpt:68 /* Allow-DHCP-Renew */
0 0 ACCEPT icmp -- * * 0.0.0.0/0 0.0.0.0/0 icmptype 8 /* Allow-Ping */
20 600 ACCEPT 2 -- * * 0.0.0.0/0 0.0.0.0/0 /* Allow-IGMP */
0 0 ACCEPT all -- * * 0.0.0.0/0 0.0.0.0/0 ctstate DNAT /* Accept port redirections */
63 4374 zone_wan_src_REJECT all -- * * 0.0.0.0/0 0.0.0.0/0
Chain zone_wan_output (1 references)
pkts bytes target prot opt in out source destination
85 6040 output_wan_rule all -- * * 0.0.0.0/0 0.0.0.0/0 /* user chain for output */
85 6040 zone_wan_dest_ACCEPT all -- * * 0.0.0.0/0 0.0.0.0/0
Chain zone_wan_src_REJECT (1 references)
pkts bytes target prot opt in out source destination
63 4374 reject all -- eth0 * 0.0.0.0/0 0.0.0.0/0
iptables -t nat -L -v:
Chain PREROUTING (policy ACCEPT 1887 packets, 105K bytes)
pkts bytes target prot opt in out source destination
1888 105K delegate_prerouting all -- any any anywhere anywhere
Chain INPUT (policy ACCEPT 187 packets, 12500 bytes)
pkts bytes target prot opt in out source destination
Chain OUTPUT (policy ACCEPT 257 packets, 18512 bytes)
pkts bytes target prot opt in out source destination
Chain POSTROUTING (policy ACCEPT 1286 packets, 59496 bytes)
pkts bytes target prot opt in out source destination
1758 88400 delegate_postrouting all -- any any anywhere anywhere
Chain delegate_postrouting (1 references)
pkts bytes target prot opt in out source destination
1758 88400 postrouting_rule all -- any any anywhere anywhere /* user chain for postrouting */
1207 53692 zone_lan_postrouting all -- any br-lan anywhere anywhere
472 28904 zone_wan_postrouting all -- any eth0 anywhere anywhere
Chain delegate_prerouting (1 references)
pkts bytes target prot opt in out source destination
1888 105K prerouting_rule all -- any any anywhere anywhere /* user chain for prerouting */
1744 96739 zone_lan_prerouting all -- br-lan any anywhere anywhere
144 8408 zone_wan_prerouting all -- eth0 any anywhere anywhere
Chain postrouting_lan_rule (1 references)
pkts bytes target prot opt in out source destination
Chain postrouting_rule (1 references)
pkts bytes target prot opt in out source destination
Chain postrouting_wan_rule (1 references)
pkts bytes target prot opt in out source destination
Chain prerouting_lan_rule (1 references)
pkts bytes target prot opt in out source destination
Chain prerouting_rule (1 references)
pkts bytes target prot opt in out source destination
Chain prerouting_wan_rule (1 references)
pkts bytes target prot opt in out source destination
Chain zone_lan_postrouting (1 references)
pkts bytes target prot opt in out source destination
1207 53692 postrouting_lan_rule all -- any any anywhere anywhere /* user chain for postrouting */
0 0 SNAT tcp -- any any 192.168.2.0/24 MS-NAS.lan tcp dpt:wxw /* NAS-80 (reflection) */ to:192.168.2.1
0 0 SNAT tcp -- any any 192.168.2.0/24 MS-NAS.lan tcp dpt:hxxps /* NAS-443 (reflection) */ to:192.168.2.1
Chain zone_lan_prerouting (1 references)
pkts bytes target prot opt in out source destination
1744 96739 prerouting_lan_rule all -- any any anywhere anywhere /* user chain for prerouting */
0 0 DNAT tcp -- any any 192.168.2.0/24 192.168.1.91 tcp dpt:wxw /* NAS-80 (reflection) */ to:192.168.2.10:80
0 0 DNAT tcp -- any any 192.168.2.0/24 192.168.1.91 tcp dpt:hxxps /* NAS-443 (reflection) */ to:192.168.2.10:443
Chain zone_wan_postrouting (1 references)
pkts bytes target prot opt in out source destination
472 28904 postrouting_wan_rule all -- any any anywhere anywhere /* user chain for postrouting */
472 28904 MASQUERADE all -- any any anywhere anywhere
Chain zone_wan_prerouting (1 references)
pkts bytes target prot opt in out source destination
144 8408 prerouting_wan_rule all -- any any anywhere anywhere /* user chain for prerouting */
1 60 DNAT tcp -- any any anywhere anywhere tcp dpt:wxw /* NAS-80 */ to:192.168.2.10:80
0 0 DNAT tcp -- any any anywhere anywhere tcp dpt:hxxps /* NAS-443 */ to:192.168.2.10:443
(wxw & hxxps above were changed by me as, posting "links" is not allowed)
Thank you very much for your help.
(Last edited by mszewcz78 on 4 Mar 2017, 11:27)