Answer the question
In order to leave comments, you need to log in
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
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 questionAsk a Question
731 491 924 answers to any question