I did like this:
Code: Select all
Tins::IP pkt = Tins::IP("10.139.1.1") /
Tins::TCP(80) /
Tins::RawPDU("I'm a payload!");
pkt.src_addr("0.0.0.0");
I then inspected the packet sent by a conventional OpenVPN client through tun (I inserted a little code in OpenVPN to get exactly what it was reading from tun) and I noted that the source address being used was 192.168.255.18. When I put this as the source address in the libtins packet above, it works!
So, what does the source packet has to do with all of this? Is it OpenVPN server or tun server that is refusing the packet with source 0.0.0.0?