Skip to contentSkip to conversation

How to force all packet go through tun0 ?

DISCUSSION J. Bakshi 2 participants 2 messages Dec 5, 2012

lore
Share & tools
lore

J. Bakshi

author
#0 lore raw

Hello,

I have reconnect script which reconnect the vpn connection if tun0 is missing. Still during the reconnect phase, the packets go through the eth0. How can I force all packets to go through tun0 and how can I exclude the domain required for vpn connection to be established ?

Thanks

#1 lore raw
Quoted 7 lines · J. Bakshi

Hello,

I have reconnect script which reconnect the vpn connection if tun0 is missing. Still during the reconnect phase, the packets go through the eth0. How can I force all packets to go through tun0 and how can I exclude the domain required for vpn connection to be established ?

Just like VPN solutions themselves do when they establish a tunnel with a default route:

ip route add 134.76.22.1/32 dev eth0
ip route replace default via tun0