A network tunnel wraps network traffic inside other traffic, so it can cross networks it could not cross alone.
This guide is for anyone who has heard of VPNs or SSH tunnels and wants to know what a tunnel really is. You do not need to set one up to be affected: tunnels carry your work traffic, and attackers can use them to hide theirs.
In short
- A tunnel puts one packet of data inside another, like a letter inside a second envelope. This is called encapsulation.
- VPNs, SSH tunnels and some cloud and mesh networking tools all use this idea.
- Many tunnels also scramble the inner traffic, so people on the way cannot read it.
- The same trick can hide an attacker's traffic, so teams should know which tunnels are allowed, and who or what holds the keys that open them.
What you will learn
- Explain encapsulation in plain words.
- Describe how a VPN and an SSH tunnel use the same idea.
- Spot why an unknown tunnel on a work network is a warning sign.
- Ask who owns the keys and accounts that tunnels use.
- Wrapping (encapsulation)
- putting one data packet inside another, so the outer one carries it.
- Data packet
- a small chunk of data with an address on the front, sent across a network.
- Secure remote connection (SSH)
- a protected way to connect to another computer, often used by IT teams.
What is a network tunnel?
Think of a letter sealed inside a second envelope. The post office only reads the outer address. When the outer envelope arrives, someone opens it and sends the inner letter on.
A network tunnel works the same way. Each data packet is a small chunk of data with an address on it. A tunnel takes a packet, wraps it inside another packet with a new address, and sends it. This wrapping is called encapsulation. One internet standard calls the inner packet the payload and the outer layer the delivery protocol [1].
At the far end, the tunnel unwraps the packet and passes the inner one on. To the networks in between, only the outer packet is visible.
Where the comparison stops working: a paper envelope can be held up to the light. Many tunnels also encrypt the inner packet, which means scrambling it so that only the far end can read it. Some tunnels do not encrypt at all.
For VPNs in everyday use, start with VPNs for Beginners. This page looks at the tunnel idea underneath.
Why does it matter?
Tunnels let staff reach work systems safely from home. They can also let an attacker slip traffic past network checks.
If you work from home
What could happen: your laptop sends some traffic outside the work tunnel, where it is less protected.
Check this: ask IT whether all your work traffic goes through the VPN.
If you are new to IT work
What could happen: a quick tunnel you set up for testing stays open, with a key nobody remembers.
Check this: record every tunnel you open, who owns it and when it should close.
Next: SSH Keys for Beginners
If you manage a small network
What could happen: an attacker hides traffic inside a normal-looking connection to avoid your filters.
Check this: keep a list of approved tunnels and look into any others.
What does it look like?
Here is a made-up view of one wrapped packet. It shows what the outside world sees and what is hidden.
Example only. All values are made up.
OUTER packet (what networks on the way see) From: home-laptop.example.invalid (1) To: vpn-gateway.example.com (2) Body: [scrambled data] (3) INNER packet (seen only after unwrapping) From: laptop on the work network To: files.example.invalid (4) Body: "Q3-plan-FAKE.docx"
- The sender on the outside is the laptop at home.
- The outer packet is addressed to the tunnel's far end, a VPN gateway.
- The inner packet travels here, scrambled.
- The inner packet's true goal: the work file server.
Why this is risky: a filter that only reads the outer address cannot see what is inside. That helps privacy, but it can also hide misuse.
The safer way: allow only tunnels your team approved, to known endpoints, and log who uses them.
How does it work?
- The two ends agree to talk. Each end proves who it is, often with a key or certificate. A certificate is a digital ID card for a device or service.
- The sender wraps the packet. It puts the original packet inside a new one addressed to the far end [1].
- The inner packet is often scrambled. VPNs create an encrypted link across a network you do not trust [2].
- The far end unwraps it. It removes the outer layer and sends the inner packet on to where it was going.
- Replies come back the same way. They are wrapped at the far end and unwrapped at your device.

Common kinds of tunnel
- VPNs. The UK National Cyber Security Centre names two main families, one called IPsec and one built on TLS, the same protection used by secure websites [2].
- SSH tunnels. SSH is a protected way to connect to another computer. Its standard lets it carry other connections through the same encrypted link, called port forwarding [3].
- Mesh networks. Some newer tools link each device directly to the others with their own tunnels. See Mesh VPNs for Beginners.
- DNS tunnels. These hide data inside the lookups computers make to find websites. They are mostly seen in misuse. See DNS Tunnelling for Beginners.
How attackers misuse tunnels
MITRE, a US research body that tracks attacker behaviour, describes how attackers may wrap their traffic inside another protocol. This can help them avoid detection and network filters, or reach systems that are not normally reachable [4]. It names SSH tunnelling as one example [4].
Every tunnel needs something to open it, such as an SSH key, a certificate or a token. These are credentials held by software, a kind of non-human identity. If they leak or are never removed, the tunnel can stay usable after it should have closed.
The NCSC also warns that VPN services are part of what an organisation exposes to the internet. It advises applying security updates to them quickly [2].
A worked example
This story is made up to show the idea.
Idris Okafor is the only IT person at a small accountancy firm. Staff reach the office file server through the firm's VPN, which he set up with a supplier.
One Monday, Idris looks at the firewall's list of outgoing connections. Most are what he expects. One is not. An office computer has kept a long connection open to an unknown server on the internet, all weekend.
Idris does not know what it is, so he asks the supplier for help. They find a remote support tool that a contractor installed months ago. It opens its own tunnel out of the office, so the contractor can connect in without the VPN.
The tool still works, and it uses a saved key that nobody has changed. Anyone holding that key could reach the office network through the tunnel.
Idris and the supplier remove the tool and cancel its key. They block outgoing connections to tunnel services the firm has not approved. Idris writes down every approved tunnel: the staff VPN and one link to the payroll provider.
Each entry now has an owner, the key or certificate it uses and a review date. Idris checks the firewall list every month for anything new.
Myths and mistakes
| What people think | What is true |
|---|---|
| A tunnel always means the traffic is encrypted. | Wrapping and scrambling are separate. Some tunnels only wrap the traffic.[1] |
| If traffic is in a tunnel, it must be safe. | A tunnel protects traffic on the way. It does not tell you whether the people or programs at each end are trustworthy. |
| Only VPNs make tunnels. | SSH, remote support tools, mesh networks and even website lookups can carry tunnels. |
| A tunnel nobody uses is harmless. | An old tunnel with a working key can still be opened by whoever holds the key. |
| Blocking a few known tools stops all tunnels. | Tunnels can look like normal traffic. An approved list and monitoring help more than a block list alone. |
What can I do this week?
- Write down the tunnels your team uses on purpose, such as the staff VPN.
- Note who owns each one and which key, certificate or account opens it.
- Check that your VPN equipment has its latest security updates.
- Ask whether any remote support tools are installed, and who approved them.
- Read VPNs for Beginners for the everyday side of VPNs.
Checklist
- I can explain a tunnel as one packet wrapped inside another.
- I know that wrapping and scrambling are not the same thing.
- We keep a list of approved tunnels and their owners.
- Each tunnel's key, certificate or account has an owner and a review date.
- Old or unused tunnels are closed and their keys cancelled.
- Our VPN equipment gets security updates quickly.
- Someone checks for unexpected long-lived outgoing connections.
Common questions
Is a VPN the same as a tunnel?
A VPN is one kind of tunnel. It wraps your traffic and usually encrypts it, then sends it to a VPN server or gateway. Other tunnels, such as SSH tunnels or mesh network links, use the same wrapping idea for different jobs.
What is an SSH tunnel used for?
IT staff use SSH tunnels to reach a service on another computer through a protected SSH link. For example, an administrator might reach an internal tool that is not open to the internet. Each tunnel should be approved, logged and closed when no longer needed.
Why would an attacker use a tunnel?
To hide. Wrapping their traffic inside a normal-looking connection can help attackers get past network filters and reach systems that are usually out of reach. That is why unknown tunnels on a work network deserve a closer look.
Can my employer see inside the work VPN?
Often, yes. The tunnel protects traffic between your device and the work gateway. Once it is unwrapped at work, the organisation's own tools may check it. Ask your IT team what they monitor and why.
Do tunnels need passwords?
They need something to prove each end is allowed. That is usually a key, certificate or token, not a typed password. These are held by software, so they need owners, safe storage and regular review like any other credential.
Where next?
Ready for the detail? Read the practitioner guide: T1572 Protocol Tunnelling Defensive Guide. It goes further into how defenders detect misused tunnels, which logs to watch and how to control outgoing traffic.
Also useful:
- VPNs for Beginners
- DNS Tunnelling for Beginners
- Mesh VPNs for Beginners
- Site-to-Site VPNs for Beginners
Related NHI Mgmt Group resources: SSH Keys for Beginners, Remote Access Tools for Beginners and Non-Human Identities for Beginners.
Key terms
- Protocol tunnelling
- Carrying one kind of network traffic inside another kind.
- VPN
- An encrypted tunnel between a device and a private network.
- IPsec
- A set of standards that checks and encrypts network traffic, widely used for VPNs.
- SSH tunnelling
- Carrying other traffic inside an encrypted SSH connection between two computers.
- Split tunnelling
- A VPN setup where only some traffic goes through the work tunnel.
- SSH key
- A pair of linked keys a person or program uses to prove it may connect over SSH.
- Egress filtering
- Limiting which outgoing connections a device or network may make.
Sources and further reading
- D. Farinacci and others, "Generic Routing Encapsulation (GRE)", RFC 2784, IETF, March 2000. https://www.rfc-editor.org/rfc/rfc2784 (accessed 1 Dec 2026).
- National Cyber Security Centre, "Virtual Private Networks (VPNs)", Device security guidance, version 2.1, last reviewed 13 May 2025. https://www.ncsc.gov.uk/collection/device-security-guidance/infrastructure/virtual-private-networks (accessed 1 Dec 2026).
- T. Ylonen and C. Lonvick, "The Secure Shell (SSH) Connection Protocol", RFC 4254, section 7, IETF, January 2006. https://www.rfc-editor.org/rfc/rfc4254#section-7 (accessed 1 Dec 2026).
- MITRE ATT&CK, "Protocol Tunneling, Technique T1572", Enterprise ATT&CK v20. https://attack.mitre.org/techniques/T1572/ (accessed 1 Dec 2026).