My Internet access comes from my ethernet and I want to redirect it to a virtual adapter which is connected to a vpn server. I looked for answers and I'm now aware it has to do with the route rule but I'm not sure how to do it.

the result of " dhclient -v vpn_vpn "

Internet Systems Consortium DHCP Client 4.2.4
Copyright 2004-2012 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/

Listening on LPF/vpn_vpn/00:ac:d8:80:8d:85
Sending on   LPF/vpn_vpn/00:ac:d8:80:8d:85
Sending on   Socket/fallback
DHCPREQUEST of 192.168.30.11 on vpn_vpn to 255.255.255.255 port 67 (xid=0x903c9ca)
DHCPACK of 192.168.30.11 from 192.168.30.1
bound to 192.168.30.11 -- renewal in 3307 seconds.

and the result of "ip route show" (before doing dhclient -v vpn_vpn as I read it will mess the route table)

default via 192.168.0.1 dev eth0 
192.168.0.0/24 dev eth0  proto kernel  scope link  src 192.168.0.104  metric 1 

I tried to do the following:

ip route add 192.168.30.1 via 192.168.0.1
ip route del default via 192.168.0.1
ip route add default via 192.168.30.1

but it didn't work, actually I tried more than that but nothing happened. the idea is easy I understand it but I don't know why I can't Implement it.

sorry if it is a trivial question.

share|improve this question

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.