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
  • If the Windows machine isn't networked then you have no use for a gw address since the Win machine can't forward data.

    So what do you want to do on that local link?

    Note that IPv6 supports link-local IP numbers. But what is practical so much depends on what your device is expected to do. Or what the Win machine is expected to do with it. You might also have seen how MS (and then others) started to take random 169.x.x.x addresses if no DHCP IP gets assigned.

    The PC can communicate with your device without any IP assigned - the actual transfers aren't based on IP numbers but on hw (MAC) addresses. The IP is just there for routing and to look up the hw address of a device.

Reply
  • If the Windows machine isn't networked then you have no use for a gw address since the Win machine can't forward data.

    So what do you want to do on that local link?

    Note that IPv6 supports link-local IP numbers. But what is practical so much depends on what your device is expected to do. Or what the Win machine is expected to do with it. You might also have seen how MS (and then others) started to take random 169.x.x.x addresses if no DHCP IP gets assigned.

    The PC can communicate with your device without any IP assigned - the actual transfers aren't based on IP numbers but on hw (MAC) addresses. The IP is just there for routing and to look up the hw address of a device.

Children