cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1952
Views
5
Helpful
7
Replies

configuring gre between two routers where ospf is used for routing

amalmkrishna21
Level 1
Level 1

i want to make a gre tunnel between router1 and router 2, and I also make it but still when I do tracert from one of my PCs to the PCs in the other network I don't see any working of the GRE.

ROUTER 1 RUNNING CONFIG

Building configuration...

 

Current configuration : 964 bytes

!

version 15.4

no service timestamps log datetime msec

no service timestamps debug datetime msec

no service password-encryption

!

hostname Router

!

!

!

!

!

!

!

!

ip cef

no ipv6 cef

!

!

!

!

!

!

!

!

!

!

!

!

spanning-tree mode pvst

!

!

!

!

!

!

interface Tunnel0

ip address 172.16.0.1 255.255.0.0

mtu 1476

tunnel source GigabitEthernet0/0/1

tunnel destination 20.0.0.2

!

!

interface GigabitEthernet0/0/0

ip address 192.168.1.5 255.255.255.0

duplex auto

speed auto

!

interface GigabitEthernet0/0/1

ip address 10.0.0.1 255.0.0.0

duplex auto

speed auto

!

interface GigabitEthernet0/0/2

no ip address

duplex auto

speed auto

shutdown

!

interface Vlan1

no ip address

shutdown

!

router ospf 50

log-adjacency-changes

network 192.168.1.0 0.0.0.255 area 0

network 10.0.0.0 0.255.255.255 area 0

network 172.16.0.0 0.0.255.255 area 0

!

router rip

!

ip classless

!

ip flow-export version 9

!

!

!

!

!

!

!

line con 0

!

line aux 0

!

line vty 0 4

login

!

!

!

end

ROUTER 2 RUNNING CONFIG 

Building configuration...

 

Current configuration : 951 bytes

!

version 15.4

no service timestamps log datetime msec

no service timestamps debug datetime msec

no service password-encryption

!

hostname Router

!

!

!

!

!

!

!

!

ip cef

no ipv6 cef

!

!

!

!

!

!

!

!

!

!

!

!

spanning-tree mode pvst

!

!

!

!

!

!

interface Tunnel0

ip address 172.16.0.2 255.255.0.0

mtu 1476

tunnel source GigabitEthernet0/0/1

tunnel destination 10.0.0.1

!

!

interface GigabitEthernet0/0/0

ip address 192.168.2.5 255.255.255.0

duplex auto

speed auto

!

interface GigabitEthernet0/0/1

ip address 20.0.0.2 255.0.0.0

duplex auto

speed auto

!

interface GigabitEthernet0/0/2

no ip address

duplex auto

speed auto

shutdown

!

interface Vlan1

no ip address

shutdown

!

router ospf 50

log-adjacency-changes

network 20.0.0.0 0.255.255.255 area 0

network 192.168.2.0 0.0.0.255 area 0

network 172.16.0.0 0.0.255.255 area 0

!

ip classless

!

ip flow-export version 9

!

!

!

!

!

!

!

line con 0

!

line aux 0

!

line vty 0 4

login

!

!

!

end

tracert result from pc0 to pc3 is attached as a screen shot 

pls help me and tell me how to make the gre work so that the packet goes through gre instead of the normal internet.

all the routers have ospf configured as routing algorithm

the router model used is ISR4331

1 Accepted Solution

Accepted Solutions

Hello,

 

It looks like you have underlay connectivity, however, your tunnel interfaces are also using the same routing protocol as your underlay. This produces a Recursive routing issue, meaning your tunnel endpoint is being learned through the tunnel itself as its built...which cannot happen. Try using another routing protocol for the Tunnel interfaces like EIGRP or even static routes. 

To have traffic flow over the tunnel it needs to be built.

-David

View solution in original post

7 Replies 7

Hello,

 

It looks like you have underlay connectivity, however, your tunnel interfaces are also using the same routing protocol as your underlay. This produces a Recursive routing issue, meaning your tunnel endpoint is being learned through the tunnel itself as its built...which cannot happen. Try using another routing protocol for the Tunnel interfaces like EIGRP or even static routes. 

To have traffic flow over the tunnel it needs to be built.

-David

If you don't understand @David Ruess's answer, let us know.

Hello
You need to make sure you can reach the tunnel source/destination addresses and that addressing is NOT being advertised over the tunnel 

hostname Router
router ospf 50
no network 10.0.0.0 0.255.255.255 area 0

ip route 10.0.0.0 255.0.0.0 gig0/0/1 20.0.0.X

 

ROUTER 2

router ospf 50
no network 20.0.0.0 0.255.255.255 area 0
ip route 20.0.0.0 255.0.0.0 gig0/0/1 10.0.0.X

 


Please rate and mark as an accepted solution if you have found any of the information provided useful.
This then could assist others on these forums to find a valuable answer and broadens the community’s global network.

Kind Regards
Paul

amalmkrishna21
Level 1
Level 1

Hai,

I saw that both @David Ruess and @paul driver have suggested using static routing so I did the following using @paul driver command:

Router1

router ospf 50

no network 10.0.0.0 0.255.255.255 area 0

exit

ip route 10.0.0.0 255.0.0.0 20.0.0.2

Router2

router ospf 50

no network 20.0.0.0 0.255.255.255 area 0

exit

ip route 20.0.0.0 255.0.0.0 10.0.0.1

 

but still, it didn't work, the tracert did not even reach the destination, the output I got I have attached a screenshot below.

so later I did the following without changing the static routing. 

Router1

router ospf 50

network 10.0.0.0 0.255.255.255 area 0

exit

 

Router2

router ospf 50

network 20.0.0.0 0.255.255.255 area 0

exit

then I was able to do tracert and it reached the destination, but still, it didn't use the tunnel for it.

so I tried to remove the route from the OSPF by doing the following:

Router1

router ospf 50

no network 10.0.0.0 0.255.255.255 area 0

exit

Router2

router ospf 50

no network 20.0.0.0 0.255.255.255 area 0

exit

 

but again the tracert was not complete.

I am a beginner so I don't have much knowledge on how all these works, so pls forgive my ignorance or stupidity. please do let me know if there is any way to attach my pkt file so that everyone can look at it carefully.

Thank you.

amalmkrishna21
Level 1
Level 1

Hai,

I was just reading @David Ruess's answer then I understood what it meant so I did the following

Router1

router ospf 50

network 10.0.0.0 0.255.255.255 area 0

exit

Router2

router ospf 50

network 20.0.0.0 0.255.255.255 area 0

exit

then I added the static routing as per @David Ruess and @paul driver, I have attached the screenshot for static routing for both the routers below.

And now I can do tracert through the tunnel, I have also attached the screenshot below.

Thank you @paul driver and @David Ruess for solving my doubts by taking your precious time, forever grateful to you guys. Maybe you guys explained to me properly why my network was not working as intended and that I did not get it properly because I am new to all this, I don't know the in depth knowledge of how all these routing, VPN, etc work. I only have a surface level knowledge about all this stuff.

 

for those wondering what my current configuration is:

1. I configure ospf routing algorithm as usual for all my routers, and checked whether the packet is going from one network to the other.

2. Then as per @David Ruess and @paul driver's suggestion I also added static routing algorithm for the tunnel interface in both routers.

3. Now the tracert is going through the tunnel.

May god bless you all.

 

"Maybe you guys explained to me properly why my network was not working as intended and that I did not get it properly because I am new to all this, I don't know the in depth knowledge of how all these routing, VPN, etc work. I only have a surface level knowledge about all this stuff."

Yup, I suspected that might be the case, especially when @David Ruess mentioned recursive routing, which is why I wrote my first reply.

In the future don't be "shy" to ask for more information.  Almost all posters will happily supply it, especially VIPs or Hall of Fame members, who got those ratings trying to be helpful.

Sure Joseph, Thanks, God bless you