I
I
ImPaha2021-02-13 19:56:09
VPN
ImPaha, 2021-02-13 19:56:09

How to redirect traffic or set up routing through code?

The task is to implement your own VPN service. And during the development, I went into a stupor, since it is necessary to implement the main function of vpn, namely “connection from another ip”. So far I've come to this. Do I need to configure traffic redirection or code routing? But how? The python language, in extreme cases C.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
W
Wataru, 2021-02-13
@wataru

You need to make a virtual ethernet device. The packets that come to it must be wrapped in some kind of your protocol, encrypted and sent further to the server. The server, on the other hand, unpacks the received packets and sends it to the external interface, replacing the sender's IP address and port with its own. The server wraps the packets that come to this address / port, replaces the address with the port there and sends it back to the client. The client unpacks and issues to the system through a virtual device.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question