Tuesday, August 2, 2011

Configuring OSPF Virtual Links w/ GRE tunnels

In this blogtorial we are going to discuss on how to link an OSPF area which is not directly connected to Area 0 using GRE tunnels. Why would you ever want to do this? I don't know :) maybe in the CCIE lab exam. I strongly recommend not using GRE or Virtual links but they do exists for a reason. 


We are going to be building on the topology from my previous blogtorials. So let's get started.



Relevant configurations are posted below but basically all we are doing is creating a GRE tunnel between R5 and R4 and putting the tunnel in Area 0.




R7#sh ip route
Gateway of last resort is not set
     172.16.0.0/24 is subnetted, 1 subnets
C       172.16.7.0 is directly connected, Loopback0
     10.0.0.0/24 is subnetted, 1 subnets
C       10.3.3.0 is directly connected, FastEthernet1/0



R7#ping 172.16.6.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.16.6.1, timeout is 2 seconds:
.....
Success rate is 0 percent (0/5)

Now let's get R5 and R4 configured and see the magic in action. 

R5#sh run int tunnel 0
interface Tunnel0
 ip address 192.168.1.2 255.255.255.0 ** Drop an ip address on the tunnel interface **
 tunnel source 10.1.1.5 ** Specify the tunnel source which is facing towards R4 **
 tunnel destination 10.1.1.4 ** Specify the tunnel destination which is R5 **
end

R5#sh run | sec ospf
router ospf 1
 log-adjacency-changes
 network 10.1.1.0 0.0.0.255 area 1
 network 10.3.3.0 0.0.0.255 area 2
 network 172.16.5.0 0.0.0.255 area 1
 network 192.168.1.0 0.0.0.255 area 0 ** Add the tunnel interface to Area 0 ** 

Pretty much the same config on R4 except a few changes. 

R4#sh run int tunnel 0
interface Tunnel0
 ip address 192.168.1.1 255.255.255.0
 tunnel source 10.1.1.4
 tunnel destination 10.1.1.5
end

R4#sh run | sec ospf
router ospf 1
 log-adjacency-changes
 redistribute connected subnets
 network 10.0.0.0 0.0.0.255 area 0
 network 10.1.1.0 0.0.0.255 area 1
 network 192.168.1.0 0.0.0.255 area 0

Now let's take a look at R7 and witness the magic!!

R7#sh ip route
     172.16.0.0/16 is variably subnetted, 7 subnets, 2 masks
O IA    172.16.5.1/32 [110/2] via 10.3.3.5, 00:03:27, FastEthernet1/0
O E2    172.16.4.0/24 [110/20] via 10.3.3.5, 00:03:27, FastEthernet1/0
O E2    172.16.6.0/24 [110/20] via 10.3.3.5, 00:03:27, FastEthernet1/0
C       172.16.7.0/24 is directly connected, Loopback0
O E2    172.16.1.0/24 [110/20] via 10.3.3.5, 00:03:27, FastEthernet1/0
O E2    172.16.2.0/24 [110/20] via 10.3.3.5, 00:03:27, FastEthernet1/0
O E2    172.16.3.0/24 [110/20] via 10.3.3.5, 00:03:27, FastEthernet1/0
     10.0.0.0/24 is subnetted, 4 subnets
C       10.3.3.0 is directly connected, FastEthernet1/0
O E2    10.2.2.0 [110/20] via 10.3.3.5, 00:03:27, FastEthernet1/0
O IA    10.1.1.0 [110/2] via 10.3.3.5, 00:03:27, FastEthernet1/0
O IA    10.0.0.0 [110/1002] via 10.3.3.5, 00:03:27, FastEthernet1/0
O IA 192.168.1.0/24 [110/1001] via 10.3.3.5, 00:03:28, FastEthernet1/0

R7#ping 172.16.6.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.16.6.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 52/65/76 ms

As you can see a router in Area 2 (R7) can successfully ping the loopback on R6. 

More articles to come so stay tuned!! If you like my posts please subscribe :) 







No comments:

Post a Comment