GRE

circle-info

GRE (Generic Routing Encapsulation) creates point-to-point tunnels that can carry various protocols over IP networks, commonly used for site-to-site connections and routing protocol transport.

In WinBox you can configure GRE in Interfaces -> GRE, or you can use terminal with command /interface gre

GRE provides a simple tunneling mechanism that encapsulates packets inside IP packets, allowing different network protocols to be transported over IP networks.


GRE fundamentals

How GRE works

Key characteristics:

  • Protocol 47 - GRE uses IP protocol number 47

  • Stateless - No connection state maintained

  • Bidirectional - Traffic can flow in both directions

  • No encryption - GRE itself provides no security (use with IPSec for encryption)

  • Low overhead - Minimal encapsulation overhead

Common use cases:

  • Site-to-site connectivity - Connect remote networks

  • Routing protocol transport - Carry routing protocols over internet

  • MPLS over IP - Transport MPLS traffic over IP networks

  • Multicast distribution - Distribute multicast traffic across WAN

  • Remote network access - Provide access to remote subnets


Basic GRE configuration

Simple point-to-point GRE tunnel

Create a basic GRE tunnel between two RouterOS devices:

Router A (Local: 203.0.113.10, Remote: 203.0.113.20):

Router B (Local: 203.0.113.20, Remote: 203.0.113.10):

Test connectivity


Advanced GRE configuration

GRE with keepalive

Enable keepalive to detect tunnel failures:

GRE over dynamic IP

For scenarios where one end has dynamic IP:

Multiple GRE tunnels

Create multiple tunnels for redundancy or load balancing:


GRE with routing protocols

OSPF over GRE

Extend OSPF across WAN using GRE:

BGP over GRE

Use GRE for BGP peering across internet:


GRE security with IPSec

Encrypt GRE traffic with IPSec

Since GRE provides no encryption, use IPSec for security:


GRE over NAT

Handle GRE behind NAT

GRE can be problematic behind NAT due to protocol 47:


Monitoring and troubleshooting

Monitor GRE tunnels

Troubleshoot GRE issues


Performance optimization

Optimize GRE performance

Load balancing with multiple tunnels


Common use cases

Site-to-site network extension

Remote office connectivity


chevron-rightShow complete GRE tunnel setuphashtag

Best practices

Design recommendations

  1. Use keepalives - Detect tunnel failures quickly

  2. Implement redundancy - Multiple tunnels for critical connections

  3. Secure tunnels - Use IPSec for encryption over untrusted networks

  4. Monitor actively - Watch for tunnel state changes

  5. Plan addressing - Use consistent tunnel addressing schemes

Security considerations

  1. Always encrypt - GRE provides no security by itself

  2. Firewall properly - Allow only necessary GRE traffic

  3. Use authentication - IPSec or other authentication mechanisms

  4. Monitor traffic - Watch for unusual patterns

  5. Regular maintenance - Keep tunnel configurations updated

Performance tips

  1. Optimize MTU - Account for GRE overhead

  2. Use hardware acceleration - When available

  3. Monitor bandwidth - Track utilization on tunnels

  4. Load balance - Use multiple tunnels for high bandwidth needs

  5. Minimize latency - Choose optimal routing paths

Last updated

Was this helpful?