Hello,
I have a current setup of 2 star networks with each one having an openvpn server and some children
openvpn server is set with ansible and
https://github.com/Stouts/Stouts.openvpn
there is a client-to-client option, so each children can communicate between each other for one star network
server1 has 10.1.0.0/24 network and is 10.1.0.1
server2 has 10.2.0.0/24 and is 10.2.0.2
I added a route push inside clients from server like 'push "route 10.1.0.0 255.255.255.0"'
platform is ubuntu trusty w openvpn 2.3.2 (default repository)
I'm trying to link the two and second server is set as children of first openvpn server.
Pinging each other with IP address space of server1 is OK
Pinging with IP address space of server2 NOK. route missing in server1
server1# route add -net 10.2.0.0/24 gw 10.1.0.14
SIOCADDRT: Network is unreachable
server1# route add -net 10.2.0.0/24 dev tun0
server1# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 x.y.z.1 0.0.0.0 UG 0 0 0 eth0
10.1.0.0 10.1.0.2 255.255.255.0 UG 0 0 0 tun0
10.1.0.2 0.0.0.0 255.255.255.255 UH 0 0 0 tun0
10.2.0.0 0.0.0.0 255.255.255.0 U 0 0 0 tun0
x.y.z.1 0.0.0.0 255.255.255.255 UH 0 0 0 eth0
server1# ping 10.2.0.1
PING 10.2.0.1 (10.2.0.1) 56(84) bytes of data.
^C
--- 10.2.0.1 ping statistics ---
14 packets transmitted, 0 received, 100% packet loss, time 13096ms
server2# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 n.m.l.1 0.0.0.0 UG 0 0 0 eth0
10.1.0.0 10.1.0.13 255.255.255.0 UG 0 0 0 tun1
10.1.0.13 0.0.0.0 255.255.255.255 UH 0 0 0 tun1
10.2.0.0 10.2.0.2 255.255.255.0 UG 0 0 0 tun0
10.2.0.2 0.0.0.0 255.255.255.255 UH 0 0 0 tun0
n.m.l.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
server2# tcpdump -nl -i tun1 icmp
[see nothing...]
If I try to specify server2 IP inside vpn1
server1# ip route add 10.2.0.0/24 via 10.1.0.14
RTNETLINK answers: Network is unreachable
server1# ping 10.1.0.14
PING 10.1.0.14 (10.1.0.14) 56(84) bytes of data.
64 bytes from 10.1.0.14: icmp_seq=1 ttl=64 time=9.80 ms
server1# ip route add 10.2.0.0/24 via 10.1.0.2
server1# ping 10.2.0.1
PING 10.2.0.1 (10.2.0.1) 56(84) bytes of data.
^C
--- 10.2.0.1 ping statistics ---
4 packets transmitted, 0 received, 100% packet loss, time 2999ms
or from a client of server2
client$ ping 10.1.0.1
server2# tcpdump -nl -i tun1 icmp
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on tun1, link-type RAW (Raw IP), capture size 65535 bytes
23:46:33.080529 IP 10.2.0.6 > 10.1.0.1: ICMP echo request, id 5923, seq 1, length 64
23:46:34.087810 IP 10.2.0.6 > 10.1.0.1: ICMP echo request, id 5923, seq 2, length 64
[see this traffic on both tun* interface of server2]
server1# tcpdump -nl -i tun0 icmp
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on tun0, link-type RAW (Raw IP), capture size 65535 bytes
[get nothing]
Any hints to get those route working ?
Thanks