Subject: Re: routing over tun0 confusion
To: Ernst du Toit <ernstdt@ihug.co.nz>
From: Andrew Gillham <gillham@vaultron.com>
List: port-i386
Date: 12/21/2001 10:23:07
On Sat, Dec 22, 2001 at 12:41:12AM +1300, Ernst du Toit wrote:
> 
> My problem comes in the routing - if I set a static route to a host on the
> Net (my default being my ADSL router), I can see all traffic going over the
> tunnel. The moment I set my default route to the other side of the tunnel IP
> my CPU goes 100% and I get an error that the send buffer is full, this
> corresponds with massive collisions for tun0 in netstat -ni. Restore the
> default route to my ADSL router and the CPU usage returns to normal again.
> 
> This looks definately like routing since, while the tunnel is up, I can ping
> from a host on the Net to the IP on my side of the tunnel and my ICP replies
> goes out over my default route, as the routing rules dictates. Setting a
> static route and the replies goes back over the tunnel as expected.
> 
> What's the trick with the default route?
> What am I missing?

You need to setup a static route for the ISP VTUN server, pointing at your
ADSL router.  This way VTUN is always able to get to it.  Then, once the
tunnel is established, the default route can point to the other end of it.
Right now you are taking away the route that VTUN is using to get to the
VTUN server at your ISP, and pointing it over the tunnel that is relying
on the default route to get to the VTUN server.   Yes, it is recursive.

So if you home network is 192.168.1.0/24, the ISP VTUN server is sitting
on 192.168.2.1/24, and the tunnel is 192.168.3.0/24 you would do something
like this:
VTUN client:
	route add -net 192.168.2.0 192.168.1.1   <-- point at ADSL router.
	vtund client_config  <-- brings up tun0 192.168.3.x interface
	route add default 192.168.3.1   <-- default route to other end

-Andrew