Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 9 Apr 1996 17:17:10 -0700 (PDT)
From:      Archie Cobbs <archie@tribe.com>
To:        archie@tribe.com (Archie Cobbs)
Cc:        freebsd-hackers@FreeBSD.org
Subject:   Re: Routing questions
Message-ID:  <199604100017.RAA15187@bubba.tribe.com>
In-Reply-To: <199604082015.NAA06876@bubba.tribe.com> from "Archie Cobbs" at Apr 8, 96 01:15:35 pm

next in thread | previous in thread | raw e-mail | index | archive | help

I wrote:

> Suppose I want to have a dial-on-demand PPP connection.
> OK so I setup the routes, run PPP, and PPP opens the interface
> and waits for a packet to be sent. The interface is initially
> numbered 10.1.1.1 -> 11.1.1.1. Result:
> 
> Destination      Gateway            Flags     Refs     Use     Netif Expire
> default          10.1.1.1           USc         0        0      tun0
> 10.1.1.1         127.0.0.1          UH          0        0       lo0
> 11.1.1.1         10.1.1.1           UH          1        0      tun0
> 
> Then a packet gets sent, so PPP opens dials the peer and negotiates
> the IP addresses. Oops, the server at the remote end wants us 
> to use 12.1.1.1 -> 13.1.1.1 instead of what I had before. I have
> no choice. So I take my interface down ("ifconfig tun0 down delete"),
> and then bring it back up again, this time with the new IP addresses
> assigned by the server: 12.1.1.1 -> 13.1.1.1.
> 
> Now a look at the routing table shows:
> 
> Destination      Gateway            Flags     Refs     Use     Netif Expire
> default          10.1.1.1           USc         0        0      tun0
> 10.1.1.1         127.0.0.1          UH          0        0       lo0
> 13.1.1.1         12.1.1.1           UH          0        0      tun0
> 
> First point: this looks like it shouldn't work, since now nowhere in the
> system is there an interface with the number 10.1.1.1.  But sending a
> packet to an anonymous IP address does cause it to get sent through
> the tun0 interface. Moreover, it is assigned the source address 10.1.1.1
> instead of 12.1.1.1 like it should. Oops.
> 
> Next point: since the route to 10.1.1.1 via 127.0.0.1 was automatically
> generated by the first ifconfig, shouldn't it too be automatically
> removed when the interface is taken down? It is no longer the number
> of any local interface, up or down. And hey! what happened to the
> analogous local route for 12.1.1.1?

I think there's a critical missing component here... the default
original route was added with the command:

  route add default -interface 10.1.1.1

This seemed the correct thing to do after reading the route(8) man page...
but it seems to be a partial cause of the above weirdness.

I second the idea of having a user level "route manager" do *all* of this
stuff having to do with routing changes when interfaces go up and down...
This would simplify the kernel and get some of the logic of it all
out into the light where people can see what really is going on...
You would just set whatever policy you wanted via some config file and
let it go.

-Archie

__________________________________________________________________________
Archie L. Cobbs, archie@tribe.com   *   Whistle Communications Corporation



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199604100017.RAA15187>