Skip to content

Instantly share code, notes, and snippets.

@nerdalert
Last active January 22, 2026 03:26
Show Gist options
  • Select an option

  • Save nerdalert/5276aeaf04cb730b21be1929ab6905a4 to your computer and use it in GitHub Desktop.

Select an option

Save nerdalert/5276aeaf04cb730b21be1929ab6905a4 to your computer and use it in GitHub Desktop.

Geneve tunnels using netlink examples

Scenario A - pointing to an interface as the next hop

Host A configuration (eth0 - 192.168.1.191):

# Remote Address is the IP of Host B eth0
sudo ip link add name geneve0 type geneve id 1000 remote 192.168.1.192
sudo ip link set geneve0 up
sudo ip addr add 10.200.1.1/32 dev geneve0
sudo ip route add 10.200.2.1/32 dev geneve0

Host B configuration (eth0 - 192.168.1.192):

# Remote Address is the IP of Host A eth0
sudo ip link add name geneve0 type geneve id 1000 remote 192.168.1.191
sudo ip link set geneve0 up
sudo ip addr add 10.200.2.1/32 dev geneve0
sudo ip route add 10.200.1.1/32 dev geneve0

Verify connectivity between geneve0 interfaces

# On host A
ping 10.200.2.1
# On host B
ping 10.200.1.1

Scenario B - pointing to an ip as the next hop with the geneve tunnels on the same broadcast domain

Host A configuration (eth0 - 192.168.1.191):

# Remote Address is the IP of Host B eth0
sudo ip link add name geneve0 type geneve id 1000 remote 192.168.1.192
sudo ip link set geneve0 up
sudo ip addr add 10.200.1.1/30 dev geneve0

Host B configuration (eth0 - 192.168.1.192):

# Remote Address is the IP of Host A eth0
sudo ip link add name geneve0 type geneve id 1000 remote 192.168.1.191
sudo ip link set geneve0 up
sudo ip addr add 10.200.1.2/30 dev geneve0

Verify connectivity between geneve0 interfaces

# On host A
ping 10.200.1.2
# On host B
ping 10.200.1.1
@rajeshrah22
Copy link

For scenario A, I was using 2 VMs as hosts on a Fedora laptop. I had to enable udp port 6081 in firewalld on both servers. Did not need to touch the host (laptop) firewall rules as it by default allows communication between VMs in the virtual network.

Thanks for this, I was able to get started with learning about geneve.

@rajeshrah22
Copy link

https://gist.github.com/rajeshrah22/bda1183f74ab078589fc5c6d78b34715
For an example with network namespaces within one host.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment