Showing posts with label GRE. Show all posts
Showing posts with label GRE. Show all posts

Thursday, December 8, 2011

DMVPN For Dummies - Phase 1 & 2 (Phase 3 Added Too Now)



R1(HUB)
=======

!
crypto isakmp policy 10
 authentication pre-share
 crypto isakmp key cisco address 0.0.0.0
!
crypto ipsec transform-set TRANSFORMSET esp-des esp-md5-hmac
  mode transport
!
crypto ipsec profile CRYPTOPROFILE
 set transform-set TRANSFORMSET
!
interface Tunnel0
 ip address 10.0.0.1 255.255.255.0
 ip mtu 1400
 ip nhrp authentication cisco
 ip nhrp map multicast dynamic
 ip nhrp network-id 99
 no ip split-horizon eigrp 1
 ip tcp adjust-mss 1360
 tunnel source f0/0
 tunnel mode gre multipoint
 tunnel key 100000
 tunnel protection ipsec profile CRYPTOPROFILE
 no ip next-hop-self eigrp 1 < To Be Removed If Using Phase 3 Configuration
 ip nhrp redirect
!
router eigrp 1
 network 10.0.0.1 0.0.0.0
 network 1.1.1.1 0.0.0.0
 no au
 end
!

##################################################################

R2(SPOKE 1)
===========
!
crypto isakmp policy 10
 authentication pre-share
 crypto isakmp key cisco address 0.0.0.0
!
crypto ipsec transform-set TRANSFORMSET esp-des esp-md5-hmac
  mode transport
!
crypto ipsec profile CRYPTOPROFILE
 set transform-set TRANSFORMSET
!
interface Tunnel0
 ip address 10.0.0.2 255.255.255.0
 ip mtu 1400
 ip nhrp authentication cisco
 ip nhrp map 10.0.0.1 123.0.0.1
 ip nhrp map multicast 123.0.0.1
 ip nhrp network-id 99
 ip nhrp nhs 10.0.0.1
 ip tcp adjust-mss 1360
 tunnel source f0/0
 tunnel mode gre multipoint
 tunnel key 100000
 tunnel protection ipsec profile CRYPTOPROFILE
 ip nhrp redirect
 ip nhrp shortcut
!
router eigrp 1
 network 10.0.0.2 0.0.0.0
 network 2.2.2.2 0.0.0.0
 no au
 end
!

##################################################################

R3(SPOKE 2)
===========

!
crypto isakmp policy 10
 authentication pre-share
 crypto isakmp key cisco address 0.0.0.0
!
crypto ipsec transform-set TRANSFORMSET esp-des esp-md5-hmac
  mode transport
!
crypto ipsec profile CRYPTOPROFILE
 set transform-set TRANSFORMSET
!
interface Tunnel0
 ip address 10.0.0.3 255.255.255.0
 ip mtu 1400
 ip nhrp authentication cisco
 ip nhrp map 10.0.0.1 123.0.0.1
 ip nhrp map multicast 123.0.0.1
 ip nhrp network-id 99
 ip nhrp nhs 10.0.0.1
 ip tcp adjust-mss 1360
 tunnel source f0/0
 tunnel mode gre multipoint
 tunnel key 100000
 tunnel protection ipsec profile CRYPTOPROFILE
 ip nhrp redirect
 ip nhrp shortcut
!
router eigrp 1
 network 10.0.0.3 0.0.0.0
 network 3.3.3.3 0.0.0.0
 no au
 end
!

Benefit of adding Phase 3 Configuration allows us to reduce control-plane information on Hub Router. Also it allows us to use default routing and perform summarization on Hub.


More Details :


http://www.cisco.com/en/US/prod/collateral/iosswrel/ps6537/ps6586/ps6660/ps6808/prod_white_paper0900aecd8055c34e_ps6658_Products_White_Paper.html

HTH...
Deepak Arora
Evil CCIE

Wednesday, December 8, 2010

Connecting Two OSPF Areas With Stub Area In Middle - Quick Solution & Verification

Here is quick solution and verification for my last post: BTW are you not in love with GRE tunnels still ? 
:-)


http://deepakarora1984.blogspot.com/2010/12/connecting-two-ospf-areas-with-stub.html


R1#sh ip ro | b ^G
Gateway of last resort is not set


     11.0.0.0/32 is subnetted, 1 subnets
C       11.11.11.11 is directly connected, Loopback0
     12.0.0.0/24 is subnetted, 1 subnets
C       12.12.12.0 is directly connected, FastEthernet0/0




R2#sh ip ro | b ^G
Gateway of last resort is 12.12.12.1 to network 0.0.0.0


     33.0.0.0/32 is subnetted, 1 subnets
O       33.33.33.33 [110/2] via 23.23.23.3, 00:01:19, FastEthernet1/0
     23.0.0.0/24 is subnetted, 1 subnets
C       23.23.23.0 is directly connected, FastEthernet1/0
     11.0.0.0/32 is subnetted, 1 subnets
O IA    11.11.11.11 [110/2] via 12.12.12.1, 00:01:19, FastEthernet0/0
     12.0.0.0/24 is subnetted, 1 subnets
C       12.12.12.0 is directly connected, FastEthernet0/0
O*IA 0.0.0.0/0 [110/2] via 12.12.12.1, 00:01:19, FastEthernet0/0




R3#sh ip ro | b ^G
Gateway of last resort is not set


     33.0.0.0/24 is subnetted, 1 subnets
C       33.33.33.0 is directly connected, Loopback0
     23.0.0.0/24 is subnetted, 1 subnets
C       23.23.23.0 is directly connected, FastEthernet0/0
====================================================


R1(config)#router ospf 1
R1(config-router)#area 1 virtual-link 255.255.255.2
% OSPF: Area 0.0.0.1 is a stub or nssa so virtual links are not allowed
R1(config-router)#


====================================================
R1(config)#int tu 1
R1(config-if)#ip add 112.112.112.1 255.255.255.0
R1(config-if)#tu so f0/0
R1(config-if)#tu dest 12.12.12.2 
R1(config-if)#exit


R2(config)#int tu 1
R2(config-if)#ip add 112.112.112.2 255.255.255.0
R2(config-if)#tu so f0/0
R2(config-if)#tu dest 12.12.12.1
R2(config-if)#exit

*Mar  1 00:19:34.695: %LINEPROTO-5-UPDOWN: Line protocol on Interface Tunnel1, changed state to up

====================================================
R1(config)#router ospf 1
R1(config-router)#net 112.112.112.1 0.0.0.0 a 0
R1(config-router)#exit

R2(config)#router ospf 1
R2(config-router)#net 112.112.112.2 0.0.0.0 a 0
R2(config-router)#exit

====================================================
R1#sh ip ro | b ^G
Gateway of last resort is not set

     33.0.0.0/32 is subnetted, 1 subnets
O IA    33.33.33.33 [110/11113] via 112.112.112.2, 00:01:35, Tunnel1
     23.0.0.0/24 is subnetted, 1 subnets
O IA    23.23.23.0 [110/11112] via 112.112.112.2, 00:01:35, Tunnel1
     112.0.0.0/24 is subnetted, 1 subnets
C       112.112.112.0 is directly connected, Tunnel1
     11.0.0.0/32 is subnetted, 1 subnets
C       11.11.11.11 is directly connected, Loopback0
     12.0.0.0/24 is subnetted, 1 subnets
C       12.12.12.0 is directly connected, FastEthernet0/0

R1#ping 33.33.33.33 so lo0

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 33.33.33.33, timeout is 2 seconds:
Packet sent with a source address of 11.11.11.11 
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 8/17/40 ms


R1#trace 33.33.33.33 so lo0

Type escape sequence to abort.
Tracing the route to 33.33.33.33

  1 112.112.112.2 4 msec 4 msec 4 msec
  2 23.23.23.3 12 msec *  24 msec

HTH...
Deepak Arora

Tuesday, December 7, 2010

Connecting Two OSPF Areas With Stub Area In Middle Challenge - Diagram & Initials


###################
# Here are the Initials  #
###################

^^^ R1 ^^^
^^^^^^^^^^

en
!
conf t
!
ho R1
!
no ip do lo
!
line con 0
no exec-time
exit
!
int lo0
ip add 11.11.11.11 255.255.255.255
exit
!
int f0/0
ip add 12.12.12.1 255.255.255.0
no sh
exit
!
router ospf 1
router-id 255.255.255.1
net 11.11.11.11 0.0.0.0 a 0.0.0.0
net 12.12.12.1 0.0.0.0 a 0.0.0.1
area 1 stub
exit
!
end
!
wr mem
!
==================================

^^^ R2 ^^^
^^^^^^^^^^

en
!
conf t
!
ho R2
!
no ip do lo
!
line con 0
no exec-time
exit
!
int f0/0
ip add 12.12.12.2 255.255.255.0
no sh
exit
!
int f1/0
ip add 23.23.23.2 255.255.255.0
no sh 
exit
!
router ospf 1
router-id 255.255.255.2
net 12.12.12.2 0.0.0.0 a 1
net 23.23.23.2 0.0.0.0 a 2
area 1 stub
exit
!
end
!
wr mem
!
==================================

^^^ R3 ^^^
^^^^^^^^^^

en
!
conf t
!
ho R3
!
no ip do lo
!
line con 0
no exec-time
exit
!
int f0/0
ip add 23.23.23.3 255.255.255.0
no sh
exit
!
int lo0
ip add 33.33.33.33 255.255.255.0
no sh 
exit
!
router ospf 1
router-id 255.255.255.3
net 33.33.33.33 0.0.0.0 a 2
net 23.23.23.3 0.0.0.0 a 2
exit
!
end
!
wr mem
!
********************************

Tuesday, November 30, 2010

Passing BGP Updates Through Network of Non-BGP Speakers - How Cool is that ?

In my last post  - http://deepakarora1984.blogspot.com/2010/11/transiting-non-bgp-speaking-devices.html

I presented a scenario in which we need to pass BGP updates between two AS through a Transit AS. But in Transit AS some of the devices were not BGP capable devices for say. So what we gonna do now ?


Redistribution of BGP routes into IGP could be another Idea, but in real world we usually avoid such things.


Hmmm....so what else we can try ?


Lets first setup the network and see what can be done a little later.
 Physical Topology






Logical Topology



Lets get started:



### R1 ###

Router>en
Router#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#no ip do lo
Router(config)#line con 0
Router(config-line)#no exec-time
Router(config-line)#exit
Router(config)#ho R1
R1(config)#int lo0
R1(config-if)#ip add 1.1.1.1 255.255.255.255
R1(config-if)#exit
R1(config)#int f0/0
R1(config-if)#ip add 12.12.12.1 255.255.255.0 
R1(config-if)#no sh
R1(config-if)#exit
R1(config)#int f0/1
R1(config-if)#ip add 51.51.51.1 255.255.255.0
R1(config-if)#no sh
R1(config-if)#exit 
R1(config)#ip route 5.5.5.5 255.255.255.255 f0/1 51.51.51.5
R1(config)#router eigrp 100
R1(config-router)#no au
R1(config-router)#net 1.1.1.1 0.0.0.0
R1(config-router)#net 12.12.12.1 0.0.0.0
R1(config-router)#exit
R1(config)#router bgp 123
R1(config-router)#no au
R1(config-router)#no sync
R1(config-router)#nei 5.5.5.5 remote 15
R1(config-router)#nei 5.5.5.5 update lo0
R1(config-router)#nei 5.5.5.5 ebgp      
R1(config-router)#nei 3.3.3.3 remote 123
R1(config-router)#nei 3.3.3.3 update lo0
R1(config-router)#nei 3.3.3.3 next-hop-self
R1(config-router)#exit     

=============================================================
### R2 ###

Router>en
Router#conf
Configuring from terminal, memory, or network [terminal]? 
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#ho R2
R2(config)#no ip do lo
R2(config)#line con 0
R2(config-line)#no exec-time
R2(config-line)#exit
R2(config)#int f0/0
R2(config-if)#ip add 12.12.12.2 255.255.255.0
R2(config-if)#no sh 
R2(config-if)#exit
R2(config)#int f0/1
R2(config-if)#ip add 23.23.23.2 255.255.255.0
R2(config-if)#no sh
R2(config-if)#exit
R2(config)#router eigrp 100
R2(config-router)#no au
R2(config-router)#net 0.0.0.0
R2(config-router)#exit

=============================================================


### R3 ###

Router>en
Router#conf
Configuring from terminal, memory, or network [terminal]? 
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#ho R3
R3(config)#no ip do lo
R3(config)#line con 0
R3(config-line)#no exec-time
R3(config-line)#exit
R3(config)#int lo0
R3(config-if)#ip add 3.3.3.3 255.255.255.255 
R3(config-if)#exit
R3(config)#int f0/0
R3(config-if)#ip add 23.23.23.3 255.255.255.0 
R3(config-if)#no sh
R3(config-if)#exit
R3(config)#int f0/1
R3(config-if)#ip add 43.43.43.3 255.255.255.0
R3(config-if)#no sh
R3(config-if)#exit
R3(config)#ip route 4.4.4.4 255.255.255.255 f0/1 43.43.43.4
R3(config)#router eigrp 100
R3(config-router)#no au
R3(config-router)#net 3.3.3.3 0.0.0.0
R3(config-router)#net 23.23.23.3 0.0.0.0
R3(config-router)#exit
R3(config)#router bgp 123
R3(config-router)#no au
R3(config-router)#no sync
R3(config-router)#nei 4.4.4.4 remote 34
R3(config-router)#nei 4.4.4.4 update lo0
R3(config-router)#nei 4.4.4.4 ebgp      
R3(config-router)#nei 1.1.1.1 remote 123
R3(config-router)#nei 1.1.1.1 update lo0
R3(config-router)#nei 1.1.1.1 next-hop-self
R3(config-router)#exit
==============================================================

### R4 ####

Router>en
Router#conf
Configuring from terminal, memory, or network [terminal]? 
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#ho R4
R4(config)#no ip do lo
R4(config)#line con 0
R4(config-line)#no exec-time
R4(config-line)#exit
R4(config)#int lo0
R4(config-if)#ip add 4.4.4.4 255.255.255.255
R4(config-if)#exit
R4(config)#int lo1
R4(config-if)#ip add 44.44.44.44 255.255.255.255
R4(config-if)#exit
R4(config)#int f0/0
R4(config-if)#ip add 43.43.43.4 255.255.255.0
R4(config-if)#no sh
R4(config-if)#exit
R4(config)#ip route 3.3.3.3 255.255.255.255 f0/0 43.43.43.3
R4(config)#router bgp 34
R4(config-router)#no au
R4(config-router)#no sync
R4(config-router)#nei 3.3.3.3 remote 123
R4(config-router)#nei 3.3.3.3 update lo0
R4(config-router)#nei 3.3.3.3 ebgp      
R4(config-router)#net 44.44.44.44 mask 255.255.255.255
R4(config-router)#exit
========================================================

### R5 ###

Router>en
Router#conf
Configuring from terminal, memory, or network [terminal]? 
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#ho R5
R5(config)#no ip do lo
R5(config)#line con 0
R5(config-line)#no exec-time
R5(config-line)#exit
R5(config)#int lo0
R5(config-if)#ip add 5.5.5.5 255.255.255.255
R5(config-if)#exit
R5(config)#int lo1
R5(config-if)#ip add 5.5.5.5 255.255.255.255
R5(config-if)#exit
R5(config)#int lo1
R5(config-if)#ip add 55.55.55.55 255.255.255.255
R5(config-if)#exit
R5(config)#int f0/0 
R5(config-if)#ip add 51.51.51.5 255.255.255.0  
R5(config-if)#no sh
R5(config-if)#exit 
R5(config)#ip route 1.1.1.1 255.255.255.255 f0/0 51.51.51.1
R5(config)#router bgp 15
R5(config-router)#no au
R5(config-router)#no sync
R5(config-router)#nei 1.1.1.1 remote 123
R5(config-router)#nei 1.1.1.1 update lo0
R5(config-router)#nei 1.1.1.1 ebgp
R5(config-router)#net 55.55.55.55 mask 255.255.255.255
R5(config-router)#exit
================================================================



R1(config)#do sh ip bgp | b Net       
   Network          Next Hop            Metric LocPrf Weight Path
*>i44.44.44.44/32   3.3.3.3                  0    100      0        34 i
*> 55.55.55.55/32   5.5.5.5                  0               0        15 i




R5(config)#do sh ip bgp | b Net
   Network          Next Hop            Metric LocPrf Weight Path
*> 44.44.44.44/32   1.1.1.1                                0 123     34 i
*> 55.55.55.55/32   0.0.0.0                  0         32768            i

Hmmm...so far everything looks good. Lets trace R4's Lo1 from R5

R5(config)#do trace 44.44.44.44 so lo1

Type escape sequence to abort.
Tracing the route to 44.44.44.44

  1 51.51.51.1 4 msec 12 msec 8 msec
  2  *  *  * 
  3  *  *  * 

Hmmm...Things doesn't look quite working yet.

Lets hop on to R2 and check it's routing table:

R2(config)#do sh ip ro | b ^G
Gateway of last resort is not set

     1.0.0.0/32 is subnetted, 1 subnets
D       1.1.1.1 [90/409600] via 12.12.12.1, 01:47:22, FastEthernet0/0
     3.0.0.0/32 is subnetted, 1 subnets
D       3.3.3.3 [90/409600] via 23.23.23.3, 01:43:41, FastEthernet0/1
     23.0.0.0/24 is subnetted, 1 subnets
C       23.23.23.0 is directly connected, FastEthernet0/1
     12.0.0.0/24 is subnetted, 1 subnets
C       12.12.12.0 is directly connected, FastEthernet0/0

so here is the problem. R2 has no knowledge about who is 44.44.44.44, so when it receive packets destined for 44.44.44.44; it checks its local routing table and as it doesn't find any entry in there it simply drops the packets. One work around could be redistributing BGP into EIGRP but thats restricted here. So what else ?

Hmmm...how about our old friend tunnels ? :-)


Okay... I am certainly not a patient of Tarsal Tunnel Syndrome :-P 

But lets see how we can fix this with tunnels.

R1(config)#int tu13
R1(config-if)#ip add 13.13.13.1 255.255.255.0
R1(config-if)#tu so f0/0
R1(config-if)#tu dest 23.23.23.3
R1(config-if)#exit


R3(config)#int tu 13
R3(config-if)#ip add 13.13.13.3 255.255.255.0
R3(config-if)#tu so f0/0
R3(config-if)#tu dest 12.12.12.1
R3(config-if)#exit

*Mar  1 01:48:46.071: %LINEPROTO-5-UPDOWN: Line protocol on Interface Tunnel13, changed state to up


R1(config)#router bgp 123
R1(config-router)#nei 13.13.13.3 remote 123
R1(config-router)#nei 13.13.13.3 update tu13
R1(config-router)#nei 13.13.13.3 next-hop-s
R1(config-router)#exit


R3(config)#router bgp 123
R3(config-router)#nei 13.13.13.1 remote 123
R3(config-router)#nei 13.13.13.1 update tu13
R3(config-router)#nei 13.13.13.1 next-hop-s
R3(config-router)#exit

*Mar  1 01:53:16.167: %BGP-5-ADJCHANGE: neighbor 13.13.13.1 Up 


R5(config)#do trace 44.44.44.44 so lo1

Type escape sequence to abort.
Tracing the route to 44.44.44.44

  1 51.51.51.1 4 msec 12 msec 8 msec
  2 13.13.13.3 24 msec 16 msec 16 msec
  3 43.43.43.4 52 msec *  24 msec


R4(config)#do trace 55.55.55.55 so lo1

Type escape sequence to abort.
Tracing the route to 55.55.55.55

  1 43.43.43.3 8 msec 12 msec 8 msec
  2 13.13.13.1 16 msec 20 msec 20 msec
  3 51.51.51.5 24 msec *  64 msec


R4(config)#do ping 55.55.55.55 so lo1

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 55.55.55.55, timeout is 2 seconds:
Packet sent with a source address of 44.44.44.44 
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 28/42/60 ms




HTH...
Deepak Arora