[ how to do dial on demand when IP addresses are unknown ]
Quote:>It's impossible. Demand-dialing requires a fixed IP address to be
>assigned for the remote end. If you think about how routing works,
>you will know why it must be this way. (You're running into a
>chicken-and-egg problem otherwise.)
Actually I believe this is an implementation issue. If the 'default'
entry in your routing table must point to a specific IP address, then
you have the above problem.
But what if you add a static 'default' route pointing to the point-to-point
device? If your kernel is appropriately coded, such a default route does not
need a gateway IP address. It simply means 'packets destined for unknown IP
addresses should be sent this way'. There is only one device at the other end
of the point-to-point link, so we don't care what its IP address is.
Once you implement this, automatic dial-out becomes easy. Just begin dialing
if (a) the point-to-point link is not up and (b) we receive a packet that
needs to go out tht way.
Here, for example, is part of an actual routing table from an Onramp router:
Dest Len Interface Gateway Metric P Timer Hits Use
204.095.070.183 32 en0 204.095.064.002 2 239 2085 1465
default 0 syn0 1 0 23490132 22454384
Notice that one route (pointing towards the Ethernet port) specifies a
gateway -- because on a LAN one needs a MAC address to send the packet to, and
we get this by first knowing the IP address of the gateway. However, the
default route points to the syn0 device, which is connected to a point-to-point
link. No gateway IP address is needed, because we have no coice: there can
only be one device at the other end of the point-to-point link.
A LAN is like a highway with many exits. You need to know which one to take.
A point-to-point link is like a well down which you jump. You have not much
choice, once you have jumped, about where to go...