Cisco DMVPN

From HackerNet
Revision as of 12:53, 1 May 2016 by Helikopter (talk | contribs)
Jump to: navigation, search

Dynamic Multipoint VPN är en skalbar VPN-teknik som kan bygga tunnlar dynamiskt. Tekniker som används är mGRE, NHRP, routingprotokoll, CEF och IPsec. Det har bl.a. stöd för VRF, Multicast, QoS och load balancing.

NHRP

Next Hop Resolution Protocol (RFC 2332). NHRP-processen på hubben agerar server och håller databasen med de externa IP-adresserna som alla spokes har. Varje spoke registrerar sin IP som en klient till hubben. Behöver en spoke skicka paket till något bakom en annan spoke frågar den hubben om den andres externa IP-adress så den kan bygga en tunnel (förslagsvis med IPsec) direkt. För detta krävs alltså inget routingprotokoll utan det sköts av NHRP.

Designer

Hub and spoke

  • single hub single dmvpn
  • dual hub dual dmvpn
  • server load balancing

Dynamic Mesh

  • dual hub single dmvpn
  • multihub single dmvpn
  • hierarchical

Phases

Fas 1
Hub and Spoke (mGRE hub, p2p GRE spokes): Inget dynamiskt, enda fördelen är simplare konfiguration.

Fas 2
Hub and Spoke with Spoke-to-Spoke tunnels: Routingprotokollet på spokes lär sig prefix direkt av varandra på tunneln. Forwarding görs spoke-to-spoke, man använder IGP istället för NHRP. Det finns scenarion då CEF kan behövas stängas av på spokes.

Fas 3
Scalable Infrastructure: Routingprotokoll på spokes pratar med hubben för att lära sig prefix samt ha som next-hop men NHRP kickar in och redirectar trafiken direkt mellan spokes. Mest skalbart och CEF behöver aldrig stängas av tack vare NHRP Shortcut.
Hub: ip nhrp redirect
Spoke: ip nhrp shortcut

Fas 1

Med Fas 1 används GRE.

Static mapping

interface Tunnel0
 ip nhrp map multicast 172.16.15.X
 ip nhrp map 192.168.0.X 172.16.15.X

Spoke

interface Tunnel0
 ip nhrp map 192.168.0.X 172.16.15.2
 tunnel destination 172.16.15.2

Dynamic mapping

interface Tunnel0
 ip nhrp map multicast dynamic

Spoke

interface Tunnel0
 ip nhrp map 192.168.0.1 172.16.15.2
 ip nhrp nhs 192.168.0.1
 tunnel destination 172.16.15.2

Fas 2

Med Fas 2 används mGRE.

Hub

interface Tunnel0
 ip address 192.168.0.1 255.255.255.0
 ip nhrp map multicast dynamic
 ip nhrp network-id 1
 tunnel source 172.16.15.2
 tunnel mode gre multipoint

Spoke

interface Tunnel0
 ip address 192.168.0.2 255.255.255.0
 ip nhrp map 192.168.0.1 172.16.15.2
 ip nhrp map multicast 172.16.15.2
 ip nhrp network-id 1
 ip nhrp nhs 192.168.0.1
 tunnel source 10.10.10.10
 tunnel mode gre multipoint

Verify

show dmvpn
show ip nhrp
clear ip nhrp  #kolla ip nhrp registration timeout ifall detta tar lång tid

Fas 3

Med Fas 3 används mGRE.

Hub

interface Tunnel0
 ip address 192.168.0.1 255.255.255.0
 ip nhrp map multicast dynamic
 ip nhrp network-id 1
 ip nhrp redirect
 tunnel source 172.16.15.2
 tunnel mode gre multipoint

Spoke

interface Tunnel0
 ip address 192.168.0.2 255.255.255.0
 ip nhrp map 192.168.0.1 172.16.15.2
 ip nhrp map multicast 172.16.15.2
 ip nhrp network-id 1
 ip nhrp nhs 192.168.0.1
 ip nhrp shortcut
 tunnel source 10.10.10.10
 tunnel mode gre multipoint

Verify

show dmvpn
show ip nhrp
clear ip nhrp  #kolla ip nhrp registration timeout ifall detta tar lång tid

Routingprotokoll

EIGRP

Med Fas 1 kan man antingen stänga av split-horizon eller skicka en default route på hub.

Med EIGRP i Fas 2 måste man stänga av split-horizon och next-hop-self på tunnel-interfacet för att uppdateringar och routing mellan spokes ska funka.

interface Tunnel0
 no ip next-hop-self eigrp 100
 no ip split-horizon eigrp 100

Med fas 3 kommer endast det första paketet att gå via hub tack vare nhrp shortcut.

OSPF

Hub

interface Tunnel0
 ip ospf network broadcast

Spoke, ska inte vara med i DR-election.

interface Tunnel0
 ip ospf network broadcast
 ip ospf prio 0

Det går även att använda point-to-multipoint på hubbens tunnel-interface och p2p på spoksen. Alternativt ip ospf network non-broadcast på alla.

BGP

Med Fas 1 och BGP måste next-hop-self användas på alla grannskap.

Fas 2 och BGP-konfiguration är som vanligt men för eBGP mellan spokes måste multihop användas.

neighbor 2.2.2.2 ebgp-multihop 2

RIP

Med Fas 1 och RIP behöver split horizon stängas av.

IPsec

Vill man skydda sin trafik kan man kryptera all tunneltrafik. Se även IPsec.

crypto isakmp policy 10
 encryption aes 256
 authentication pre-share
 hash sha512
 group 14
crypto isakmp key 0 SECRET address 0.0.0.0 0.0.0.0
crypto ipsec transform-set AES256_SHA512 esp-sha512-hmac esp-aes 256
 mode transport
crypto ipsec profile DMVPN
 set transform-set AES256_SHA512
interface Tunnel0
 tunnel protection ipsec profile DMVPN

Verify

show crypto isakmp sa
show crypto ipsec sa

MPLS
Man kan köra mpls över DMVPN.

mpls ip
mpls ldp router-id loopback0
interface tunnel0
 mpls ip

QoS
Se QoS.