Before I can migrate to my CCR1036 I need to get port forwarding working. I am trying to get port 22 forwarded and the traffic is being lost somehow.
A brief description of my setup, I have 4 VLANs that are all bridged. Ether1 is my WAN, SFP+1/2 are both trunks, the rest of the ethernet ports are all access ports for one of the VLANs. From a PC on the network I can SSH into the target machine fine.
So onto the configuration, here is my NAT setup:
0 chain=dstnat action=dst-nat to-addresses=192.168.0.2 to-ports=22 protocol=tcp in-interface=ether1 dst-port=22
log=yes log-prefix="NAT"
1 chain=srcnat action=masquerade dst-address=0.0.0.0/0 out-interface=ether1
And here are my firewall rules:
1 ;;; FastTrack
chain=forward action=fasttrack-connection connection-state=established,related
2 ;;; Established, Related
chain=forward action=accept connection-state=established,related
14 ;;; WAN: Accept all DST-NAT traffic
chain=forward action=accept connection-state=new connection-nat-state=dstnat in-interface=ether1 log=yes
log-prefix="WAN: ACCEPT"
I filtered out some of the rules that weren’t related, I will include them if desired. All the drop rules I added a log action to and don’t see them applying to this traffic.
When I look at the logs I see this output:
NAT dstnat: in:ether1 out:(unknown 0), 192.168.100.47:58072->192.168.64.254:22, len 52
WAN: ACCEPT forward: in:ether1 out:vlan10, 192.168.100.47:58072->192.168.0.2:22, NAT 192.168.100.47:58072->(192.168.64.254:22->192.168.0.2:22), len 52
WAN: ACCEPT forward: in:ether1 out:vlan10, 192.168.100.47:58072->192.168.0.2:22, NAT 192.168.100.47:58072->(192.168.64.254:22->192.168.0.2:22), len 52
WAN: ACCEPT forward: in:ether1 out:vlan10, 192.168.100.47:58072->192.168.0.2:22, NAT 192.168.100.47:58072->(192.168.64.254:22->192.168.0.2:22), len 52
WAN: ACCEPT forward: in:ether1 out:vlan10, 192.168.100.47:58072->192.168.0.2:22, NAT 192.168.100.47:58072->(192.168.64.254:22->192.168.0.2:22), len 52
WAN: ACCEPT forward: in:ether1 out:vlan10, 192.168.100.47:58072->192.168.0.2:22, NAT 192.168.100.47:58072->(192.168.64.254:22->192.168.0.2:22), len 52
So I can see that the NAT is working and I think the firewall is letting the traffic through but I can’t establish an SSH connection. As a troubleshooting step, I used ping from winbox and I can ping the target server, but if I use the Telnet(SSH) function from winbox, I can’t establish a connection from the router to the target machine. Not sure what is going on.