Example GRE configuration for Cisco ISR

This GRE configuration example is for Cisco ISR routers using Cisco IOS.

interface Tunnel0
ip address 10.54.163.0 255.255.255.252
ip tcp adjust-mss 1436
tunnel source 13.229.254.0
tunnel destination 157.167.231.203
 
interface Tunnel1
ip address 10.54.165.0 255.255.255.252
ip tcp adjust-mss 1436
tunnel source 13.229.254.0
tunnel destination 67.202.10.242

access-list 104 permit tcp 10.54.164.0 0.0.0.255 any eq www
access-list 104 permit tcp 10.54.164.0 0.0.0.255 any eq 443

route-map Primary_Tunnel permit 11
match ip address 104
set interface Tunnel0
 
route-map Failover_Tunnel permit 12
match ip address 104
set interface Tunnel1

interface GuestVLAN
ip address 10.54.164.0 255.255.255.0
ip nat inside
ip virtual-reassembly in
ip policy route-map Primary_Tunnel
duplex auto
speed auto

ip route 116.50.59.230 255.255.255.255 Tunnel0

ip sla 4
icmp-echo 116.50.59.230 source-interface Tunnel0
threshold 3000
timeout 30000
frequency 30
ip sla schedule 4 life forever start-time now
 
track 4 ip sla 4
delay down 10 up 10
 
event manager session cli username <username>
event manager applet failover_if_primary_tunnel_goes_down
event track 4 state down
action 001 cli command "conf t"
action 002 cli command "interface IotVLAN"
action 003 cli command "ip policy route-map Secondary_Tunnel"
action 004 cli command "end"
action 005 cli command "exit"

event manager applet route_back_to_primary_when_available
event track 4 state up
action 001 cli command "conf t"
action 002 cli command "interface IotVLAN  "
action 003 cli command "ip policy route-map Primary_Tunnel"
action 004 cli command "end"
action 005 cli command "exit"