A
A
Andrey Kamynin2016-02-24 20:55:16
openvpn
Andrey Kamynin, 2016-02-24 20:55:16

[Solved] How to route through another gateway for win station?

e79f5530953d410ab4675bb0e2f3b4f2.jpg
All health!
Tell me, please, is it possible to route the route to the win station through another gateway? (Scheme in the attached file).
there are 3 gateways:
192.168.0.1 builds a route with subnet 192.168.2.0/24 it is set by default for 192.168.0.202 CA.
I would like to forward a route for 192.168.0.202 through the gateway 192.168.0.254 to 192.168.35.0/24. For CD to see stations 35.0/24 subnets and vice versa.
How can this be done?
For CD I tried to register a route:
route -p add 192.168.35.0/24 mask 255.255.255.0 192.168.0.254
but the route does not pass.
Pathping and tracert c 0.202 of the station writes that the call to 0.254 passes, but then it goes to the provider's IP ... it's probably logical to look at the gate somewhere, but where and what? won't you tell me?
Thank you!
UPD: I agree that the scheme is crazy, but such a crutch is forced.
UPD2: stations with gateways 0.254 - 35.254 see each other and respond.
On Windows I specify:

route -p add 192.168.11.0/24 mask 255.255.255.0 192.168.10.200

Table:
IPv4 таблица маршрута
===========================================================================
Активные маршруты:
Сетевой адрес           Маска сети      Адрес шлюза       Интерфейс  Метрика
          0.0.0.0          0.0.0.0      192.168.0.1    192.168.0.202    266
        127.0.0.0        255.0.0.0         On-link         127.0.0.1    306
        127.0.0.1  255.255.255.255         On-link         127.0.0.1    306
  127.255.255.255  255.255.255.255         On-link         127.0.0.1    306
      192.168.0.0    255.255.255.0         On-link     192.168.0.202    266
    192.168.0.202  255.255.255.255         On-link     192.168.0.202    266
    192.168.0.255  255.255.255.255         On-link     192.168.0.202    266
     192.168.35.0    255.255.255.0    192.168.0.254    192.168.0.202     11
        224.0.0.0        240.0.0.0         On-link         127.0.0.1    306
        224.0.0.0        240.0.0.0         On-link     192.168.0.202    266
  255.255.255.255  255.255.255.255         On-link         127.0.0.1    306
  255.255.255.255  255.255.255.255         On-link     192.168.0.202    266
===========================================================================
Постоянные маршруты:
  Сетевой адрес            Маска    Адрес шлюза      Метрика
     192.168.35.0    255.255.255.0    192.168.0.254       1
          0.0.0.0          0.0.0.0      192.168.0.1  По умолчанию 
   192.168.35.254    255.255.255.0    192.168.0.254       1
===========================================================================

I will add:
ac675b303f664323832ee4f095a05fd3.jpg
Now it turned out that if at stations from the 0.0 subnet with a gateway 0.1 register a route to 35.254 through 0.254 - the ping passes from the station to the 35th subnet. BUT the ping on these stations from 35.254 does not transit.
traceroute shows that the packet is stuck on 10.10.1.1, i.e. the packet gets into the tunnel, but is lost at the 0.254 gateway. 0.254 the gateway perfectly sees station 0.202.
How to tell the gateway to send packets destined for 0.202 from 10.10.1.1 to 0.202 station? =(
If 0.202 is set as default gateway 0.254, then 35.0/24 subnet starts seeing 0.202.
traceroute to 192.168.0.202 (192.168.0.202), 30 hops max, 60 byte packets
 1  10.10.1.1 (10.10.1.1)  43.955 ms  43.955 ms  43.964 ms
 2  * * *
 3  * * *
 4  * * *
 5  * * *
 6  *^C

routes 35.254
Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
0.0.0.0         95.129.235.141  0.0.0.0         UG        0 0          0 eth0
10.10.1.0       10.10.1.21      255.255.255.0   UG        0 0          0 tun0
10.10.1.21      0.0.0.0         255.255.255.255 UH        0 0          0 tun0
95.129.235.140  0.0.0.0         255.255.255.252 U         0 0          0 eth0
192.168.0.0     10.10.1.21      255.255.255.0   UG        0 0          0 tun0
192.168.0.202   10.10.1.20      255.255.255.255 UGH       0 0          0 tun0
192.168.0.202   192.168.35.254  255.255.255.255 UGH       0 0          0 eth1
192.168.35.0    0.0.0.0         255.255.255.0   U         0 0          0 eth1

routes 0.254
Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
0.0.0.0         213.108.201.225 0.0.0.0         UG        0 0          0 eth0
10.10.1.0       10.10.1.2       255.255.255.0   UG        0 0          0 tun0
10.10.1.2       0.0.0.0         255.255.255.255 UH        0 0          0 tun0
192.168.0.0     0.0.0.0         255.255.255.0   U         0 0          0 eth1
192.168.35.0    10.10.1.2       255.255.255.0   UG        0 0          0 tun0
213.108.201.224 0.0.0.0         255.255.255.248 U         0 0          0 eth0

UPD: Thank you all for your advice and recommendations. The issue was resolved by adding a route to 10.10.1.0/24 through 192.168.0.254 and revising the iptables rules.

Answer the question

In order to leave comments, you need to log in

4 answer(s)
A
alegzz, 2016-02-24
@alegzz

Routing and forwarding to. 192.168.0.254. And 192.168.35.254 are configured?

I
Igor, 2016-02-24
@unitby

Does 35.254 know the route to 192.168.0.0/24 ?
whether that is responds for example from 35.254 0.254?
well, I would like to look at the openvpn config and indicate which of this is the openvpn server and which is the client

R
res2001, 2016-02-24
@res2001

The route on Windows is registered normally, then you need to figure out why 192.168.0.254 does not send packets to the network 192.168.35.0/24.
Watch routes on this gateway. Does it itself have access to the 192.168.35.0/24 subnet? As far as I understand, this is an internal subnet, and VPN works via the Internet? Perhaps OpenVPN is configured incorrectly. Maybe 192.168.0.254 is not configured to route from one network to another. Maybe there is no route to the 192.168.0/24 subnet on 192.168.35.254, or routing is not enabled.

S
skisselev, 2016-02-24
@skisselev

routing business two-way. From both ends, you need to look and set up a route to each other.
on point 192.168.0.1 we also write route add 192.168.35.0/24 gw 192.168.0.254. "route -p add 192.168.35.0/24 mask 255.255.255.0 192.168.0.254 - remove. Should be route -p add 192.168.35.0/24 mask 255.255.255.0 192.168.0.1".

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question