Typically VxLAN is used to setup a point to multi-point overlay networks. However GRE also offers a similar capability which is often not heavily used. This document calls out how to setup an effient overlay mesh network to link up multiples sits together using multi point GRE tunnels.
The setup used in this case assumes there is a need to link three sites hosting three different subnets together using a simple overlay mesh network.
- Node A: 192.168.33.1 hosting subnet 10.0.1.0/24
- Node B: 192.168.33.2 hosting subnet 10.0.2.0/24
- Node C: 192.168.33.3 hosting subnet 10.0.3.0/24
We desire seamless connectivity between all the three subnets 10.0.1.0/24, 10.0.2.0/24 and 10.0.3.0/24.
On Node A:
ip tunnel add overNet mode gre local 192.168.33.1 key 1234
ip addr add 10.0.0.1/24 dev overNet
ip neighbor add 10.0.0.2 lladdr 192.168.33.2 dev overNet
ip neighbor add 10.0.0.3 lladdr 192.168.33.3 dev overNet
ip link set dev overNet up
ip route add 10.2.0.0/24 via 10.0.0.2
ip route add 10.3.0.0/24 via 10.0.0.3
Repeat these steps on Node B and Node C, with appropriate changes.
ip tunnel add overNet mode gre local 192.168.33.2 key 1234
ip addr add 10.0.0.2/24 dev overNet
ip neighbor add 10.0.0.1 lladdr 192.168.33.1 dev overNet
ip neighbor add 10.0.0.3 lladdr 192.168.33.3 dev overNet
ip link set dev overNet up
ip route add 10.1.0.0/24 via 10.0.0.1
ip route add 10.3.0.0/24 via 10.0.0.3
ip tunnel add overNet mode gre local 192.168.33.3 key 1234
ip addr add 10.0.0.3/24 dev overNet
ip neighbor add 10.0.0.2 lladdr 192.168.33.2 dev overNet
ip neighbor add 10.0.0.3 lladdr 192.168.33.3 dev overNet
ip link set dev overNet up
ip route add 10.2.0.0/24 via 10.0.0.2
ip route add 10.3.0.0/24 via 10.0.0.3
Now you will be able to reach all the subnets seamlessly with Node A, Node B and Node C acting as a routers and for traffic traversing across subnets