To create a tunnel between two machines connected to the same network, I can run the following commands:
From host A:
sudo ip link add gretap1 type gretap local HOST_A_IP remote HOST_B_IP
sudo ip link set gretap1 up
From host B:
sudo ip link add gretap1 type gretap local HOST_B_IP remote HOST_A_IP
sudo ip link set gretap1 up
Here because A and B are on the same network, I can use private IP addresses 192.168.x.x
.
Now, I would like to create a tunnel between two AWS EC2 instances. I am able to create it using PPP over SSH, but can I create it with the above method ?
Here is the big picture:
I need traffic to be exchanged between the local interfaces of hosts A and B through the tunnel.