Send Traffic destined to local network interfaces from TUN via syscall IPPROTO_RAW
Hope all is well, I am developing a client server VPN solution using Golang.
The client once it runs, it:
1- Set up a TUN interface
2- Set up the default route through the TUN created (so all outgoing traffic can be intercepted)
3- Set up a route to the public VPN IP address through the old existing default route gateway,
An SSL session is established with the VPN Server and the IP packets received by tun are encrypted and sent over the SSL session.
Actually, I received successfully the decrypted traffic from the server (IP Packets responses).
what am trying to do is to write those packets via a syscall IPPROTO_RAW through the TUN so they
can be intercepted by their corresponding interfaces but this is not working despite that writing
the packets via the syscall is not failing.
Kindly find attached below