lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lwip-users] Multiple IP addresses


From: Jim Gibbons
Subject: Re: [lwip-users] Multiple IP addresses
Date: Thu, 10 Jun 2004 10:25:57 -0700
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.6) Gecko/20040113

I would like to suggest one concern about this.  It grows out of the way we actually manage our own servers in the event of a power failure.  We don't have any UPS gear in our offices, so when the power fails, our servers go down instantly.  This is a rare occurrence, but when it happens, we always go back to the servers and turn off the power to them.  We do this because we are concerned about an uneven return of A/C power.  When power comes back, we wait a minute or so, then turn on our servers.  We do the same thing for our personal workstations.

We don't do anything like this for smaller network appliances in the office.  We just let them come up with the power.  Who can keep track of them these days?

lwIP is great for small network appliances, so in this scenario, it would be coming up well before the server(s).  DHCP would fail at first, but that wouldn't mean that we would want to revert to a fixed address.  We would want it to pick up the address from the server.

This issue came up for us a few months ago.  I couldn't find anything in the DHCP specification about it.  The implication that I got was that DHCP should be persistent.

Do you see this as a problem for the fallback strategies?


Leon Woestenberg wrote:
Hello Paul,

Paul wrote:
I have been asked to implement a dhcp assigned ip address such that if there is
no dhcp server present the interface will default to a 10.0.0.x ip address.  I figure I could start the dhcp code and some time later check if the
interface has an ip address or

Two things:
1) I would like to add this to lwIP, but I will do it the neat way
which will involve a netif NETIF_UP and DOWN flag.

2) If you want something that works now, the easiest thing to do is modify this piece of code in dhcp.c:

---
static void dhcp_timeout(struct netif *netif)
{
  /* back-off period has passed, or server selection timed out */
  if ((dhcp->state == DHCP_BACKING_OFF) ||
      (dhcp->state == DHCP_SELECTING)) {
    dhcp_discover(netif);
  /* receiving the requested lease timed out */
  } else if (dhcp->state == DHCP_REQUESTING) {
---

into this:

---
static void dhcp_timeout(struct netif *netif)
{
  if ((dhcp->state == DHCP_BACKING_OFF)
  {
    /* stop trying DHCP */
    dhcp_stop(netif);
    /* fallback */
    ipconfig_fallback(netif);
  } else if (dhcp->state == DHCP_SELECTING) {
    if (dhcp->tries <= 2) {
      dhcp_discover(netif);
    } else {
      /* stop trying DHCP */
      dhcp_stop(netif);
      /* fallback */
      ipconfig_fallback(netif);
    }
  }

In ipconfig_fallback() configure the network interface as you like.

I am wondering if it is possible to have an interface configured for DHCP
and have a second ip address assigned to the same interface?

Not at the moment. What I would like to see implemented is this:

1) Mark the interface down.
2) *Optionally* provide an address to the interface using netif_addr()
3) If (2) did not provide an address, start ARP quering for available addresses in the address space allocated for that (like Windows does when it does not find a DHCP server). (Must lookup defacto spec...).
3) In parallel, (!) query for a DHCP server.
4) If 3 fails, fallback to 3 (or to 2 if an address was specified).

If you want to work in either area, I am interested in reviewing the
code for inclusion in the CVS source tree, but only if it is not
hackery. :-)

Regards,

Leon.

Or, if the

or is there a better way ?

Thanks
Paul


_______________________________________________
lwip-users mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/lwip-users



_______________________________________________
lwip-users mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/lwip-users

--
E-mail signature
Jim Gibbons
address@hidden
Gibbons and Associates, Inc.
TEL: (408) 984-1441
900 Lafayette, Suite 704, Santa Clara, CA
FAX: (408) 247-6395



reply via email to

[Prev in Thread] Current Thread [Next in Thread]