PPP and DHCP - PPP

This is a discussion on PPP and DHCP - PPP ; In http://tinyurl.com/gr8l2 , I reported a problem that arose out of leaving the local address empty in my PPPD options. I did this for flexability so that I didn't have to update the options if the host's IP address changed ...

+ Reply to Thread
Results 1 to 5 of 5

Thread: PPP and DHCP

  1. PPP and DHCP

    In http://tinyurl.com/gr8l2, I reported a problem that arose out of
    leaving the local address empty in my PPPD options. I did this for
    flexability so that I didn't have to update the options if the host's
    IP address changed for some reason.

    I'm building an embedded system where the user has to use a
    configuration tool I provide to change the IP address so it's fairly
    easy for me to put a new IP address into my PPP configuration, too
    (though I was trying to avoid that). However, if the user enables DHCP
    (so that the host gets a dynamic IP address), it's a little tricker to
    get the IP address into the PPPD configuration. I suppose I could
    modify my dhcpcd.exe script to update PPP options but that's the kind
    of maintenance headache I was hoping to avoid by leaving the local IP
    out of my PPPD options.

    Granted that it might be a little unusual for a PPPD _server_ to have a
    dynamic IP address (gotten via DHCP), it seems possible and is a case I
    feel I need to cover. Any recommendations on making this work with a
    minimum of interdependencies?

    Thanks.

    Chris


  2. Re: PPP and DHCP

    "Chris Nelson" writes:
    > Granted that it might be a little unusual for a PPPD _server_ to have a
    > dynamic IP address (gotten via DHCP), it seems possible and is a case I
    > feel I need to cover. Any recommendations on making this work with a
    > minimum of interdependencies?


    It should "just work" with DHCP. As long as the DHCP server supplies
    the system with a host name (most, though perhaps not all, do), the
    system should correctly set up its local `uname -n' and name services
    to resolve that name as the DHCP-supplied IP address for the system.
    Pppd will then pick that up as the local address to use.

    There probably ought to be a better way for pppd to do this, rather
    than a slightly hackish (though common) gethostbyname(gethostname) set
    of calls, but there isn't today. Fortunately, since you have the
    source ...

    --
    James Carlson, KISS Network
    Sun Microsystems / 1 Network Drive 71.232W Vox +1 781 442 2084
    MS UBUR02-212 / Burlington MA 01803-2757 42.496N Fax +1 781 442 1677

  3. Re: PPP and DHCP

    James Carlson wrote:
    > "Chris Nelson" writes:
    > > Granted that it might be a little unusual for a PPPD _server_ to have a
    > > dynamic IP address (gotten via DHCP), it seems possible and is a case I
    > > feel I need to cover. Any recommendations on making this work with a
    > > minimum of interdependencies?

    >
    > It should "just work" with DHCP. As long as the DHCP server supplies
    > the system with a host name (most, though perhaps not all, do), the
    > system should correctly set up its local `uname -n' and name services
    > to resolve that name as the DHCP-supplied IP address for the system.
    > Pppd will then pick that up as the local address to use.
    > ...


    When you say, it should "just work", I assume you mean if I leave the
    local IP address out of my PPPD options and out of my /etc/hosts file?
    Then that just moves my maintenace problem from options. to
    /etc/hosts.

    Maybe this isn't a ppp question any more but does my configuration tool
    really have to rewrite /etc/hosts to include the local host if I have a
    static IP and not include it if I'm using DHCP? That seems crazy.
    Until last week when pppd lost its mind I'd never had the local system
    in my hosts file and it worked fine. It even worked *sometimes* with
    pppd.


  4. Re: PPP and DHCP

    "Chris Nelson" writes:

    >In http://tinyurl.com/gr8l2, I reported a problem that arose out of
    >leaving the local address empty in my PPPD options. I did this for
    >flexability so that I didn't have to update the options if the host's
    >IP address changed for some reason.


    That IP address is for communication between the two systems. What it is on
    the ppp link has nothing in principle to do with the IP address of the host
    on any other interface. Only if you want to do things like proxyarp does it
    matter.


    >I'm building an embedded system where the user has to use a
    >configuration tool I provide to change the IP address so it's fairly
    >easy for me to put a new IP address into my PPP configuration, too
    >(though I was trying to avoid that). However, if the user enables DHCP
    >(so that the host gets a dynamic IP address), it's a little tricker to
    >get the IP address into the PPPD configuration. I suppose I could
    >modify my dhcpcd.exe script to update PPP options but that's the kind
    >of maintenance headache I was hoping to avoid by leaving the local IP
    >out of my PPPD options.


    It does not matter. Just use 10.1.1.1 and 10.1.1.2

    >Granted that it might be a little unusual for a PPPD _server_ to have a
    >dynamic IP address (gotten via DHCP), it seems possible and is a case I
    >feel I need to cover. Any recommendations on making this work with a
    >minimum of interdependencies?



  5. Re: PPP and DHCP

    "Chris Nelson" writes:

    > James Carlson wrote:
    > > "Chris Nelson" writes:
    > > > Granted that it might be a little unusual for a PPPD _server_ to have a
    > > > dynamic IP address (gotten via DHCP), it seems possible and is a case I
    > > > feel I need to cover. Any recommendations on making this work with a
    > > > minimum of interdependencies?

    > >
    > > It should "just work" with DHCP. As long as the DHCP server supplies
    > > the system with a host name (most, though perhaps not all, do), the
    > > system should correctly set up its local `uname -n' and name services
    > > to resolve that name as the DHCP-supplied IP address for the system.
    > > Pppd will then pick that up as the local address to use.
    > > ...

    >
    > When you say, it should "just work", I assume you mean if I leave the
    > local IP address out of my PPPD options and out of my /etc/hosts file?


    Right.

    > Then that just moves my maintenace problem from options. to
    > /etc/hosts.


    Right. And if your DHCP client is competent and if your DHCP server
    provides you with a usable host name, this should work fine.

    > Maybe this isn't a ppp question any more but does my configuration tool
    > really have to rewrite /etc/hosts to include the local host if I have a
    > static IP and not include it if I'm using DHCP? That seems crazy.


    Your tool should not have to do anything. I agree that rewriting
    /etc/hosts is crazy.

    > Until last week when pppd lost its mind I'd never had the local system
    > in my hosts file and it worked fine. It even worked *sometimes* with
    > pppd.


    The other option is to hard-code the local IP address in pppd's
    configuration files, and just be done with it. It doesn't have to
    match the IP address used on some other interface.

    But, then, I'm not in charge of your IP address allocation strategy,
    so I'm not sure what solutions are workable for you.

    --
    James Carlson, KISS Network
    Sun Microsystems / 1 Network Drive 71.232W Vox +1 781 442 2084
    MS UBUR02-212 / Burlington MA 01803-2757 42.496N Fax +1 781 442 1677

+ Reply to Thread