Yes, I was just reading that, about being able to use the same commands. Strange.
BTW, could I continue using iptables, not just the command but the old method?
What I mean is that when using my old router running 18.06.0, this works just fine but it's broken on the 22.03.3 router I'm working on.
It's confusing because everything but port forwarding works.
From a remote over the vpn, I cannot reach a blocked port on the router.
From a remote over the vpn, I can reach a port running on the router.
From a remote over the vpn, I cannot reach a port forwarded to another device on the LAN.
I've tried all kinds of variations and what I'm sharing is just yet another variation and cannot find a reason for this blocking. The port forwarding never works.
$ iptables -S
# Warning: iptables-legacy tables present, use iptables-legacy to see them
-P INPUT ACCEPT
-P FORWARD ACCEPT
-P OUTPUT ACCEPT
-A FORWARD -i br-lan -o tun+ -j ACCEPT
-A FORWARD -i tun+ -o br-lan -j ACCEPT
$ iptables -S -t nat
# Warning: iptables-legacy tables present, use iptables-legacy to see them
-P PREROUTING ACCEPT
-P INPUT ACCEPT
-P OUTPUT ACCEPT
-P POSTROUTING ACCEPT
-A PREROUTING -i tun+ -p tcp -m tcp --dport 81 -j DNAT --to-destination 192.168.1.99:80
-A POSTROUTING -o br-lan -j MASQUERADE
-A POSTROUTING -o tun+ -j MASQUERADE
From the remote vpn;
# curl 172.16.1.15:22
SSH-2.0-dropbear
***this works***
# curl 172.16.1.15:81
curl: (7) Failed connect to 172.16.1.15:81; Connection refused
On the openwrt router;
Sun May 21 19:04:10 2023 kern.info kernel: [10025.466434] device tun0 entered promiscuous mode
Sun May 21 19:04:24 2023 authpriv.info dropbear[26392]: Child connection from 172.16.1.1:44502
Sun May 21 19:04:24 2023 authpriv.info dropbear[26392]: Exit before auth from <172.16.1.1:44502>: Exited normally
# tcpdump -i tun0
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on tun0, link-type RAW (Raw IP), capture size 262144 bytes
19:04:24.102835 IP 172.16.1.1.44502 > 172.16.1.15.22: Flags [S], seq 2322423445, win 29200, options [mss 1358,sackOK,TS val 1534892693 ecr 0,nop,wscale 7], length 0
19:04:24.103137 IP 172.16.1.15.22 > 172.16.1.1.44502: Flags [S.], seq 3993150524, ack 2322423446, win 65160, options [mss 1460,sackOK,TS val 2206929105 ecr 1534892693,nop,wscale 4], length 0
19:04:24.116388 IP 172.16.1.1.44502 > 172.16.1.15.22: Flags [.], ack 1, win 229, options [nop,nop,TS val 1534892707 ecr 2206929105], length 0
19:04:24.122576 IP 172.16.1.1.44502 > 172.16.1.15.22: Flags [P.], seq 1:79, ack 1, win 229, options [nop,nop,TS val 1534892707 ecr 2206929105], length 78
19:04:24.122770 IP 172.16.1.15.22 > 172.16.1.1.44502: Flags [.], ack 79, win 4068, options [nop,nop,TS val 2206929124 ecr 1534892707], length 0
19:04:24.139822 IP 172.16.1.15.22 > 172.16.1.1.44502: Flags [P.], seq 1:411, ack 79, win 4068, options [nop,nop,TS val 2206929141 ecr 1534892707], length 410
19:04:24.141997 IP 172.16.1.15.22 > 172.16.1.1.44502: Flags [R.], seq 411, ack 79, win 4068, options [nop,nop,TS val 2206929143 ecr 1534892707], length 0
19:04:24.155042 IP 172.16.1.1.44502 > 172.16.1.15.22: Flags [.], ack 411, win 237, options [nop,nop,TS val 1534892745 ecr 2206929141], length 0
19:04:24.155243 IP 172.16.1.15.22 > 172.16.1.1.44502: Flags [R], seq 3993150935, win 0, length 0
19:04:32.406502 IP 172.16.1.1.46708 > 172.16.1.15.81: Flags [S], seq 41005334, win 29200, options [mss 1358,sackOK,TS val 1534900996 ecr 0,nop,wscale 7], length 0
19:04:32.406744 IP 172.16.1.15.81 > 172.16.1.1.46708: Flags [R.], seq 0, ack 41005335, win 0, length 0
Any clues?