This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Using static address with DHCP server

Hi,

Keil Ethernet stack

I have trouble using static address when If I cannot find DHCP Server.
I enable Dynamic Host Configuration in Net_Config_ETH_0.h
I also specified my static ip address==192.168.0.100 and static Default Gateway =192.168.0.1.
Primary DNS Gateway =192.168.0.1.

I am connecting directly my Embedded device ethernet to PC.
My PC has static IP address = 192.168.0.1

If I disable Dynamic Host Configuration in Net_Config_ETH_0.h then it all works.

I thought If it cannot find DHCP server it will fallback back to using static DNS server which is my PC.

Kindly suggest what is wrong with my configuration. Does Keil Ethernet stack supports fallback?

Thanks,
Naeem

Parents
  • Should any networked device configured with DHCP support fallback to a fixed IP?

    If someone has pre-allocated you an IP number, then you don't need DHCP, even if it is possible to let the DHCP server match MAC address and deliver this pre-allocated IP together with gateway, name servers, ...

    If someone hasn't allocated you an IP number, then you aren't allowed to take one and use.

    It's normally assumed that if the DHCP server can't supply an IP number, then the network is normally in so bad state that you haven't any use for any IP in the first place. The only exception is if the network works well but the DHCP server has run out of IP - but in that case full is full. So no device should force itself onto the network by taking a hard-coded IP.

Reply
  • Should any networked device configured with DHCP support fallback to a fixed IP?

    If someone has pre-allocated you an IP number, then you don't need DHCP, even if it is possible to let the DHCP server match MAC address and deliver this pre-allocated IP together with gateway, name servers, ...

    If someone hasn't allocated you an IP number, then you aren't allowed to take one and use.

    It's normally assumed that if the DHCP server can't supply an IP number, then the network is normally in so bad state that you haven't any use for any IP in the first place. The only exception is if the network works well but the DHCP server has run out of IP - but in that case full is full. So no device should force itself onto the network by taking a hard-coded IP.

Children