Y
Y
Yabrik2021-02-03 19:54:47
System administration
Yabrik, 2021-02-03 19:54:47

How to set up a VPN server as a router?

Good day

I have a rented VDS server to which you can connect via VPN. I want that at connection to it of several clients (directly) the server fulfilled a role of a "full-fledged" router. I saw several instructions for setting up a raspberry as a router, do you need to do approximately the same steps? And if not, then throw (well, or write detailed instructions here, I will be very grateful) please link to some guide.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
T
Talyan, 2021-02-03
@flapflapjack

Duck is easily googled on the request "Distribute Internet Linux".
https://help.ubuntu.ru/wiki/sharing_internet_small
Read, do the same, only specify your interfaces and subnets, and do a masquerade.
The external interface will be the one that looks at the server in the tyrnet.
Local - the one that raises the VPN.
If there are several interfaces like "ppp0, ppp1, ppp2", as far as I remember, you can specify "ppp +" in iptables
And that's all

A
Alexey Dmitriev, 2021-02-04
@SignFinder

1. Enable the issue on the VPN server when the default gateway is connected to the VPN connection.
In this case, all packets from the client will go to the VPN connection.
2. Enable forward packets through the kernel.
3. Set up NAT (SNAT or MASQUERADE) if we are talking about Linux.

V
ValdikSS, 2021-02-09
@ValdikSS

Set up a VPN server and enable routing ( sysctl net.ipv4.ip_forward=1). In some distributions, routing may also be disabled by default in the firewall (iptables), you need to enable it (see the documentation for the distribution/configuration tool).
Nothing additional needs to be done.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question