I am using the libnet library to generate custom packets over a vpn network, but because i have libnet working at the lower levels of the OSI model the packets are bypassing whatever method openvpn uses to force all traffic through to the vpn server.

I tried adding 'push "redirect-gateway def1" ' to the server.conf file but it didnt work.

I would like to try to modify openvpn so that I can give it my custom made packets to send over the vpn, and I was wondering if anyone could tell me where in the source code openvpn either constructs or captures the original packet before it encapsulates it?