I have two private networks (A, B) that connects via another company's private network (C). Network A has internet access. I want to make a tunnel between B and A that goes through C. Then network B will use A as default route for internet access.
Network A: 10.20.0.0/24, on C: 10.10.15.3
Network B: 10.20.1.0/24, on C: 192.168.25.3
10.10.15.3 can access 192.168.25.3 and vice versa
Network A tunnel script:
ip tunnel add tunnel0 mode gre local 10.10.15.3 remote 192.168.25.3 ttl 64
ip link set tunnel0 up
ip addr add 10.20.200.1/30 peer 10.20.200.2/30 dev tunnel0
ip route add 10.20.1.0/24 via 10.20.200.2
Network B tunnel:
ip tunnel add tunnel0 mode gre local 192.168.25.3 remote 10.10.15.3 ttl 64
ip link set tunnel0 up
ip addr add 10.20.200.2/30 peer 10.20.200.1/30 dev tunnel0
ip route add 10.20.0.0/24 via 10.20.200.1
ip r d default && ip r a default via 10.20.200.1
From GW on network B:
traceroute to 10.20.0.1 (10.20.0.1), 30 hops max, 38 byte packets
1 10.20.0.1 (10.20.0.1) 4.685 ms 4.505 ms 4.478 mstraceroute to 10.20.0.14 (10.20.0.14), 30 hops max, 38 byte packets
1 10.20.200.1 (10.20.200.1) 4.643 ms 4.387 ms 4.555 ms
2 10.20.200.1 (10.20.200.1) 4.423 ms 4.473 ms 4.437 mstraceroute to 8.8.8.8 (8.8.8.8), 30 hops max, 38 byte packets
1 10.20.200.1 (10.20.200.1) 4.595 ms 4.461 ms 4.628 ms
2 10.20.200.1 (10.20.200.1) 4.476 ms 4.521 ms 4.536 ms
something's not right.... but why?
lol
I forgot to accept FORWARD by default on 10.10.15.3 :(