How OpenVPN3 and/or /dev/net/tun routes packets?

I’m writing an OpenVPN client that does not use tun device. I send the packets directly through the library. For testing, I’m using libtins to craft the IP packets by hand. I did like this: 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”); If I send this through the OpenVPN every second,…

Is it possible to route all communication to one port, to another network interface?

Short: I wonder if it’s possible to route (with iptables), so all communication that are directed to/from 192.168.1.10 (eth0) port 40000 are sent to tun0? (VPN) Longer: When I’m connecting to my VPN server, all data is routed thru the tun0 network, except this app, that totally refuses to understand (bad programming). This causes the…