Tunneling is a technique used in networking to encapsulate one type of data packet inside another, allowing it to traverse incompatible networks or provide additional functionalities like security and segmentation.
Connect Non-Directly Connected Networks:
Provide Additional Network Segmentation:
Multicast Traffic Support:
Overlay Networking:
Tunnel interfaces in Junos are not created generically; they are built using specific interface families based on tunnel type.
GRE tunnels are configured using interfaces with the ip-over-gre type.
IP-IP tunnels use the ipip family and are bound to interfaces typically named ip- or gr-.
In Junos, GRE tunnels are configured using ip-over-gre interfaces, while IP-IP tunnels use the ipip family.
Example GRE Configuration Snippet:
set interfaces gr-0/0/0 unit 0 tunnel source 192.0.2.1
set interfaces gr-0/0/0 unit 0 tunnel destination 192.0.2.2
set interfaces gr-0/0/0 unit 0 family inet address 10.10.10.1/30
Exam Tip:
You may see a configuration like the above and be asked to identify the tunnel type.
To ensure resilience and stability, tunnel endpoints are often bound to loopback interfaces, which remain up even if physical interfaces flap. This is particularly useful in multi-path and high-availability designs.
It is recommended to use a loopback interface as the source IP for tunnel endpoints to ensure stability during link failover.
Benefits:
The tunnel remains reachable as long as IGP can route to the loopback.
Avoids unnecessary tunnel re-establishment when physical links change.
Example:
set interfaces gr-0/0/0 unit 0 tunnel source lo0.0
Exam Tip:
A question may ask:
“Which interface is most suitable as a tunnel source to ensure stability?”
Correct answer: Loopback
Both GRE and IP-IP tunnels add encapsulation headers to the original packet, increasing the overall size. If this size exceeds the interface MTU, IP fragmentation may occur or the packet may be dropped.
Tunnel encapsulation increases packet size, which may lead to fragmentation if MTU is not properly adjusted.
Typical Header Overheads:
GRE: +24 bytes (IP + GRE headers)
IP-IP: +20 bytes (IP header)
Mitigation Strategies:
Lower the MTU on the ingress interface of the tunnel.
Use Path MTU Discovery (PMTUD).
Adjust the TCP MSS (Maximum Segment Size) using firewall filters or system-level settings.
Exam Tip:
Expect questions testing your knowledge of tunnel overhead and its impact on packet delivery.
GRE alone does not provide encryption, but it can encapsulate multiple Layer 3 protocols, making it ideal for transporting dynamic routing updates or multicast traffic. For security, it’s commonly combined with IPSec.
GRE tunnels can be secured using IPSec to combine multiprotocol encapsulation with encryption.
How it works:
GRE encapsulates the original packet.
IPSec encrypts the GRE packet for confidentiality and integrity.
This allows dynamic routing protocols to run inside encrypted tunnels.
Use Case:
Dynamic routing between sites using OSPF or EIGRP over a secure channel.
Carrying multicast traffic across secure WANs.
Exam Tip:
You may be asked:
“Why would an engineer choose to run GRE over IPSec?”
Correct answer: To enable encryption and support for non-IP protocols or dynamic routing.
GRE and IP-IP are point-to-point tunnels. Both require explicit configuration of the remote peer address. There is no mechanism for dynamic discovery or automatic neighbor establishment.
Tunnel endpoints must be explicitly defined; no automatic discovery or dynamic neighbor establishment exists.
This contrasts with routing protocols like OSPF or BGP, where neighbor relationships can be discovered or negotiated dynamically.
Example:
set interfaces ip-0/0/0 unit 0 tunnel destination 203.0.113.2
Exam Tip:
You might see a statement like:
“GRE dynamically learns its remote endpoint address.”
This would be false.
| Topic | Key Insight |
|---|---|
| Junos Tunnel Interfaces | GRE uses ip-over-gre; IP-IP uses ipip family |
| Tunnel Source Best Practice | Use loopback interfaces to ensure tunnel persistence across physical link changes |
| MTU and Fragmentation | Encapsulation increases packet size; adjust MTU or MSS to prevent issues |
| GRE over IPSec | GRE provides encapsulation; IPSec adds encryption; common for dynamic VPNs |
| Tunnel Peer Discovery | GRE/IP-IP are point-to-point; endpoints must be manually defined |
What is the purpose of a GRE tunnel?
A GRE tunnel encapsulates packets so they can traverse another network.
Generic Routing Encapsulation (GRE) wraps an original packet inside another IP header. This allows packets to travel across networks that would otherwise not support that protocol.
GRE is commonly used to connect remote networks or transport multicast traffic across non-multicast networks.
Demand Score: 68
Exam Relevance Score: 80
Why are tunnels useful when running dynamic routing protocols?
Tunnels create a logical point-to-point link between routers.
Many routing protocols assume routers are directly connected. Tunnels allow routers separated by intermediate networks to appear directly connected.
This enables routing protocols such as OSPF or IS-IS to exchange updates even when routers are not physically adjacent.
Demand Score: 65
Exam Relevance Score: 78
What is a common troubleshooting step when a GRE tunnel fails?
Verify that the tunnel source and destination are reachable.
GRE tunnels rely on IP connectivity between endpoints. If the underlying path fails, the tunnel cannot operate.
Administrators should verify reachability with ping or traceroute and check routing table entries.
Demand Score: 64
Exam Relevance Score: 77