- Industrial and IoT protocols often have no authentication: never expose them to the Internet.
- Segment OT networks from IT and use protocol-aware firewalls.
- Monitor with an ICS-aware intrusion detection system.
Port 4840: OPC UA Connection Protocol
Port 4840 is assigned by IANA to opcua-tcp (OPC UA Connection Protocol), opcua-udp (OPC UA Multicast Datagram Protocol).
How opcua-tcp works
IoT & industrial (ICS)A controller sends commands to an industrial device on port 4840, which acts on the physical process.
- Transport
- TCP · UDP
- Exposure risk
- not rated depends on the program listening
- Encryption
- Unknownnot stated by the registry
- IANA status
- Assigned2 registered services
- Range
- Registered (1024-49151)
- Category
- IoT & industrial (ICS)
Is port 4840 dangerous?
We have no specific security note for port 4840. Its risk depends on the program actually listening on it. General advice for iot & industrial (ics) services:
IANA registry entries for port 4840
| Service | Port | Transport | Description | Reference | Updated |
|---|---|---|---|---|---|
| opcua-tcp | 4840 | TCP | OPC UA Connection Protocol | - | 2018-01-04 |
| opcua-udp | 4840 | UDP | OPC UA Multicast Datagram Protocol | - | 2018-01-04 |
// source: IANA service name and port number registry
Which program uses port 4840, and is it reachable?
Linux
sudo ss -ltnup 'sport = :4840' # process listening on 4840
sudo lsof -nP -i :4840macOS
sudo lsof -nP -i :4840
Windows (PowerShell)
Get-NetTCPConnection -LocalPort 4840 -State Listen | Select LocalAddress, OwningProcess Get-NetUDPEndpoint -LocalPort 4840 netstat -ano | findstr :4840
From another machine
nmap -p 4840 -sV <host> sudo nmap -sU -p 4840 <host> nc -zv <host> 4840
Block it in the firewall
sudo ufw deny 4840/tcp # Linux (ufw) New-NetFirewallRule -DisplayName "Block 4840" -Direction Inbound -LocalPort 4840 -Protocol TCP -Action Block # Windows
What is port 4840 used for?
Port 4840 is assigned by IANA to opcua-tcp (OPC UA Connection Protocol), opcua-udp (OPC UA Multicast Datagram Protocol).
Is port 4840 TCP or UDP?
Port 4840 is registered for TCP and UDP.
Is it safe to open port 4840?
It depends on the program that listens on it. Open it only for a service you know and only to the networks that need it. Industrial and IoT protocols often have no authentication: never expose them to the Internet.
How do I check if port 4840 is open?
On Linux run "ss -ltnup 'sport = :4840'", on macOS "lsof -nP -i :4840", and on Windows "netstat -ano | findstr :4840" to see the local process. From another machine, "nmap -p 4840 <host>" shows whether it is reachable.