0

So I have a virtual device with ip 192.168.16.15/24(device X). I'm trying to ping this from another device 10.64.95.120/24(device A). This virtual device(device X) is created on another server 10.64.95.93/24(device B).

1) I'm able to ping from device B to device X.

2) I'm able to ping from device B to device A

My problem is I cannot ping from device A to device X.

So I tried creating a tunnel between device A and device B like below

in Device A

ip tunnel add tun23 mode ipip remote "device B ip"
ip addr add 25.2.2.2/24 dev tun23
ip link set dev tun23 up
ip route add 192.168.16.0/24 via 25.2.2.2
sysctl -w net.ipv4.ip_forward=1

and in Device B

ip tunnel add tun23 mode ipip remote "device A ip"
ip addr add 25.2.2.1/24 dev tun23
ip link set dev tun23 up

All adding all these I get netstat -nr in device A

Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
10.64.94.0      0.0.0.0         255.255.255.128 U         0 0          0 eth0
23.1.1.0        0.0.0.0         255.255.255.0   U         0 0          0 tun23
192.168.16.0    23.1.1.2        255.255.255.0   UG        0 0          0 tun23
mac
  • 101
  • 2

1 Answers1

0

Resolved this myself by adding a static route instead of ip tunnel

mac
  • 101
  • 2