I've set up a VPN tunnel, and encountered an interesting issue.
With fixed routes set up (say, to 8.8.8.8
), everything is fine. Packets get sent over that interface, and responses are received. The same when a default gateway is set up.
The problem occurs when there is no route set up, but an application is bound to that interface. If I try to use ping -I tun0 8.8.8.8
, tcpdump shows no packets actually being sent over the tunnel at all.
More importantly, when I use curl --interface tun0 google.com
, tcpdump appears to show that a SYN is sent, and a SYN-ACK is received... but then appears to be dropped. The connection eventually times out.
My goal is to have traffic from applications bound to that interface routed exclusively over that interface, and all other traffic out the default gateway. I can't set the default gateway to the VPN.
Is there something simple that I'm missing?