Hi Andzej, thank you for your reply. It definitely helped me looking in the right direction.
The RUT241 is currently running firmware RUT2M_R_00.07.04.5
In the mean time I applied the command explained here How to reset firewall to default - Crowd Support Forum | Teltonika Networks (teltonika-networks.com) to bring the firewall back to a reasonable state.
I added a new forwarding rule just for port 80 for the time being, like this:
http fwd
IPv4 tcp
From any host in wan
Via any router IP at port 80
IP 10.10.20.21, port 80 in lan
and enabled masquerading as you suggested
Then, after installing tcpdump on the RUT241 I went back to testing, using
telnet 10.42.0.66 80
root@RUT241:~# tcpdump -vv -i br-lan port 80
tcpdump: listening on br-lan, link-type EN10MB (Ethernet), capture size 262144 bytes
10:25:08.816272 IP (tos 0x0, ttl 62, id 51884, offset 0, flags [DF], proto TCP (6), length 60)
10.10.19.4.53046 > 10.10.20.21.80: Flags [S], cksum 0xa43d (correct), seq 710845466, win 14600, options [mss 1450,sackOK,TS val 585199286 ecr 0,nop,wscale 8], length 0
10:25:08.818165 IP (tos 0x0, ttl 63, id 0, offset 0, flags [none], proto TCP (6), length 60)
10.10.20.21.80 > 10.10.19.4.53046: Flags [S.], cksum 0x6c81 (correct), seq 443798409, ack 710845467, win 65160, options [mss 1460,sackOK,TS val 3895172088 ecr 585199286,nop,wscale 7], length 0
10:25:08.890231 IP (tos 0x0, ttl 62, id 51885, offset 0, flags [DF], proto TCP (6), length 52)
10.10.19.4.53046 > 10.10.20.21.80: Flags [.], cksum 0x9976 (correct), seq 1, ack 1, win 58, options [nop,nop,TS val 585199324 ecr 3895172088], length 0
and
root@RUT241:~# tcpdump -vv -i wwan0 port 80
tcpdump: listening on wwan0, link-type RAW (Raw IP), capture size 262144 bytes
10:34:28.174208 IP (tos 0x0, ttl 63, id 61107, offset 0, flags [DF], proto TCP (6), length 60)
10.42.0.1.53047 > 10.42.0.66.80: Flags [S], cksum 0xcdda (correct), seq 1230546827, win 14600, options [mss 1460,sackOK,TS val 585255224 ecr 0,nop,wscale 8], length 0
10:34:28.176678 IP (tos 0x0, ttl 62, id 0, offset 0, flags [none], proto TCP (6), length 60)
10.42.0.66.80 > 10.42.0.1.53047: Flags [S.], cksum 0xcc84 (correct), seq 901642471, ack 1230546828, win 65160, options [mss 1450,sackOK,TS val 3895731445 ecr 585255224,nop,wscale 7], length 0
10:34:28.243124 IP (tos 0x0, ttl 63, id 61108, offset 0, flags [DF], proto TCP (6), length 52)
10.42.0.1.53047 > 10.42.0.66.80: Flags [.], cksum 0xf974 (correct), seq 1, ack 1, win 58, options [nop,nop,TS val 585255257 ecr 3895731445], length 0
I stopped the capture when after several seconds nothing further happened.
This seems to suggest that all traffic is properly forwarded, doesn’t it?
So then I repeated the same telnet test from the rut241, with success:
(had to reduce the number of screenshots as I am only allowed to add 1…)
so for now the question seems to be why does it work properly when starting from the 241, but not with forwarding?
The rest of the problem indeed looks like a networking problem higher-up, I will have to discuss that with our hosting company (it looks like 10.10.20.21, the webserver, isn’t aware that traffic for 10.42 should go through the RUT).
Thanks in advance for your help!