(GRE ) Generic Routing Encapsulation Protocol Configuration on Router
The Generic Routing Encapsulation (GRE) protocol is used to create point-to-point connections between routers or to create virtual private networks (VPNs) over existing networks. It allows the encapsulation of a wide variety of network layer protocols into point-to-point connections. Here are the commands to configure GRE on a Cisco router, along with descriptions and a use case:
Use Case for GRE on a Router: Let's consider a scenario where you have two remote offices, Office A and Office B, and you want to create a secure and private network connection between them over the public internet. GRE can be used to establish this virtual private network.
1. Access Configuration Mode:
- Description: Access the router's command-line interface (CLI) and enter configuration mode.
bashRouter> enable
Router# configure terminal
2. Configure the Tunnel Interface:
- Description: Create a tunnel interface for GRE encapsulation and specify the source and destination IP addresses for the tunnel.
bashRouter(config)# interface tunnel tunnel_number
Router(config-if)# ip address source_ip_address subnet_mask
Router(config-if)# tunnel source source_interface
Router(config-if)# tunnel destination destination_ip_address
- Example:
bashRouter(config)# interface tunnel 0
Router(config-if)# ip address 192.168.1.1 255.255.255.0
Router(config-if)# tunnel source GigabitEthernet0/0
Router(config-if)# tunnel destination 203.0.113.1
- Description:
tunnel_number: Specify a unique tunnel number.source_ip_address: The local IP address for the tunnel interface.source_interface: The source interface for the tunnel.destination_ip_address: The remote endpoint's IP address.
3. Enable the Tunnel Interface:
- Description: Bring the tunnel interface up.
bashRouter(config-if)# tunnel mode gre ip
Router(config-if)# no shutdown
4. Configure Routing and Routing Protocols (Optional):
- Description: If you intend to use the GRE tunnel to pass routing information between the two remote offices, you'll need to configure routing on both routers and potentially use a routing protocol (e.g., OSPF, EIGRP, BGP) over the GRE tunnel.
5. Verify the GRE Configuration:
- Description: To verify the GRE configuration on the router, use the following command:
bashRouter# show interface tunnel tunnel_number
- Description: This command displays the status and configuration details of the GRE tunnel interface.
6. Save the Configuration:
- Description: After configuring GRE, be sure to save the configuration to the startup configuration to ensure it persists after a reboot.
bashRouter# write memory
In this use case, GRE is configured on routers at Office A and Office B to create a secure and private network connection between the two remote offices over the public internet. GRE encapsulates the data traffic, allowing it to traverse the internet securely. The routers can then route traffic between the offices, providing a private network connection despite the data traversing a public network.
Comments
Post a Comment