How to create vxlan tunell between two servers using ip command
Issue
There is a need to create vxlan tunnel between the server A and server B testing purpose.
An overlay network 1.1.1.0/24 should be created between them.
server A: vxlan1 1.1.1.1 em1 10.37.192.102
server B: vxlan1 1.1.1.2 em1 10.40.194.61
Environment
- two rhel systems with a reachable network path between them
Server A - 10.37.192.102
# ip a show dev em1
em1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
link/ether 20:47:47:85:e3:d6 brd ff:ff:ff:ff:ff:ff
inet 10.37.192.102/22 brd 10.37.195.255 scope global noprefixroute dynamic em1
# ip r get 10.40.194.61
10.40.194.61 via 10.37.195.254 dev em1 src 10.37.192.102
# ping -c1 10.40.194.61
PING 10.40.194.61 (10.40.194.61) 56(84) bytes of data.
64 bytes from 10.40.194.61: icmp_seq=1 ttl=57 time=14.3 ms
--- 10.40.194.61 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 14.342/14.342/14.342/0.000 ms
Server B - 10.40.194.61
# ip a show dev em1
em1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
link/ether 54:ee:75:cb:1c:44 brd ff:ff:ff:ff:ff:ff
inet 10.40.194.61/20 brd 10.40.207.255 scope global noprefixroute dynamic em1
# ip r get 10.37.192.102
10.37.192.102 via 10.40.192.1 dev em1 src 10.40.194.61 uid 0
# ping -c1 10.37.192.102
PING 10.37.192.102 (10.37.192.102) 56(84) bytes of data.
64 bytes from 10.37.192.102: icmp_seq=1 ttl=57 time=16.0 ms
--- 10.37.192.102 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 15.974/15.974/15.974/0.000 ms
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.