Chapter 13

Overlay Tunnels and VRF

This chapter provides information about the following topics:

Caution

Your hardware platform or software release might not support all the commands documented in this chapter. Please refer to Cisco.com for specific platform and software release notes.

Generic Routing Encapsulation (GRE)

GRE, defined in RFC 2784, is a carrier protocol that can be used with a variety of underlying transport protocols and that can carry a variety of passenger protocols. RFC 2784 also covers the use of GRE with IPv4 as the transport protocol and the passenger protocol. Cisco IOS Software supports GRE as the carrier protocol with many combinations of passenger and transport protocols such as:

  • GRE over IPv4 networks: GRE is the carrier protocol, and IPv4 is the transport protocol. This is the most common type of GRE tunnel.

  • GRE over IPv6 networks: GRE is the carrier protocol, and IPv6 is the transport protocol. Cisco IOS Software supports IPv4 and IPv6 as passenger protocols with GRE/IPv6.

Configuring an IPv4 GRE Tunnel

Perform the following configuration steps to configure a GRE tunnel. A tunnel interface is used to transport protocol traffic across a network that does not normally support the protocol. To build a tunnel, a tunnel interface must be defined on each of two routers and the tunnel interfaces must reference each other. At each router, the tunnel interface must be configured with a Layer 3 address. The tunnel endpoints, tunnel source, and tunnel destination must be defined, and the type of tunnel must be selected. Optional steps can be performed to customize the tunnel.

Router(config)# interface tunnel 0

Moves to interface configuration mode

Router(config-if)# tunnel mode gre ip

Specifies the encapsulation protocol to be used in the tunnel. By default, the tunnel protocol is GRE and the transport protocol is IPv4; therefore entering this command is optional and won’t appear in the device’s running configuration

Router(config-if)# ip address 192.168.1.1 255.255.255.0

Assigns an IP address and subnet mask to the tunnel interface

Router(config-if)# tunnel source 209.165.201.1

Or

Router(config-if)# tunnel source gigabitethernet 0/0/0

Identifies the local source of the tunnel. You can use either an interface name or the IP address of the interface that will transmit tunneled packets

Note

The tunnel source can be a physical interface or a loopback interface

Router(config-if)# tunnel destination 198.51.100.1

Identifies the remote destination IP address

Router(config-if)# bandwidth 8192

Defines the tunnel bandwidth for use with a routing protocol or QoS in kilobits per second. In the example, the bandwidth is set to 8192 Kbps

Router(config-if)# keepalive 3 5

Sets the tunnel keepalives to 3 seconds and the number of retries to five to ensure that bidirectional communication exists between tunnel endpoints. The default timer is 10 seconds, with three retries

Router(config-if)# ip mtu 1400

Set the maximum transmission unit (MTU) size of IP packets sent on an interface to 1400 bytes. The default MTU is 1500 bytes

Note

The GRE tunnel adds a minimum of 24 bytes to the packet size

Configuring an IPv6 GRE Tunnel

The same process that is described for IPv4 is used to configure an IPv6 GRE tunnel.

Router(config)# interface tunnel 1

Moves to interface configuration mode

Router(config-if)# tunnel mode gre ipv6

Specifies the encapsulation protocol to be used in the tunnel

Router(config-if)# ip address 2001:db8:192:100::1/64

Assigns an IPv6 address and subnet mask to the tunnel interface

Router(config-if)# tunnel source 2001:db8:209:201::1

Or

Router(config-if)# tunnel source gigabitethernet 0/0/0

Identifies the local source of the tunnel. You can use either an interface name or the IPv6 address of the interface that will transmit tunneled packets

Note

The tunnel source can be a physical interface or a loopback interface

Router(config-if)# tunnel destination 2001:db8:198:51::1

Identifies the remote destination IPv6 address

Router(config-if)# bandwidth 4096

Defines the tunnel bandwidth for use with a routing protocol or QoS in kilobits per second. In the example, the bandwidth is set to 4096 Kbps

Router(config-if)# keepalive 3 5

Sets the tunnel keepalives to 3 seconds and the number of retries to five to ensure that bidirectional communication exists between tunnel endpoints. The default timer is 10 seconds, with three retries

Router(config-if)# ipv6 mtu 1400

Set the maximum transmission unit (MTU) size of IPv6 packets sent on an interface to 1400 bytes. The default MTU is 1500 bytes

Note

The GRE tunnel adds a minimum of 24 bytes to the packet size

Verifying IPv4 and IPv6 GRE Tunnels

Router# show interfaces tunnel number

Displays general information about the tunnel interface

Router# show ip interface tunnel number

Displays IPv4 information about the tunnel interface

Router# show ipv6 interface tunnel number

Displays IPv6 information about the tunnel interface

Configuration Example: IPv4 and IPv6 GRE Tunnels with OSPFv3

Figure 13-1 shows the network topology for the configuration that follows, which demonstrates how to configure IPv4 and IPv6 GRE tunnels to allow for OSPFv3 connectivity between two customer edge routers that peer with separate ISP routers. This example assumes that ISP1 and ISP2 are configured to route traffic across the underlay network between CE1 and CE2. Tunnel 0 is used for IPv4 and Tunnel 1 is used for IPv6.

Images

Figure 13-1 Network Topology for IPv4/IPv6 GRE Example

The example is built following these steps:

Step 1. Underlay configuration (physical/logical interfaces, default routing).

Step 2. Overlay configuration (tunnel interfaces).

Step 3. Overlay routing with OSPFv3.

Step 1: Underlay Configuration

CE1(config)# ipv6 unicast-routing

Enables routing for IPv6 packets

CE1(config)# interface gigabitethernet 0/0/0

Enters interface configuration mode

CE1(config-if)# ip address 209.165.201.1 255.255.255.252

Applies an IPv4 address to the interface

CE1(config-if)# ipv6 address 2001:db8:209:201::1/64

Applies an IPv6 address to the interface

CE1(config-if)# no shutdown

Enables the interface

CE1(config-if)# exit

Exits interface configuration mode

CE1(config)# interface loopback 0

Enters interface configuration mode

CE1(config-if)# ip address 10.1.1.1 255.255.255.0

Applies an IPv4 address to the interface

CE1(config-if)# ipv6 address 2001:db8:10:1::1/64

Applies an IPv6 address to the interface

CE1(config-if)# exit

Exits interface configuration mode

CE1(config)# ip route 0.0.0.0 0.0.0.0 209.165.201.2

Defines an IPv4 default route to send all packets to ISP1

CE1(config)# ipv6 route ::/0 2001:db8:209:201::2

Defines an IPv6 default route to send all packets to ISP1

CE2(config)# ipv6 unicast-routing

Enables routing for IPv6 packets

CE2(config)# interface gigabitethernet 0/0/0

Enters interface configuration mode

CE2(config-if)# ip address 198.51.100.1 255.255.255.252

Applies an IPv4 address to the interface

CE2(config-if)# ipv6 address 2001:db8:198:51::1/64

Applies an IPv6 address to the interface

CE2(config-if)# no shutdown

Enables the interface

CE2(config-if)# exit

Exits interface configuration mode

CE2(config)# interface loopback 0

Enters interface configuration mode

CE2(config-if)# ip address 10.2.2.1 255.255.255.0

Applies an IPv4 address to the interface

CE2(config-if)# ipv6 address 2001:db8:10:2::1/64

Applies an IPv6 address to the interface

CE2(config-if)# exit

Exits interface configuration mode

CE2(config)# ip route 0.0.0.0 0.0.0.0 198.51.100.2

Defines an IPv4 default route to send all packets to ISP1

CE2(config)# ipv6 route ::/0 2001:db8:198:51::2

Defines an IPv6 default route to send all packets to ISP1

Step 2: Overlay Configuration

CE1(config)# interface tunnel 0

Enters interface configuration mode

CE1(config-if)# ip address 192.168.1.1 255.255.255.0

Applies an IPv4 address to the interface

CE1(config-if)# tunnel source gigabitethernet 0/0/0

Defines the physical source of the tunnel

CE1(config-if)# tunnel destination 198.51.100.1

Defines the tunnel destination across the underlay network

CE1(config-if)# tunnel mode gre ip

Enables GRE tunnel mode for IPv4. This is the default value and won’t appear in the running configuration

CE1(config-if)# ip mtu 1400

Lowers the MTU to 1400 bytes from its default of 1500

CE1(config-if)# ipv6 enable

Enables IPv6 on the interface. This is required for OSPFv3 routing in the next step since there is no IPv6 address on Tunnel 0

CE1(config-if)# interface tunnel 1

Enters interface configuration mode

CE1(config-if)# ipv6 address 2001:db8:192:100::1/64

Applies an IPv6 address to the interface

CE1(config-if)# tunnel source gigabitethernet 0/0/0

Defines the physical source of the tunnel

CE1(config-if)# tunnel destination 2001:db8:198:51::1

Defines the tunnel destination across the underlay network

CE1(config-if)# tunnel mode gre ipv6

Enables GRE tunnel mode for IPv6

CE2(config)# interface tunnel 0

Enters interface configuration mode

CE2(config-if)# ip address 192.168.1.2 255.255.255.0

Applies an IPv4 address to the interface

CE2(config-if)# tunnel source gigabitethernet 0/0/0

Defines the physical source of the tunnel

CE2(config-if)# tunnel destination 209.165.201.1

Defines the tunnel destination across the underlay network

CE2(config-if)# tunnel mode gre ip

Enables GRE tunnel mode for IPv4. This is the default value and won’t appear in the running configuration

CE2(config-if)# ip mtu 1400

Lowers the MTU to 1400 bytes from its default of 1500

CE2(config-if)# ipv6 enable

Enables IPv6 on the interface. This is required for OSPFv3 routing in the next step since there is no IPv6 address on Tunnel 0

CE2(config-if)# interface tunnel 1

Enters interface configuration mode

CE2(config-if)# ipv6 address 2001:db8:192:100::2/64

Applies an IPv6 address to the interface

CE2(config-if)# tunnel source gigabitethernet 0/0/0

Defines the physical source of the tunnel

CE2(config-if)# tunnel destination 2001:db8:209:201::1

Defines the tunnel destination across the underlay network

CE2(config-if)# tunnel mode gre ipv6

Enables GRE tunnel mode for IPv6

Step 3: Overlay Routing with OSPFv3

CE1(config)# router ospfv3 1

Starts OSPFv3 with a process ID of 1

CE1(config-router)# address-family ipv4 unicast

Creates the IPv4 unicast address family

CE1(config-router-af)# router-id 1.1.1.1

Defines a router ID of 1.1.1.1

CE1(config-router-af)# address-family ipv6 unicast

Creates the IPv6 unicast address family

CE1(config-router-af)# router-id 1.1.1.1

Defines a router ID of 1.1.1.1

CE1(config-router-af)# interface tunnel 0

Enters interface configuration mode

CE1(config-if)# ospfv3 1 ipv4 area 0

Assigns the Tunnel 0 interface to area 0 for the OSPFv3 IPv4 address family

CE1(config-if)# interface tunnel 1

Enters interface configuration mode

CE1(config-if)# ospfv3 1 ipv6 area 0

Assigns the Tunnel 1 interface to area 0 for the OSPFv3 IPv6 address family

CE1(config-router-af)# interface loopback 0

Enters interface configuration mode

CE1(config-if)# ospfv3 1 ipv4 area 1

Assigns the Loopback 0 interface to area 1 for the OSPFv3 IPv4 address family

CE1(config-if)# ospfv3 1 ipv6 area 1

Assigns the Loopback 0 interface to area 1 for the OSPFv3 IPv6 address family

CE2(config)# router ospfv3 1

Starts OSPFv3 with a process ID of 1

CE2(config-router)# address-family ipv4 unicast

Creates the IPv4 unicast address family

CE2(config-router-af)# router-id 2.2.2.2

Defines a router ID of 2.2.2.2

CE2(config-router-af)# address-family ipv6 unicast

Creates the IPv6 unicast address family

CE2(config-router-af)# router-id 2.2.2.2

Defines a router ID of 2.2.2.2

CE2(config-router-af)# interface tunnel 0

Enters interface configuration mode

CE2(config-if)# ospfv3 1 ipv4 area 0

Assigns the Tunnel 0 interface to area 0 for the OSPFv3 IPv4 address family

CE2(config-if)# interface tunnel 1

Enters interface configuration mode

CE2(config-if)# ospfv3 1 ipv6 area 0

Assigns the Tunnel 1 interface to area 0 for the OSPFv3 IPv6 address family

CE2(config-router-af)# interface loopback 0

Enters interface configuration mode

CE2(config-if)# ospfv3 1 ipv4 area 1

Assigns the Loopback 0 interface to area 1 for the OSPFv3 IPv4 address family

CE2(config-if)# ospfv3 1 ipv6 area 1

Assigns the Loopback 0 interface to area 1 for the OSPFv3 IPv6 address family

Site-to-Site GRE over IPsec

In GRE over IPsec (usually written GRE/IPsec for short), data packets are first encapsulated within GRE/IP, which results in a new IP packet being created inside the router. This packet is then selected for encryption (the traffic selector being GRE from local to remote endpoint IP address), and encapsulated into IPsec. Since a new IP header has already been added, IPsec transport mode is generally used to keep the overhead to a minimum. There are two different ways to encrypt traffic over a GRE tunnel:

  • Using crypto maps (old method)

  • Using tunnel IPsec profiles (newer method)

Note

Even though crypto maps are no longer recommended for tunnels, they are still widely deployed and should be understood.

The two GRE configuration scenarios that follow build on the previous GRE example but focus only on IPv4. You would configure one of the two scenarios, not both. Refer to Figure 13-1 for addressing information.

GRE/IPsec Using Crypto Maps

After the GRE tunnel has been configured, follow these steps to enable IPsec using crypto maps:

Step 1. Define a crypto ACL.

Step 2. Configure an ISAKMP policy for IKE SA.

Step 3. Configure pre-shared keys (PSKs).

Step 4. Create a transform set.

Step 5. Build a crypto map.

Step 6. Apply the crypto map to the outside interface.

Step 1: Define a Crypto ACL

CE1(config)# access-list 101 permit gre host 192.168.1.1 host 192.168.1.2

Defines the crypto ACL that identifies traffic entering the GRE tunnel. This traffic is encrypted by IPsec

CE2(config)# access-list 101 permit gre host 192.168.1.2 host 192.168.1.1

The crypto ACL on CE2 is a mirror image of the ACL on CE1

Step 2: Configure an ISAKMP Policy for IKE SA (repeat on CE2)

CE1(config)# crypto isakmp policy 1

Creates an ISAKMP policy number 1. Numbers range from 1 to 1000

CE1(config-isakmp)# authentication pre-share

Enables the use of PSKs for authentication. Option to use RSA signatures instead

CE1(config-isakmp)# hash sha256

Enables SHA-256 for hashing. Options are MD5, SHA, SHA-256, SHA-384, and SHA-512

CE1(config-isakmp)# encryption aes 256

Enables AES-256 for encryption. Options are DES, 3DES, and AES (128, 192, 256 bit)

CE1(config-isakmp)# group 14

Enables Diffie-Hellman group 14 for key exchange. Options are group 1, 2, 5, 14, 15, 16, 19, 20, 21, or 24

Step 3: Configure PSKs

CE1(config)# crypto isakmp key secretkey address 198.51.100.1

Defines a PSK for neighbor peer CE2

CE2(config)# crypto isakmp key secretkey address 209.165.201.1

Defines a PSK for neighbor peer CE1

Step 4: Create a Transform Set (repeat on CE2)

CE1(config)# crypto ipsec transform-set GRE-SEC esp-aes 256 esp-sha256-hmac

Defines an IPsec transform set called GRE-SEC that uses ESP with AES-256 for encryption and SHA-256 for authentication. Options are AH and MD5

CE1(cfg-crypto-trans)# mode transport

Enables transport mode to avoid double encapsulation from GRE and IPsec. The other option available is tunnel mode

Step 5: Build a Crypto Map (repeat on CE2 except for the peer configuration)

CE1(config)# crypto map GREMAP 1 ipsec-isakmp

Creates an IPsec crypto map called GREMAP with a sequence number of 1. Range is from 1 to 65535

Note

A message will appear at the console indicating that the crypto map will remain disabled until a peer and a valid ACL have been configured

CE1(config-crypto-map)# match address 101

Applies the previously configured crypto ACL to the crypto map

CE1(config-crypto-map)# set transform-set GRE-SEC

Applies the previously configured transform set to the crypto map

CE1(config-crypto-map)# set peer 198.51.100.1

Sets the remote peer, which in this case is CE2

CE2(config-crypto-map)# set peer 209.165.201.1

Sets the remote peer, which in this case is CE1

Step 6: Apply the Crypto Map to Outside Interface (repeat on CE2)

CE1(config)# interface gigabitethernet 0/0/0

Enters interface configuration mode

CE1(config-if)# crypto map GREMAP

Applies the crypto map to the outside interface connected to the ISP router

GRE/IPsec Using IPsec Profiles

After the GRE tunnel has been configured, follow these steps to enable IPsec using IPsec profiles:

Step 1. Configure an ISAKMP policy for IKE SA.

Step 2. Configure PSKs.

Step 3. Create a transform set.

Step 4. Create an IPsec profile.

Step 5. Apply the IPsec profile to the tunnel interface.

Step 1: Configure an ISAKMP Policy for IKE SA (repeat on CE2)

CE1(config)# crypto isakmp policy 1

Creates an ISAKMP policy number 1. Numbers range from 1 to 1000

CE1(config-isakmp)# authentication pre-share

Enables the use of PSKs for authentication. Option to use RSA signatures instead

CE1(config-isakmp)# hash sha256

Enables SHA-256 for hashing

Options are MD5, SHA, SHA-256, SHA-384, SHA-512

CE1(config-isakmp)# encryption aes 256

Enables AES-256 for encryption

Options are DES, 3DES, and AES (128, 192, 256 bit)

CE1(config-isakmp)# group 14

Enables Diffie-Hellman group 14 for key exchange. Options are group 1, 2, 5, 14, 15, 16, 19, 20, 21, or 24

Step 2: Configure PSKs

CE1(config)# crypto isakmp key secretkey address 198.51.100.1

Defines a PSK for neighbor peer CE2

CE2(config)# crypto isakmp key secretkey address 209.165.201.1

Defines a PSK for neighbor peer CE1

Step 3: Create a Transform Set (repeat on CE2)

CE1(config)# crypto ipsec transform-set GRE-SEC esp-aes 256 esp-sha256-hmac

Defines an IPsec transform set called GRE-SEC that uses ESP with AES-256 for encryption and SHA-256 for authentication. Options are AH and MD5

CE1(cfg-crypto-trans)# mode transport

Enables transport mode to avoid double encapsulation from GRE and IPsec. The other option is available is tunnel mode

Step 4: Create an IPsec Profile (repeat on CE2)

CE1(config)# crypto ipsec profile GRE-PROFILE

Creates an IPsec profile named GRE-PROFILE

CE1(ipsec-profile)# set transform-set GRE-SEC

Applies the previously configured transform set to the IPsec profile

Step 5: Apply the IPsec Profile to Tunnel Interface (repeat on CE2)

CE1(config)# interface tunnel 0

Enters interface configuration mode

CE1(config-if)# tunnel protection ipsec profile GRE-PROFILE

Applies the IPsec profile to the tunnel interface, allowing IPsec to encrypt traffic flowing between CE1 and CE2

Verifying GRE/IPsec

CE1# show crypto isakmp sa

Displays current Internet Key Exchange (IKE) security associations (SAs)

CE1# show crypto ipsec sa

Displays the settings used by IPsec security associations

Site-to-Site Virtual Tunnel Interface (VTI) over IPsec

The use of IPsec virtual tunnel interfaces (VTIs) simplifies the configuration process when you must provide protection for site-to-site VPN tunnels. A major benefit of IPsec VTIs is that the configuration does not require a static mapping of IPsec sessions to a physical interface. The use of IPsec VTIs simplifies the configuration process when you must provide protection for site-to-site VPN tunnels and offers a simpler alternative to the use of Generic Routing Encapsulation (GRE) tunnels for encapsulation and crypto maps with IPsec.

The steps to enable a VTI over IPsec are very similar to those for GRE over IPsec configuration using IPsec profiles. The only difference is the addition of the command tunnel mode ipsec {ipv4 | ipv6} under the GRE tunnel interface to enable VTI on it and to change the packet transport mode to tunnel mode. To revert to GRE over IPsec, the command tunnel mode gre {ip | ipv6} is used.

Assuming that the GRE tunnel is already configured for IPsec using IPsec profiles as was described in the previous configuration example, you would need to make the following changes to migrate to a VTI over IPsec site-to-site tunnel using pre-shared keys:

CE1

CE1(config)# crypto ipsec transform-set GRE-SEC esp-aes 256 esp-sha256-hmac

Defines an IPsec transform set called GRE-SEC that uses ESP with AES-256 for encryption and SHA-256 for authentication. Options are AH and MD5

CE1(cfg-crypto-trans)# mode tunnel

Enables tunnel mode for VTI support

CE1(cfg-crypto-trans)# exit

Exits the transform set

CE1(config)# interface tunnel 0

Enters interface configuration mode

CE1(config-if)# tunnel mode ipsec ipv4

Enables IPsec for IPv4 on the tunnel interface

CE2

CE2(config)# crypto ipsec transform-set GRE-SEC esp-aes 256 esp-sha256-hmac

Defines an IPsec transform set called GRE-SEC that uses ESP with AES-256 for encryption and SHA-256 for authentication. Options are AH and MD5

CE2(cfg-crypto-trans)# mode tunnel

Enables tunnel mode for VTI support

CE2(cfg-crypto-trans)# exit

Exits the transform set

CE2(config)# interface tunnel 0

Enters interface configuration mode

CE2(config-if)# tunnel mode ipsec ipv4

Enables IPsec for IPv4 on the tunnel interface

Cisco Dynamic Multipoint VPN (DMVPN)

Cisco DMVPN is a solution that leverages IPsec and GRE to enable enterprises to establish a secure connection in a hub-and-spoke network or spoke-to-spoke network easily and effectively. All of the spokes in a DMVPN network are configured to connect to the hub and, when interesting traffic calls for it, each spoke can connect directly to another spoke as well.

DMVPN uses two primary technologies:

  • Multipoint GRE (mGRE) with IPsec, which allows the routers in the solution to establish multiple GRE tunnels using only one configured tunnel interface

  • Next Hop Resolution Protocol (NHRP), which is similar to ARP on Ethernet

There are three different deployment options for DMVPN, which are called phases:

  • Phase 1: This phase can be deployed only as a hub-and-spoke tunnel deployment. In this deployment the hub is configured with an mGRE tunnel interface and the spokes have point-to-point GRE tunnel interface configurations. All traffic, including inter-spoke traffic, must traverse the hub.

  • Phase 2: This phase improves on Phase 1 by establishing a mechanism for spokes to build dynamic spoke-to-spoke tunnels on demand. Spokes in this deployment type have mGRE tunnel interfaces and learn of their peer spoke addresses and specific downstream routes using a routing protocol.

  • Phase 3: This phase is very similar to Phase 2, but the routing table must have the spoke address and all specific downstream routes propagated to all other spokes. This means that the hub cannot use summarization of routes in the routing protocol. The hub uses NHRP redirect messages to inform the spoke of a more effective path to the spoke’s network, and the spoke will accept the “shortcut” and build the dynamic tunnel to the peer spoke.

Configuration Example: Cisco DMVPN for IPv4

Figure 13-2 shows the network topology for the configuration that follows, which demonstrates how to configure Cisco DMVPN for IPv4. The example shows you how to configure all three DMVPN phases and assumes that the physical interfaces are already configured with IP addresses.

Images

Figure 13-2 Network Topology for Cisco DMVPN for IPv4 Example

When configuring Cisco DMVPN, follow these steps:

  1. Configure an ISAKMP policy for IKE SA.

  2. Configure pre-shared keys (PSKs).

  3. Create a transform set.

  4. Create a crypto IPsec profile.

  5. Define an mGRE tunnel interface.

  6. Enable NHRP on the tunnel interface.

  7. Apply the IPsec security profile to the tunnel interface.

  8. Enable dynamic routing across the tunnel interface.

DMVPN Phase 1: Hub Router

Hub(config)# crypto isakmp policy 10

Creates an ISAKMP policy with the number 10

Hub(config-isakmp)# encryption aes 256

Enables AES-256 encryption

Hub(config-isakmp)# hash sha256

Enables SHA-256 hashing

Hub(config-isakmp)# authentication pre-share

Enables PSK authentication

Hub(config-isakmp)# group 16

Enables Diffie-Hellman group 16 (4096-bit)

Hub(config-isakmp)# exit

Exits the ISAKMP policy

Hub(config)# crypto isakmp key CiscoDMVPNKey address 0.0.0.0

Defines a PSK to be used for any ISAKMP neighbor

Hub(config)# crypto ipsec transform-set DMVPNset esp-aes 256 esp-sha256-hmac

Creates an IPsec transform set called DMVPNset that uses AES-256 and SHA-256 for ESP

Hub(cfg-crypto-trans)# mode transport

Enables tunnel mode for the IPsec tunnel

Hub(cfg-crypto-trans)# exit

Exits the transform set

Hub(config)# crypto ipsec profile DMVPNprofile

Creates an IPsec profile called DMVPNprofile

Hub(ipsec-profile)# set transform-set DMVPNset

Applies the DMVPNset transform set

Hub(ipsec-profile)# exit

Exits the IPsec profile

Hub(config)# interface tunnel 0

Enters interface configuration mode

Hub(config-if)# ip address 10.99.1.1 255.255.255.0

Applies an IP address to the tunnel interface

Hub(config-if)# no ip redirects

Disables ICMP redirects, because NHRP will be responsible for sending redirect messages

Hub(config-if)# ip mtu 1400

Reduces the IP MTU from 1500 to 1400 bytes

Hub(config-if)# ip tcp adjust-mss 1360

Reduces the TCP maximum segment size to 1360

Hub(config-if)# ip nhrp authentication cisco

Configures a password of cisco for NHRP authentication

Hub(config-if)# ip nhrp map multicast dynamic

Allows NHRP to automatically add spoke routers to the multicast NHRP mappings when these spoke routers initiate the mGRE tunnel and register their unicast NHRP mappings

Hub(config-if)# ip nhrp network-id 123

Defines an NHRP network ID

Hub(config-if)# tunnel source gigabitethernet 0/0/0

Specifies a tunnel source

Hub(config-if)# tunnel mode gre multipoint

Enables mGRE on the Hub router0

Hub(config-if)# tunnel key 12345

Uniquely identifies the tunnel within the router

Hub(config-if)# tunnel protection ipsec profile DMVPNprofile

Applies the IPsec security profile to secure the DMVPN packet exchange

Hub(config-if)# exit

Exits interface configuration mode

Hub(config)# router eigrp CISCO

Enables EIGRP using named mode configuration

Hub(config-router)# address-family ipv4 unicast autonomous-system 10

Creates an IPv4 address family for AS 10

Hub(config-router-af)# network 172.16.1.1 0.0.0.0

Advertises network 172.16.1.1/32

Hub(config-router-af)# network 10.99.1.0 0.0.0.255

Advertises network 10.99.1.0/24 (the tunnel interface network)

Hub(config-router-af)# af-interface tunnel 0

Enters address-family interface configuration mode for Tunnel 0

Hub(config-router-af-interface)# no split-horizon

Disables split horizon to allow the hub to retransmit routes learned from the peers to the other peers. Because all the routes are being learned through the tunnel interface, EIGRP will not by default advertise routes learned from an interface back out the same interface

DMVPN Phase 1: Spoke1 Router (similar configuration required on Spoke2)

Spoke1(config)# crypto isakmp policy 10

Creates an ISAKMP policy with the number 10

Spoke1(config-isakmp)# encryption aes 256

Enables AES-256 encryption

Spoke1(config-isakmp)# hash sha256

Enables SHA-256 hashing

Spoke1(config-isakmp)# authentication pre-share

Enables PSK authentication

Spoke1(config-isakmp)# group 16

Enables Diffie-Hellman group 16 (4096-bit)

Spoke1(config-isakmp)# exit

Exits the ISAKMP policy

Spoke1(config)# crypto isakmp key CiscoDMVPNKey address 0.0.0.0

Defines a PSK to be used for any ISAKMP neighbor

Spoke1(config)# crypto ipsec transform-set DMVPNset esp-aes 256 esp-sha256-hmac

Creates an IPsec transform set called DMVPNset that uses AES-256 and SHA-256 for ESP

Spoke1(cfg-crypto-trans)# mode transport

Enables tunnel mode for the IPsec tunnel

Spoke1(cfg-crypto-trans)# exit

Exits the transform set

Spoke1(config)# crypto ipsec profile DMVPNprofile

Creates an IPsec profile called DMVPNprofile

Spoke1(ipsec-profile)# set transform-set DMVPNset

Applies the DMVPNset transform set

Spoke1(ipsec-profile)# exit

Exits the IPsec profile

Spoke1(config)# interface tunnel 0

Enters interface configuration mode

Spoke1(config-if)# ip address 10.99.1.101 255.255.255.0

Applies an IP address to the tunnel interface

Spoke1(config-if)# no ip redirects

Disables ICMP redirects, because NHRP will be responsible for sending redirect messages

Spoke1(config-if)# ip mtu 1400

Reduces the IP MTU from 1500 to 1400 bytes

Spoke1(config-if)# ip tcp adjust-mss 1360

Reduces the TCP maximum segment size to 1360

Spoke1(config-if)# ip nhrp authentication cisco

Configures a password of cisco for NHRP authentication

Spoke1(config-if)# ip nhrp map 10.99.1.1 10.99.0.1

Maps the hub tunnel interface and physical interface together. This instructs the router that NHRP messages to the Hub router should be sent to the physical IP address

Spoke1(config-if)# ip nhrp map multicast 10.99.0.1

Maps NHRP multicast traffic to the physical address of the Hub router

Spoke1(config-if)# ip nhrp network-id 123

Defines an NHRP network ID

Spoke1(config-if)# ip nhrp nhs 10.99.1.1

Defines the NHRP server address

Spoke1(config-if)# tunnel source gigabitethernet 0/0/0

Specifies a tunnel source

Spoke1(config-if)# tunnel destination 10.99.0.1

Defines the Hub router’s physical address as the tunnel destination

Spoke1(config-if)# tunnel mode gre ip

Enables standard GRE on the Spoke1 router

Spoke1(config-if)# tunnel key 12345

Uniquely identifies the tunnel within the router

Spoke1(config-if)# tunnel protection ipsec profile DMVPNprofile

Applies the IPsec security profile to secure the DMVPN packet exchange

Spoke1(config-if)# exit

Exits interface configuration mode

Spoke1(config)# router eigrp CISCO

Enables EIGRP using named mode configuration

Spoke1(config-router)# address-family ipv4 unicast autonomous-system 10

Creates an IPv4 address family for AS 10

Spoke1(config-router-af)# network 172.16.101.1 0.0.0.0

Advertises network 172.16.101.1/32

SPOKE1(config-router-af)# network 10.99.1.0 0.0.0.255

Advertises network 10.99.1.0/24 (the tunnel interface network)

For DMVPN Phase 2, you need to change the tunnel mode on the spokes and modify the routing configuration on the hub. Contrary to Phase 1, this configuration will allow the routers to build dynamic spoke-to-spoke tunnels based on traffic needs. The tunnel to the hub will be persistent.

DMVPN Phase 2: Hub Router

Hub(config)# router eigrp CISCO

Enters EIGRP using named mode configuration

Hub(config-router)# address-family ipv4 unicast autonomous-system 10

Enters the IPv4 address family for AS 10

Hub(config-router-af)# af-interface tunnel 0

Enters address-family interface configuration mode for Tunnel 0

Hub(config-router-af-interface)# no next-hop-self

Disables the EIGRP next-hop self feature. By default, the router will insert its IP address as the next hop on the updates sent to the peers. In Phase 2 DMVPN the spokes must see the tunnel interface IP address of the other spokes as the next hop for the remote networks, instead of the hub

DMVPN Phase 2: Spoke1 Router (identical configuration required on Spoke2)

Spoke1(config)# interface tunnel 0

Enters interface configuration mode

Spoke1(config-if)# no tunnel destination 10.99.0.1

Removes the tunnel destination command

Spoke1(config-if)# tunnel mode gre multipoint

Changes the tunnel mode to mGRE

Phase 3 DMVPN is designed for the hub to only advertise a summary address to the spokes, and only when there is a better route to the destination network will the hub tell the spoke about it. This is done using an NHRP traffic indication message to signal the spoke that a better path exists. To do this, you need to make a few configuration changes.

DMVPN Phase 3: Hub Router

Hub(config)# interface tunnel 0

Enters interface configuration mode

Hub(config-if)# ip nhrp redirect

NHRP Redirect is configured on the hub, instructing it to send the NHRP traffic indication message if a better route exists

Hub(config-if)# exit

Exits interface configuration mode

Hub(config)# router eigrp CISCO

Enters EIGRP using named mode configuration

Hub(config-router)# address-family ipv4 unicast autonomous-system 10

Enters the IPv4 address family for AS 10

Hub(config-router-af)# af-interface tunnel 0

Enters address-family interface configuration mode for Tunnel 0

Hub(config-router-af-interface)# summary-address 0.0.0.0 0.0.0.0

Advertises a summary address. In this case the summary advertised is an EIGRP default route (D*)

DMVPN Phase 3: Spoke1 Router (identical configuration required on Spoke2)

Spoke1(config)# interface tunnel 0

Enters interface configuration mode

Spoke1(config-if)# ip nhrp shortcut

Enables NHRP shortcut switching on the interface. This allows the spoke router to discover shorter paths to a destination network after receiving an NHRP redirect message from the hub. The spokes can then communicate directly with each other without the need for an intermediate hop

Verifying Cisco DMVPN

Router# show dmvpn

Displays DMVPN-specific session information

Router# show ip nhrp

Displays NHRP mapping information

Router# show ip nhrp nhs detail

Displays NHRP NHS information

Router# debug dmvpn

Displays real-time information about DMVPN sessions

Router# debug nhrp

Displays real-time information about NHRP

Note

Running OSPF over a DMVPN network has some of the same challenges as running OSPF over other types of networks. Because only the hub is in direct communication with all of the branches, it should be configured as the designated router (DR) on the DMVPN subnet. There is not typically a backup DR (BDR) for this type of configuration. A BDR is possible if a second hub is placed on the same subnet.

In strict hub-and-spoke DMVPNs, you should include the tunnel interface in the OSPF routing process and configure the tunnel interface as a point-to-multipoint OSPF network type on the hub router, and as a point-to-point network type on the branch routers. In this case, there is no need to elect a DR on the DMVPN subnet.

To create a partially meshed or fully meshed DMVPN, configure the mGRE tunnel on the hub router as an OSPF broadcast network. Each spoke router should be configured with an OSPF priority of 0 to prevent a spoke from becoming a DR or BDR.

VRF-Lite

Virtual routing and forwarding (VRF) is a technology that creates separate virtual routers on a physical router. Router interfaces, routing tables, and forwarding tables are completely isolated between VRFs, preventing traffic from one VRF from forwarding into another VRF. All router interfaces belong to the global VRF until they are specifically assigned to a user-defined VRF. The global VRF is identical to the regular routing table of non-VRF routers.

The use of Cisco VRF-Lite technology has the following advantages:

  • Allows for true routing and forwarding separation

  • Simplifies the management and troubleshooting of the traffic belonging to the specific VRF, because separate forwarding tables are used to switch that traffic

  • Enables the support for alternate default routes

Configuring VRF-Lite

Follow these steps when configuring a Cisco router for VRF-Lite support:

Step 1. Create the VRF(s).

Step 2. Assign interface(s) to the VRF.

Step 3. Enable routing for the VRF.

Step 1: Create the VRFs

Router(config)# ip vrf GUEST

Creates an IPv4 VRF called GUEST using the old VRF CLI format

Router(config-vrf)# exit

Exits VRF configuration mode

Router(config)# vrf definition STAFF

Creates a VRF called STAFF using the new VRF CLI format

Router(config-vrf)# address-family ipv4

Enables the IPv4 address family for the STAFF VRF using the new VRF CLI format

Router(config-vrf-af)# exit

Exits the IPv4 address family

Router(config-vrf)# address-family ipv6

Enables the IPv6 address family for the STAFF VRF using the new VRF CLI format

Router(config-vrf-af)# exit

Exits the IPv6 address family

Router(config-vrf)# exit

Exits VRF configuration mode

Step 2: Assign an Interface to the VRF

Router(config)# interface gigabitethernet 0/0/0

Enters interface configuration mode

Router(config-if)# ip vrf forwarding GUEST

Assigns the GigabitEthernet 0/0/0 interface to the GUEST VRF using the old CLI format

Router(config-if)# interface gigabitethernet 0/0/1

Enters interface configuration mode

Router(config-if)# vrf forwarding STAFF

Assigns the GigabitEthernet 0/0/1 interface to the STAFF VRF using the new CLI format

Step 3: Enable Routing for the VRF

The following configuration examples demonstrate how IPv4 VRFs can be associated with a routing process. The same commands would apply for IPv6 VRFs.

Router(config)# ip route vrf GUEST 0.0.0.0 0.0.0.0 172.16.16.2

Defines a default route for the GUEST VRF

Router(config)# router ospf 1 vrf STAFF

Enables OSPFv2 for the STAFF VRF

Router(config)# router ospfv3 1

Enables OSPFv3

Router(config-router)# address-family ipv4 unicast vrf STAFF

Assigns the STAFF VRF to the IPv4 unicast address family

Router(config)# router eigrp CISCO

Enables EIGRP using named mode configuration

Router(config-router)# address-family ipv4 unicast vrf GUEST autonomous-system 100

Assigns the GUEST VRF to the IPv4 unicast address family for AS 100

Router(config)# router bgp 65001

Enables BGP for AS 65001

Router(config-router)# address-family ipv4 vrf STAFF

Assigns the STAFF VRF to the IPv4 address family

Note

Cisco IOS supports the old and new VRF CLI formats. Old Cisco IOS VRF configuration style supports IPv4 only. New multiprotocol VRF CLI now supports both IPv4 and IPv6. Cisco IOS offers a migration tool that upgrades a VRF instance or all VRFs configured on the router to support multiple address families under the same VRF. The vrf upgrade-cli multi-af-mode {common-policies | non-common-policies} [vrf vrf-name] command is issued in global configuration mode.

Verifying VRF-Lite

Router# show vrf

Displays a list of all configured VRFs, their address families, and their interfaces

Router# show vrf detail vrf-name

Provides detailed information about a specific VRF

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.137.218.215