GRE Tunnel

similar to IPIP but can transmit multicast + unicast
will route traffic from Network A > ServerA > ServerB > Network B

on Rocky 8

Server A

check if GRE mod is loaded
serverA> lsmod | grep gre

enable GRE mod if not loaded
serverA>
modprobe ip_gre

start ip_gre at boot
serverA> echo "/sbin/modprobe ip_gre > /dev/null 2>&1" > /etc/sysconfig/modules/ip_gre.modules
serverA> chmod 755 /etc/sysconfig/modules/ip_gre.modules

enable IP forwarding
serverA> echo "net.ipv4.ip_forward = 1" /etc/sysctl.conf && sysctl -p /etc/sysctl.conf

create GRE iface
serverA> nmcli c add type ip-tunnel ip-tunnel.mode gre con-name gre1 ifname gre1 remote 198.51.100.5 local 203.0.113.10
serverA> nmcli c modify gre1 ipv4.address 10.0.1.1/30
serverA> nmcli c modify gre1 ipv4.method manual

add a static route for network A to go to network B via ServerB
serverA> nmcli c modify gre1 +ipv4.routes "172.16.0.0/24 10.0.1.2"
to remove routes: nmcli c modify gre1 -ipv4.routes "172.16.0.0/24 10.0.1.2"

Bring up tunnel
serverA> nmcli c up gre1


Server B