Moving camera traffic to a separate VLAN is half the job. The other half is deciding which traffic to allow between this segment and the rest of the network. A common rule is the line “everything allowed with the recording server”; this line leaves segmentation on paper. Below we explain how to map the real flows between cameras, NVR/VMS and infrastructure services into a matrix by port and protocol, derive least-privilege ACLs from this matrix, a Cisco IOS example and verifying rules with counters.
Traffic flows in a camera system
In corporate camera systems, before building the matrix you need to read the direction of flows correctly; a rule is written based on who initiates the connection. If the direction is wrong, so is the rule.
- Recording server → camera: the RTSP session (DESCRIBE, SETUP, PLAY), ONVIF/HTTP(S) configuration and PTZ commands. The recording server initiates the connection.
- Camera → recording server: if RTP/UDP is used, media packets go from the camera to the client ports the server announced during SETUP. If event notification is in push mode, the camera initiates a connection to the VMS’s event port.
- Management station → camera: the web interface or the manufacturer’s management tool.
- Camera → infrastructure: DHCP, NTP, DNS if used, syslog, SMTP.
- Monitoring system → camera: SNMP polling, ICMP; SNMP traps from the camera to the monitoring server.
- Client → recording server: operators and mobile clients connect to the VMS, not the camera. Direct viewer access to cameras isn’t in the matrix.
The last item is the backbone of the design: only the recording server, management stations and the monitoring system access the camera segment. We explained the reasoning behind segmentation in the why a camera VLAN is needed article.
Port and protocol matrix: RTSP, ONVIF, HTTP(S), NTP
The table shows common defaults. Ports vary by camera and VMS manufacturer; fill in the table with values you’ve verified in your own installation.
| Source → Destination | Protocol / port | Purpose | Note |
|---|---|---|---|
| Recording server → camera | TCP 554 | RTSP session | RTSP 1.0 default port |
| Camera → recording server | UDP, dynamic | RTP/RTCP media | Port range comes from the VMS setting |
| Recording server → camera | TCP 80 / 443 | ONVIF, configuration, PTZ | Only 443 where possible |
| Management → camera | TCP 443 | Web interface | Specific stations |
| Camera → NTP server | UDP 123 | Time synchronization | Critical for recording timestamps and certificate validity |
| Camera → DHCP | UDP 67/68 | Address assignment | Not needed with static addresses |
| Monitoring → camera | UDP 161, ICMP | SNMP polling, availability | SNMPv3 preferred |
| Camera → syslog / monitoring | UDP 514, UDP 162 | Logs and SNMP traps | TCP 6514 for syslog over TLS |
| Camera ↔ camera segment | UDP 3702 multicast | ONVIF WS-Discovery | Not carried outside the segment |
RTSP’s streaming behavior is defined in RFC 2326: in the SETUP request the client announces client_port, the camera announces server_port in its response, and RTP and RTCP use two consecutive UDP ports. That’s why the media port is written in the rule not as a fixed value but as the client port range the VMS uses. The typical cause of the field fault “no video, but the RTSP connection is up” is allowing 554 and forgetting the UDP media range. For ports that change when moving to RTSPS and HTTPS, see the HTTPS and certificate management on IP cameras and NVRs guide. If live viewing is distributed via multicast, IGMP and multicast group addresses also go into the matrix; we covered this scenario in the multicast and IGMP snooping on the camera network article.
How to identify manufacturer-specific ports
Besides standard ports, many cameras and NVRs open additional ports for their own client software or SDK; for example, with some manufacturers TCP 8000 or TCP 37777 are default SDK ports. VMS products also use their own ports for the recording server, management server, mobile server and event service. Three sources are used together for identification:
- Manufacturer documentation: the port list from the VMS and camera manufacturer. Since it can change between versions, use the documentation for the version you run.
- Lab scan: scan all TCP ports on a test camera and determine what each open port belongs to. Disabling an unnecessary port on the camera is better than adding it to a rule.
- Real traffic: take a packet capture while adding a camera to the VMS and during live viewing, playback, PTZ and event tests. Documentation can be incomplete. A packet capture doesn’t lie.
# All TCP ports on the test camera in the lab
nmap -Pn -sT -p- 10.20.30.250
# RTSP connections established with cameras on a Windows-based recording server
Get-NetTCPConnection -RemotePort 554 -State Established |
Select-Object LocalAddress, LocalPort, RemoteAddress
# The same check on a Linux-based recording server
ss -tn state established '( dport = :554 )'
ONVIF discovery (WS-Discovery) relies on multicast queries sent over UDP 3702 to 239.255.255.250 and normally doesn’t cross the VLAN boundary. If the recording server is in a different VLAN, add cameras by IP address; don’t open the segment boundary for discovery. Details of ONVIF’s service and profile structure are in the ONVIF specifications.
Deriving ACL rules from the matrix
Every row in the matrix becomes a rule; no flow not in the matrix is allowed. Follow these principles when deriving them:
- Narrow source and destination: “camera network → recording server IPs” instead of “camera network → any”. Use an object group for the recording server cluster.
- Set the direction correctly: in a stateless ACL, the
establishedkeyword can be used for TCP traffic returning from the camera. It only looks at the ACK/RST flags and doesn’t do real session tracking; use it knowingly. - Simplify media transport: if the VMS and camera support it, carrying RTP over TCP inside the RTSP connection (interleaved) removes UDP port ranges from the rules. The price is that TCP retransmission on packet loss can cause delay and stutter; on a local network this is usually acceptable.
- Don’t forget within the segment: an ACL on the SVI doesn’t see camera-to-camera traffic within the same VLAN. Cutting cameras’ access to each other requires a layer 2 method (on Cisco,
switchport protected, private VLANs or VLAN access maps). - Deny internet egress explicitly: even if there’s an implicit deny at the end of the list, defining egress from the camera network to the internet as a separate, logged rule on the firewall makes monitoring easier.
Example ACL configuration
Example topology: camera VLAN 10.20.30.0/24 (Vlan30), recording server 10.20.40.10, NTP 10.20.40.5, syslog 10.20.40.6, monitoring server 10.20.40.7, DHCP server 10.20.40.3, management stations 10.20.50.0/28. The VMS’s RTP client port range is taken as 50000–50999 for the example. Addresses and port ranges are examples.
ip access-list extended CAMERA-IN
remark M01-M02 camera -> recording server: RTSP and HTTPS replies
permit tcp 10.20.30.0 0.0.0.255 eq 554 host 10.20.40.10 established
permit tcp 10.20.30.0 0.0.0.255 eq 443 host 10.20.40.10 established
remark M03 camera -> recording server: RTP/RTCP
permit udp 10.20.30.0 0.0.0.255 host 10.20.40.10 range 50000 50999
remark M04 camera -> management: HTTPS replies
permit tcp 10.20.30.0 0.0.0.255 eq 443 10.20.50.0 0.0.0.15 established
remark M05-M08 infrastructure services
permit udp any eq bootpc any eq bootps
permit udp 10.20.30.0 0.0.0.255 host 10.20.40.5 eq ntp
permit udp 10.20.30.0 0.0.0.255 host 10.20.40.6 eq syslog
permit udp 10.20.30.0 0.0.0.255 eq snmp host 10.20.40.7
permit udp 10.20.30.0 0.0.0.255 host 10.20.40.7 eq snmptrap
permit icmp 10.20.30.0 0.0.0.255 host 10.20.40.7 echo-reply
deny ip any any log
!
ip access-list extended CAMERA-OUT
permit tcp host 10.20.40.10 10.20.30.0 0.0.0.255 eq 554
permit tcp host 10.20.40.10 10.20.30.0 0.0.0.255 eq 443
permit udp host 10.20.40.10 range 50000 50999 10.20.30.0 0.0.0.255
permit tcp 10.20.50.0 0.0.0.15 10.20.30.0 0.0.0.255 eq 443
permit udp host 10.20.40.5 eq ntp 10.20.30.0 0.0.0.255
permit udp host 10.20.40.7 10.20.30.0 0.0.0.255 eq snmp
permit icmp host 10.20.40.7 10.20.30.0 0.0.0.255 echo
deny ip any any log
!
interface Vlan30
ip helper-address 10.20.40.3
ip access-group CAMERA-IN in
ip access-group CAMERA-OUT out
The M01, M02… values in the remarks are matrix row numbers; in an audit, you can trace which business need each rule came from. In this example, HTTP (80) is deliberately absent; if your VMS uses HTTP for ONVIF, either move the VMS to HTTPS or add the rule for the recording server only. If event notification is in push mode, a rule from the camera to the VMS event port must also be added. There’s no rule in the outbound list for DHCP replies: when ip helper-address is used, the server reply comes to the switch’s own address and the switch itself generates the packet going to the camera; on Cisco IOS, traffic generated by the device itself isn’t subject to the outbound ACL. On a stateful firewall, the same logic is written with fewer rules: only the direction initiating the connection is defined, and return traffic is tracked from the session table.
Rule verification and testing
- Function test: for each camera group, live viewing, recording, playback, PTZ, event alarms, time sync and the monitoring system’s access are checked one by one.
- Counter check: look at the hit count of each line with
show ip access-lists CAMERA-IN. A permit rule that gets no hits is either unnecessary or written wrong; unexpected hits on the deny line point to a missing flow or unwanted behavior. - Negative test: access to cameras is attempted from a test client on the user network; the result should be “filtered”.
- Log review: the
logkeyword sends matching packets to the processor, and logging is rate-limited. Use it during commissioning; afterwards, do ongoing monitoring with flow data or firewall logs.
# Negative test from a test client on the user network
nmap -Pn -p 80,443,554,8000,37777 10.20.30.12
To monitor traffic hitting the deny line as a security event, you can use the alarm rules in the anomaly monitoring on the camera network guide together with this matrix.
Change management and documentation
- A single source of truth: the matrix is a table or file kept under version control. ACL and firewall rules are derived from it, not the other way round.
- An owner and justification on every row: for which system, who requested it, until what date it’s valid.
- Change triggers: a new VMS version, a new camera model, moving the recording server and a new integration (access control, analytics server) require a matrix update.
- Periodic review: rules with no hits and expired temporary permits are cleaned up. For the general approach to rule cleanup, the firewall rule cleanup article is complementary.
To build the traffic matrix for camera segments, design ACL and firewall rules and carry out commissioning tests together, see our camera VLAN and network segmentation and camera cybersecurity hardening services.
Frequently asked questions
Is there a standard port list for IP cameras?
Partly. TCP 554 for RTSP, 80 for HTTP, 443 for HTTPS, UDP 123 for NTP and UDP 3702 for ONVIF discovery are common defaults. RTP media ports, however, are set dynamically in the session; manufacturer-specific SDK ports and VMS ports also vary. The list must be verified in every installation.
Why doesn’t ONVIF discovery work from another VLAN?
ONVIF device discovery uses WS-Discovery queries sent over UDP 3702 to the multicast address 239.255.255.250, and this traffic normally doesn’t pass through routers. If the recording server is in a different VLAN, add cameras by IP address; don’t open the segment boundary for discovery.
Can cameras be prevented from talking to each other within the camera VLAN?
Yes. An ACL on the SVI doesn’t see traffic within the same VLAN. To cut camera-to-camera traffic, layer 2 methods are used, such as switchport protected, private VLANs or VLAN access maps on Cisco; after the design, test that access to the recording server and gateway isn’t broken.
Should a stateless ACL or a firewall be used?
For small, one-way flows, a switch ACL may be enough. Once RTP/UDP media, dynamic ports and event notifications come into play, a stateful firewall or a setup that carries RTSP over TCP reduces the number of rules and the margin for error.