How to configure GRE Tunnel on Cisco IOS Router

Thanks Alfredo! That means a lot to me, glad to hear you like it!

Hi Rene,

Could you please answer this would be appreciated…

When configuring eigrp or ospf process under the configuration do you advertise your own address to?
how comes you did not configure a router protocol i.e. eirgrp or ospf with isp router?
could you have used a routing protocol instead of static routes when reaching other areas?
when i do configure eigrp network with 0.0.0.0 statement my tunnel do not come up?

thank you

Hi Adil,

In this example I used a static route on the HQ and Branch router so HQ knows how to reach 192.168.23.3 and Branch knows how to reach 192.168.12.1. These two addresses are required since we use them to establish the Tunnel.

Instead of the static routes you could use a routing protocol but then you also need to enable routing on the ISP router.

Once the tunnel is up and running, I run EIGRP on the tunnel interface so that HQ and Branch can learn about each others loopback interfaces.

Rene

Thank You much appreciated, however under the router eigrp command for example how comes you do not advertise the other Lo0 address of Branch router for example:

Example:

HQ(config)#router eigrp 13    
HQ(config-router)#no auto-summary 
HQ(config-router)#network 192.168.13.0
HQ(config-router)#network 172.16.1.0
HQ(config-router)#network  172.16.3.0 (Add command?)

And likewise for The branch router? (Sorry basic’s just want to get an understanding how we only advertise it’s own network interfaces and why not the destination networks under routing protocols i.e. eigrp or ospf?

Hi Adil,

The network command doesn’t work like that. Here’s how it works:

  • Any network on an active interface of your router will be advertised if it falls within the range of your network command.
  • Besides being advertised, routing updates will be sent out of this interface.

So for example:

HQ(config)#router eigrp 13    
HQ(config-router)#no auto-summary 
HQ(config-router)#network 192.168.13.0
HQ(config-router)#network 172.16.1.0

On our HQ router, any interface that falls within 192.168.13.0 will have its network advertised and we send EIGRP hello packets on this interface (to form neighbor adjacency), that’s the Tunnel interface.

The same thing applies to 172.16.1.0, the loopback falls within this range.

You can’t use “network 192.168.3.0” on the HQ router, it doesn’t have any interfaces that have a network in this range.

Here’s an in depth explanation of the network command btw:

Rene

Thanks Again, really appreciate this for clarifying. Keep up the good work :slight_smile:

You are welcome!

Hi Rene,

I tried using ospf instead of eigrp for this however it didn’t seem to like this and did not come up?

Regards

Hi Adil,

You can use any routing protocol on the tunnel interfaces, it doesn’t matter. Did the tunnel not come up? I used two static routes for reachability for the tunnel source IP addresses.

Rene

Hi yes, i configured this however the tunnel did not come up. Will re-test this again but it did work for eigrp.

Hi Rene,

We have a gre set up in our network however, we are seeing one side only drop intermitterly stated line protocol down…also at the same time the router it’s self is hanging really badly…what troublshooting step could i possibly do to find out if the gre it’s self is at fault or the router but i cannot do a debug on it? thank you

Adil

Hi Adil,

Hmm when the router is hanging, is it not responding for a few seconds and then fast again? Or is it really slow all the time?

There are two possible scenarios that I can think of:

  1. Recursive routing issues:
    https://networklessons.com/cisco/gre-tunnel-recursive-routing-error/

  2. Maybe your router is handling some packets in software, this could cause the CPU to spike to 100% which makes the router (very) slow…

You could check the CPU load of your router with “show processes”. It should be pretty low, if it’s above 50% or so then there’s something to troubleshoot :slight_smile:

Rene

thanks will look into this.

Hi Rene,

Is the reason that you are not seeing recursive routing issues in this case because you have used static routes which have a lower cost than an eigrp route? It appears that you are advertising the tunnel network in this case. Which I thought you said not to do. I’m just a little confused.

Hi Adam,

Did you see this tutorial?

https://networklessons.com/cisco/gre-tunnel-recursive-routing-error/

This explains exactly how the recursive routing occurs.

Rene

How i can do the same thing but with real LAN with 2 PC connected to a switch in each Router (HQ - BRANCH)?.

Thanks

Hi Victor,

The configuration of the routers would be the exact same thing. If you have real routers, just connect the computers directly to your routers (or put a switch in between). If you want to try this in GNS3 then you can use the “cloud” icon to connect your virtual routers to physical NICs.

Rene

19 posts were merged into an existing topic: How to configure GRE Tunnel on Cisco IOS Router

Dear Rene,

  1. Can you please tell why did you used:

tunnel source fastEthernet 0/0

and not:

tunnel source 192.168.12.1

instead? What would be the difference ?

  1. Now, this might sound silly but anyway … Given the below config:
HQ(config)#interface tunnel 1
HQ(config-if)#tunnel source fastEthernet 0/0
HQ(config-if)#tunnel destination 192.168.23.3
HQ(config-if)#ip address 192.168.13.1 255.255.255.0

what I still cannot understand (I have read a couple of articles on GRE) and seems very strange to me is how the ip address of the tunnel is 192.168.13.1 and the source is the ip of another (??) interface (which is fa 0/0 - 192.168.12.1).
To my common sense the source should be 192.168.13.1.

  1. Why do some tunnels are mentioning loopback interfaces as source interfaces, instead of serial0 or its ip?

I know I am wrong but I still cannot understand it … :((

Thank you!

1 Like