I try to route 137.74.9.193 from server A to server B (Ubuntu 16.04).
If i try to ping 137.74.9.193 from Server A it works as expected, but when i try to ping from my personal computer it doesn't work.
Server A:
Public IP (ens3): 213.32.69.16
Public IP: 137.74.9.193
Local Tunnel IP: 10.0.0.1
Server B:
Public IP (eth0): 139.59.131.76
Local Tunnel IP: 10.0.0.2
Configuration on Server A:
nano /etc/network/interfaces
auto lo
iface lo inet loopback
auto ens3
iface ens3 inet dhcp
auto tun1
iface tun1 inet static
address 10.0.0.1
netmask 255.255.255.252
pre-up iptunnel add tun1 mode gre local 213.32.69.16 remote 139.59.131.76 ttl 255
up ifconfig tun1 multicast
up ifconfig tun1 arp
up ifconfig tun1 broadcast
pointopoint 10.0.0.2
post-up ip route add 137.74.9.193 via 10.0.0.2 dev tun1
post-down iptunnel del tun1
Commands executed:
# enable ip forward
$ echo 1 > /proc/sys/net/ipv4/ip_forward
$ echo 1 > /proc/sys/net/ipv4/conf/ens3/proxy_arp
# Add ip to arp to complete the loop.
$ arp -s 137.74.9.193 fa:16:3e:76:31:ea -i ens3 pub
Result Kernel IP routing table:
Destination Gateway Genmask Flags Metric Ref Use Iface
default 213.32.64.1 0.0.0.0 UG 0 0 0 ens3
10.0.0.2 * 255.255.255.255 UH 0 0 0 tun1
ip193.ip-137-74 10.0.0.2 255.255.255.255 UGH 0 0 0 tun1
213.32.64.1 * 255.255.255.255 UH 0 0 0 ens3
Configuration on Server B:
nano /etc/network/interfaces
auto eth0
iface eth0 inet static
address 139.59.131.76
netmask 255.255.240.0
gateway 139.59.128.1
iface eth0:0 inet static
address 137.74.9.193
netmask 255.255.255.255
broadcast 137.74.9.193
auto tun1
iface tun1 inet static
address 10.0.0.2
netmask 255.255.255.252
pre-up iptunnel add tun1 mode gre local 139.59.131.76 remote 213.32.69.16 ttl 255
up ifconfig tun1 multicast
up ifconfig tun1 arp
up ifconfig tun1 broadcast
pointopoint 10.0.0.1
post-down iptunnel del tun1
Commands executed:
# enable ip forward
$ echo 1 > /proc/sys/net/ipv4/ip_forward
# Route to tun1
ip route add 10.0.0.1 dev tun1
Kernel IP routing table:
Destination Gateway Genmask Flags Metric Ref Use Iface
default gateway 0.0.0.0 UG 0 0 0 eth0
10.0.0.1 * 255.255.255.255 UH 0 0 0 tun1
10.19.0.0 * 255.255.0.0 U 0 0 0 eth0
139.59.128.0 * 255.255.240.0 U 0 0 0 eth0
Thanks for any help :)
UPDATE (14.11.2016): Add route commands on Server B