I'm fiddling around in my lab today and attempting to learn more about port-forwarding. I've noticed that when I set up port-forwarding for a given port and run a port scan from outside the network, it doesn't list those ports as being open. Is this by design? Will a port scan only list a port as open if that port connects to a reachable service on a reachable host? Does a closed mean blocked (filtered)? Or does closed just essentially mean no service availability (nothing is listening)?
Sorry. Didn't realize it was equipment specific. I have a Ubiquiti Unifi USG Pro 4 configured with the following port-forwarding:
auto-firewall disable
hairpin-nat enable
lan-interface eth1
rule 3001 {
description "SCW HTTP"
forward-to {
address 10.15.72.245
}
original-port 81
protocol tcp_udp
}
rule 3002 {
description "SCW RTSP"
forward-to {
address 10.15.72.245
}
original-port 554
protocol tcp_udp
}
rule 3003 {
description "SCW Server"
forward-to {
address 10.15.72.245
}
original-port 8000
protocol tcp_udp
}
rule 3004 {
description "Lab Domain L2TP/IPSec VPN - 1"
forward-to {
address 10.15.72.34
}
original-port 1701
protocol udp
}
rule 3005 {
description "Lab Domain L2TP/IPSec VPN - 2"
forward-to {
address 10.15.72.34
}
original-port 500
protocol udp
}
rule 3006 {
description "Lab Domain L2TP/IPSec VPN - 3"
forward-to {
address 10.15.72.34
}
original-port 4500
protocol udp
}
wan-interface eth0
I got curious because all of my SCW (Security Cameras) ports show as open on my scan but they also point to an active service on the network. I am in the process of trying to figure out how to setup an L2TP/IPSec VPN to my Windows Server so I created port forwards for UDP ports 500, 1701, and 4500 per the Ubiquiti documentation. Whenever I run an external port scan, however, those ports still show as closed. I've been unsuccessful in my VPN connection attempts up until now, although my tcpdump is now capturing some traffic when I try to connect via the Windows 10 VPN client. Just need to figure out where the breakdown is happening but that is an entirely different question. I was mainly just curious as to why the UDP for my VPN connection show as close but I am apparently able to receive traffic on them.