5. VPN options
Point-to-point IPSec tunnels
Tunnel interface growth on hub
One per spoke
All traffic transit the hub
Reconfiguration of hub everytime
new site is added/removed
6. VPN options
Point-to-point IPSec tunnels
Tunnel interface growth on hub
One per spoke
All traffic transit the hub
Reconfiguration of hub everytime
new site is added/removed
Dynamic Multi-pointVPN (DMVPN)
Multi-point GRE (mGRE)
Next Hop Resolution Protocol (NHRP)
Redirect
Automatic creation of tunnels
Cisco solution
11. Common configuration (mGRE + IPsec)
# Create multi-point GRE interface
sudo ip tunnel add mpgre0 mode gre key 98701234 ttl 64
sudo ip addr add 10.100.0.1/24 dev mpgre0
sudo ip link set mpgre0 up
# Define pre-shared key for IKE negotiation
sudo bash -c 'cat << EOF >> /etc/racoon/psk.txt
demo@openstack-summit.com rocky-summit
EOF'
Change address to
10.100.0.2/24 and
10.100.0.3/24, respectively
for the spoke nodes
Select a GRE key for
the DMVPN
13. Common configuration (IKE + IPsec)
sainfo anonymous {
pfs_group 2;
lifetime time 12 hour;
encryption_algorithm aes, 3des, blowfish 448, rijndael;
authentication_algorithm hmac_sha1, hmac_md5;
compression_algorithm deflate;
}
EOF'
# Generate configuration for IPSec
sudo bash -c 'cat << EOF >> /etc/ipsec-tools.conf
spdflush;
# Encrypt all traffic in ESP transport mode
spdadd 0.0.0.0/0 0.0.0.0/0 gre -P out ipsec esp/transport//require;
spdadd 0.0.0.0/0 0.0.0.0/0 gre -P in ipsec esp/transport//require;
EOF'
14. Hub configuration (OpenNHRP daemon)
# Generate configuration for OpenNHRP hub
sudo bash -c 'cat << EOF >> /etc/opennhrp/opennhrp.conf
interface mpgre0
holding-time 3600
# make this a hub node
multicast dynamic
# send redirects to enable spoke-to-spoke communication
redirect
interface eth0
# Create shortcut routes for subnets on this interface
shortcut-destinationEOF'
15. Spoke configuration (OpenNHRP daemon)
# Generate configuration for OpenNHRP spoke
sudo bash -c 'cat << EOF >> /etc/opennhrp/opennhrp.conf
interface mpgre0
# register with hub
map 10.100.0.1/24 18.216.240.85 register
holding-time 3600
# act as a spoke
multicast nhs
# Enable shortcut routes
shortcut
# dynamically create tunnels to other spokes
redirect
interface eth0
# Create shortcut routes for subnets on this interface
shortcut-destination
16. Configuration (static routing)
# Enable IPv4 forwarding
sudo sysctl -w net.ipv4.ip_forward=1
# Set static routes (for hub node)
sudo ip route add 10.0.2.0/24 nexthop via 10.100.0.2
sudo ip route add 10.10.0.0/24 nexthop via 10.100.0.3
# Set static routes (for spoke node in Azure)
sudo ip route add 10.20.0.0/24 nexthop via 10.100.0.1
sudo ip route add 10.0.2.0/24 nexthop via 10.100.0.2
# Set static routes (for spoke node in AWS)
sudo ip route add 10.20.0.0/24 nexthop via 10.100.0.1
sudo ip route add 10.10.0.0/24 nexthop via 10.100.0.3
17. Start services
# Restart setkey and racoon services
sudo service setkey restart
sudo service racoon restart
# Start opennhrp service
sudo opennhrp -v
24. AzureVM OpenNHRP spoke daemon output
...
opennhrp[115081]: Traffic Indication from proto src 10.100.0.1; about packet to
10.0.2.246
...
opennhrp[115081]: Received Resolution Reply 10.0.2.246/24 is at proto 10.100.0.2 nbma
10.0.2.246
opennhrp[115081]: NAT detected: really at proto 10.100.0.2 nbma 13.58.97.150
...
Create link from 10.100.0.3 (10.10.0.4) to 10.100.0.2 (13.58.97.150)
...
opennhrp[115081]: Adding shortcut-route 10.0.2.0/24 nexthop 10.100.0.2 dev mpgre0
expires_in 120:00
...
VPN connexion established
Phase 2 established : 10.10.0.4[4500] -> 13.58.97.150[4500]
opennhrp[115081]: [10.100.0.2] Peer up script: success
...
26. AzureVM OpenNHRP DB
ubuntu@vm-B:~$ sudo opennhrpctl show
Status: ok
...
Interface: mpgre0
Type: localProtocol-Address: 10.100.0.3/32
Flags: up
Interface: mpgre0
Type: cached
Protocol-Address: 10.100.0.2/32
NBMA-Address: 13.58.97.150
NBMA-NAT-OA-Address: 10.0.2.246
Flags: up
Expires-In: 52:38
Interface: mpgre0
Type: static
Protocol-Address: 10.100.0.1/24
NBMA-Address: 18.216.240.85
Flags: up
27. Traceroute 2: Azure spoke to AWS spoke
ubuntu@vm-B:~$ traceroute 10.0.2.246
traceroute to 10.0.2.246 (10.0.2.246), 30 hops max, 60 byte packets
1 10.0.2.246 (10.0.2.246) 78.031 ms 77.977 ms 77.948 ms
28. Conclusion
Open source DMVPN possible for multi-cloud use cases
Before you deploy in production:TEST EXTENSIVELY for
Stability
Performance
Compatibility with vendor implemenations
Caveats
Packages for popular distros
Documentation
29. References and FutureWork
Links
https://sourceforge.net/projects/opennhrp
http://savannah.nongnu.org/projects/quagga/
https://wiki.vyos.net/wiki/DMVPN
Shannon McFarland
Multicloud Networking – Connecting OpenStack Private Clouds to Public
Clouds, (Tuesday 22, 9:00am - 9:40am)
Possible extensions toVPNaaS
Slides available at: https://www.slideshare.net/BobMelander/