P
P
Pavel Kaptur2017-10-17 18:02:56
openvpn
Pavel Kaptur, 2017-10-17 18:02:56

How to configure routing for vpn?

Good day to all, for tests, they asked me to configure vpn on a machine that is a network gateway, it has two network adapters eth0 - an internal network and eth1 - an external network, I installed openvpn and downloaded the config from one of the free servers (I checked it, it definitely works) . I connect, everything seems to work on the gateway machine, but the entire internal network loses contact with the world. After analyzing the picture, as I understand it, the problem is that I do not have a route to the tunnel. Is my hypothesis correct? Is it possible to do something so that gw is selected automatically or do I need to manually register the route outside? the problem is that each time the network address assigned to the adapter changes. In general, how do people with straight arms do it, so that there would be a minimum of a headache?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
s1dney, 2017-10-17
@drem1lin

Allow forward traffic from clients through the new tun interface and another masquerading (NAT) rule to the new address/interface.

A
angel_on, 2017-10-18
@angel_on

There are several options.
1) For me, the least without a headache and more correct is to install a router with a vpn client. (for example Mikrotik) raise your config on it. On it to configure routing through the tunnel. (very very very simple) All client hosts connect to this router.
2) Set up static routes on your gateway host. On the command line route /help. I will give a complete instruction on how to configure static routes with interface binding.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question