Setting up vxlan tunnel on ec2 instances in different VPC [on hold]

        I am trying to setup a vxlan tunnel between two ec2 instances. My first scenario works fine.
I have two Ubuntu18.04 ec2 instances running in same VPC and subnet. vxlan Tunnel between ec2 instanes in same subnet The commands used were below
Host1: ip link add vxlan1 type vxlan id 10332 l2miss l3miss rsc proxy nolearning dev eth0
Host2: ip link add vxlan1 type vxlan id 10332 l2miss l3miss rsc proxy nolearning dev eth0

Host1: ifconfig vxlan1 192.20.0.1/24
Host2: ifconfig vxlan1 192.20.0.2/24

Host1: bridge fdb add e2:d2:bd:27:61:98 dst 10.0.154.249 dev vxlan1
Host2: bridge fdb add 06:56:36:b4:45:30 dst 10.0.154.21 dev vxlan1

Host1: arp -s 192.20.0.2 e2:d2:bd:27:61:98
Host2: arp -s 192.20.0.1 06:56:36:b4:45:30
Now the scenario, where I need your thoughts, has two ec2 instances running in different vpcs. Both instances have public IP attached to them. I am trying to use public IPs of interfaces (rather than the private IPs which are inacessible). Below are the commands
Host1: ip link add vxlan1 type vxlan id 10332 l2miss l3miss rsc proxy nolearning dev eth0
Host2: ip link add vxlan1 type vxlan id 10332 l2miss l3miss rsc proxy nolearning dev eth0

Host1: ifconfig vxlan1 192.20.0.1/24
Host2: ifconfig vxlan1 192.20.0.2/24

Host1: bridge fdb add e2:d2:bd:27:61:98 dst <PUBLIC-IP-OF-EC2> dev vxlan1
Host2: bridge fdb add 06:56:36:b4:45:30 dst <PUBLIC-IP-OF-EC2> dev vxlan1

Host1: arp -s 192.20.0.2 e2:d2:bd:27:61:98
Host2: arp -s 192.20.0.1 06:56:36:b4:45:30
My expectation is that when I ping 192.20.0.2 from instance 1, instance 1 should send the packet to vxlan1 interface which will encapsulate the packet with public IP of instance 2 as destination. However, ping is failing. Can you share your thoughts on why it is not working. Thanks for your time. Reference: http://blog.arunsriraman.com/2017/02/how-to-setting-up-gre-or-vxlan-tunnel.html
Tags :

Leave Your Comment

Leave a Reply

%d bloggers like this: