I have a dumb AP on a different subnet than my "management" LAN. I need to be able to SSH into it from a device in the management LAN. I created this firewall rule to allow SSH to forward from the management LAN to the dumb AP:
config rule
option src 'lan'
option dest 'aplan'
option name 'Allow-SSH-AP'
option family 'ipv4'
list proto 'tcp'
list dest_ip '192.168.152.2'
option dest_port '22'
option target 'ACCEPT'
But this doesn't work as I expected (clearly I'm misunderstanding). I thought the firewall was stateful in that this rule would allow the forward and also allow the return traffic. But the return traffic is being dropped between lan
and aplan
according to tcpdump
:
# tcpdump -ni br-lan port 22 and not host 192.168.150.1
tcpdump: verbose output suppressed, use -v[v]... for full protocol decode
listening on br-lan, link-type EN10MB (Ethernet), snapshot length 262144 bytes
10:53:44.986328 IP 192.168.150.175.35390 > 192.168.152.2.22: Flags [S], seq 2914023664, win 64240, options [mss 1460,sackOK,TS val 623910729 ecr 0,nop,wscale 7], length 0
10:53:46.044082 IP 192.168.150.175.35390 > 192.168.152.2.22: Flags [S], seq 2914023664, win 64240, options [mss 1460,sackOK,TS val 623911787 ecr 0,nop,wscale 7], length 0
10:53:47.066956 IP 192.168.150.175.35390 > 192.168.152.2.22: Flags [S], seq 2914023664, win 64240, options [mss 1460,sackOK,TS val 623912810 ecr 0,nop,wscale 7], length 0
10:53:48.091457 IP 192.168.150.175.35390 > 192.168.152.2.22: Flags [S], seq 2914023664, win 64240, options [mss 1460,sackOK,TS val 623913834 ecr 0,nop,wscale 7], length 0
# tcpdump -ni br-aplan port 22
tcpdump: verbose output suppressed, use -v[v]... for full protocol decode
listening on br-aplan, link-type EN10MB (Ethernet), snapshot length 262144 bytes
10:54:52.702535 IP 192.168.150.175.46702 > 192.168.152.2.22: Flags [S], seq 3238024325, win 64240, options [mss 1460,sackOK,TS val 623978445 ecr 0,nop,wscale 7], length 0
10:54:52.703034 IP 192.168.152.2.22 > 192.168.150.175.46702: Flags [S.], seq 3272355192, ack 3238024326, win 65160, options [mss 1460,sackOK,TS val 1279495327 ecr 623978445,nop,wscale 7], length 0
10:54:53.755578 IP 192.168.150.175.46702 > 192.168.152.2.22: Flags [S], seq 3238024325, win 64240, options [mss 1460,sackOK,TS val 623979498 ecr 0,nop,wscale 7], length 0
10:54:53.756037 IP 192.168.152.2.22 > 192.168.150.175.46702: Flags [S.], seq 3272355192, ack 3238024326, win 65160, options [mss 1460,sackOK,TS val 1279496380 ecr 623978445,nop,wscale 7], length 0
10:54:54.779293 IP 192.168.150.175.46702 > 192.168.152.2.22: Flags [S], seq 3238024325, win 64240, options [mss 1460,sackOK,TS val 623980522 ecr 0,nop,wscale 7], length 0
Where 192.168.150.175 is my LAN client and 192.168.152.2 is the dumb AP. You can see in the second tcpdump that responses are coming back from the AP, but in the first tcpdump, they are not arriving to the management LAN.
What is my misunderstanding of how this rule works, and how can I make it work correctly?