05-20-2010 07:25 AM - edited 03-06-2019 11:11 AM
hi guys,
I am just trying to get a conceptual understanding here. At my workplace, there is a network cable on my desk. When I get to work, I connect this network cable to my laptop. My laptop now has an IP address. I am trying to figure out how it got this IP address? Is it the network cable that has an IP address? Is it some setting on my laptop that decides that when it is connected to a LAN, what IP address it should get? I mean, I know in linux we can do ifconfig eth0,
but that confuses me, because what if we choose an IP address that is reserved? Or choose an IP address that belongs to someone else?
thanks.
Solved! Go to Solution.
05-20-2010 07:50 AM
NetworkNewbie17 wrote:
hi guys,
I am just trying to get a conceptual understanding here. At my workplace, there is a network cable on my desk. When I get to work, I connect this network cable to my laptop. My laptop now has an IP address. I am trying to figure out how it got this IP address? Is it the network cable that has an IP address? Is it some setting on my laptop that decides that when it is connected to a LAN, what IP address it should get? I mean, I know in linux we can do
ifconfig eth0,
but that confuses me, because what if we choose an IP address that is reserved? Or choose an IP address that belongs to someone else?thanks.
Your laptop is probably set for DHCP where it asks for an IP address. This request is sent via the network to a DHCP server , usually Windows but it can be Unix or a Cisco router, and this DHCP server allocates you an address for your subnet that is not currently in use.
Jon
05-20-2010 07:51 AM
If your laptop is setup for DHCP which it probably is here is the sequence of events to get you IP address.
When you connect your ethernet cable and turn on the laptop the laptop sees it is setup to use DHCP and needs an IP Address so here is what happens
Laptop sends out a broadcast DHCP discover message with its MAC Address
When the DHCP server sees the discover message it sends out a DHCP offer to the laptop with an IP Address, Subnet Mask, Default Gateway, and any other things defined in the IP Address range being used, and it also sends it own IP Address.
Next the laptop receives the offer and then makes a formal DHCP request for the offered IP address and sends it to the IP address of the DHCP server that made the offer.
Next the DHCP server sends a DHCP Acknowledgement and give the Laptop approval to use that IP address.
Hope this helps.
Mike
05-20-2010 07:50 AM
NetworkNewbie17 wrote:
hi guys,
I am just trying to get a conceptual understanding here. At my workplace, there is a network cable on my desk. When I get to work, I connect this network cable to my laptop. My laptop now has an IP address. I am trying to figure out how it got this IP address? Is it the network cable that has an IP address? Is it some setting on my laptop that decides that when it is connected to a LAN, what IP address it should get? I mean, I know in linux we can do
ifconfig eth0,
but that confuses me, because what if we choose an IP address that is reserved? Or choose an IP address that belongs to someone else?thanks.
Your laptop is probably set for DHCP where it asks for an IP address. This request is sent via the network to a DHCP server , usually Windows but it can be Unix or a Cisco router, and this DHCP server allocates you an address for your subnet that is not currently in use.
Jon
05-20-2010 07:51 AM
If your laptop is setup for DHCP which it probably is here is the sequence of events to get you IP address.
When you connect your ethernet cable and turn on the laptop the laptop sees it is setup to use DHCP and needs an IP Address so here is what happens
Laptop sends out a broadcast DHCP discover message with its MAC Address
When the DHCP server sees the discover message it sends out a DHCP offer to the laptop with an IP Address, Subnet Mask, Default Gateway, and any other things defined in the IP Address range being used, and it also sends it own IP Address.
Next the laptop receives the offer and then makes a formal DHCP request for the offered IP address and sends it to the IP address of the DHCP server that made the offer.
Next the DHCP server sends a DHCP Acknowledgement and give the Laptop approval to use that IP address.
Hope this helps.
Mike
05-20-2010 08:46 AM
Many thanks for the replies. They were very helpful.
05-20-2010 08:58 AM
Thanks for the ratings and glad we were able to help.
Mike
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide