I have set up http server onto my router (more specifically node.js server through entware) and I have trouble getting WAN packets to reach this server.
What I did:
1. Set up port forwarding to forward port 2118 (port of my server) to the 192.168.1.1 (LAN IP of my router)
2. Added this to firewall script (found these after scouring the google):
iptables -t filter -A INPUT -p tcp --dport 2118 -j ACCEPT iptables -t nat -I PREROUTING 2 -p tcp -d `nvram get wan_ipaddr` --dport 2118 -j ACCEPT
And yet, when I try to access the server from the WAN, my packet gets dropped:
Dec 28 15:11:04 unknown user.warn kernel: DROP IN=ppp0 OUT= MAC= SRC=[Redacted] DST=192.168.1.1 LEN=60 TOS=0x00 PREC=0x00 TTL=56 ID=54576 DF PROTO=TCP SPT=40744 DPT=2118 SEQ=2300643227 ACK=0 WINDOW=65535 RES=0x00 SYN URGP=0 OPT (020405640402080A0061D3180000000001030308)
Any idea why is my packet still not being forwarded? If I access the server from LAN, it works perfectly.