How does a home router acquire its IP address ?











up vote
1
down vote

favorite












When you first turn on your home router, how does it acquire a public IP address ? Is it a statically assigned IP address given to you by your ISP provider ? Or does the router act as a DHCP client in obtaining a dynamic address. If the router acts as a DHCP client, which server does it request to for an IP address ? And does it have to do a DHCP request every time you turn on the router ?










share|improve this question







New contributor




calveeen is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.




















  • Good questions. But very broad and mostly unanswerable in more than general terms. Whether static or dynamic depends on the service you purchase. But mainly your router plays little role in how things operate as it’s the ISP’s modem that bridges your network to the ISP’s network. So the service provider and type of service play a huge role in how your router needs to be configured.
    – Appleoddity
    yesterday










  • What is the purpose of your questions, be more specific?
    – Appleoddity
    yesterday










  • @grawity Well, comment converted to answer.
    – Akina
    yesterday










  • @Appleoddity I am currently taking a computer networking class. I am just curious to find out how routers are assigned IP addresses because it was not covered much in class. We learnt DHCP protocol when devices try to obtain dynamic IP addresses but not the case for routers.
    – calveeen
    yesterday

















up vote
1
down vote

favorite












When you first turn on your home router, how does it acquire a public IP address ? Is it a statically assigned IP address given to you by your ISP provider ? Or does the router act as a DHCP client in obtaining a dynamic address. If the router acts as a DHCP client, which server does it request to for an IP address ? And does it have to do a DHCP request every time you turn on the router ?










share|improve this question







New contributor




calveeen is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.




















  • Good questions. But very broad and mostly unanswerable in more than general terms. Whether static or dynamic depends on the service you purchase. But mainly your router plays little role in how things operate as it’s the ISP’s modem that bridges your network to the ISP’s network. So the service provider and type of service play a huge role in how your router needs to be configured.
    – Appleoddity
    yesterday










  • What is the purpose of your questions, be more specific?
    – Appleoddity
    yesterday










  • @grawity Well, comment converted to answer.
    – Akina
    yesterday










  • @Appleoddity I am currently taking a computer networking class. I am just curious to find out how routers are assigned IP addresses because it was not covered much in class. We learnt DHCP protocol when devices try to obtain dynamic IP addresses but not the case for routers.
    – calveeen
    yesterday















up vote
1
down vote

favorite









up vote
1
down vote

favorite











When you first turn on your home router, how does it acquire a public IP address ? Is it a statically assigned IP address given to you by your ISP provider ? Or does the router act as a DHCP client in obtaining a dynamic address. If the router acts as a DHCP client, which server does it request to for an IP address ? And does it have to do a DHCP request every time you turn on the router ?










share|improve this question







New contributor




calveeen is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











When you first turn on your home router, how does it acquire a public IP address ? Is it a statically assigned IP address given to you by your ISP provider ? Or does the router act as a DHCP client in obtaining a dynamic address. If the router acts as a DHCP client, which server does it request to for an IP address ? And does it have to do a DHCP request every time you turn on the router ?







networking router ip-address






share|improve this question







New contributor




calveeen is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











share|improve this question







New contributor




calveeen is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









share|improve this question




share|improve this question






New contributor




calveeen is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









asked yesterday









calveeen

113




113




New contributor




calveeen is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





New contributor





calveeen is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






calveeen is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.












  • Good questions. But very broad and mostly unanswerable in more than general terms. Whether static or dynamic depends on the service you purchase. But mainly your router plays little role in how things operate as it’s the ISP’s modem that bridges your network to the ISP’s network. So the service provider and type of service play a huge role in how your router needs to be configured.
    – Appleoddity
    yesterday










  • What is the purpose of your questions, be more specific?
    – Appleoddity
    yesterday










  • @grawity Well, comment converted to answer.
    – Akina
    yesterday










  • @Appleoddity I am currently taking a computer networking class. I am just curious to find out how routers are assigned IP addresses because it was not covered much in class. We learnt DHCP protocol when devices try to obtain dynamic IP addresses but not the case for routers.
    – calveeen
    yesterday




















  • Good questions. But very broad and mostly unanswerable in more than general terms. Whether static or dynamic depends on the service you purchase. But mainly your router plays little role in how things operate as it’s the ISP’s modem that bridges your network to the ISP’s network. So the service provider and type of service play a huge role in how your router needs to be configured.
    – Appleoddity
    yesterday










  • What is the purpose of your questions, be more specific?
    – Appleoddity
    yesterday










  • @grawity Well, comment converted to answer.
    – Akina
    yesterday










  • @Appleoddity I am currently taking a computer networking class. I am just curious to find out how routers are assigned IP addresses because it was not covered much in class. We learnt DHCP protocol when devices try to obtain dynamic IP addresses but not the case for routers.
    – calveeen
    yesterday


















Good questions. But very broad and mostly unanswerable in more than general terms. Whether static or dynamic depends on the service you purchase. But mainly your router plays little role in how things operate as it’s the ISP’s modem that bridges your network to the ISP’s network. So the service provider and type of service play a huge role in how your router needs to be configured.
– Appleoddity
yesterday




Good questions. But very broad and mostly unanswerable in more than general terms. Whether static or dynamic depends on the service you purchase. But mainly your router plays little role in how things operate as it’s the ISP’s modem that bridges your network to the ISP’s network. So the service provider and type of service play a huge role in how your router needs to be configured.
– Appleoddity
yesterday












What is the purpose of your questions, be more specific?
– Appleoddity
yesterday




What is the purpose of your questions, be more specific?
– Appleoddity
yesterday












@grawity Well, comment converted to answer.
– Akina
yesterday




@grawity Well, comment converted to answer.
– Akina
yesterday












@Appleoddity I am currently taking a computer networking class. I am just curious to find out how routers are assigned IP addresses because it was not covered much in class. We learnt DHCP protocol when devices try to obtain dynamic IP addresses but not the case for routers.
– calveeen
yesterday






@Appleoddity I am currently taking a computer networking class. I am just curious to find out how routers are assigned IP addresses because it was not covered much in class. We learnt DHCP protocol when devices try to obtain dynamic IP addresses but not the case for routers.
– calveeen
yesterday












3 Answers
3






active

oldest

votes

















up vote
1
down vote














When you first turn on your home router, how does it acquire a public IP address ?




In most cases any new SOHO router is set to obtain external IP dynamically (DHCP). Any other setting needs some hand-set values for proper connection.




which server does it request to for an IP address ?




Router sends its DHCP request like a broadcast. So the provider's DHCP accepts it (if it exists and if current client connection must use DHCP).




does it have to do a DHCP request every time you turn on the router ?




Yes.



Moreover, when router's address is set from DHCP, it has a property of its max. possible age (leased time), and when this time expired (in real - when near 80% of leased time expires) the router sends DHCP request again to renew the lease and reset leased time (but DHCP server in some cases may not renew, but alter leased IP address).






share|improve this answer





















  • Hey thanks for your answer ! it answered the questions that i had in my post !
    – calveeen
    yesterday


















up vote
1
down vote













It actually depends a bit on your modem, but broadly that's how it works. There might be different protocols and setup until your modem, - with various protocols like PPPoe and such



enter image description here



here's an example of various ones my old router supports. (I have it disabled since I use it as an AP). Many of these run DHCP over the other protocol.



These may optionally use DHCP or static addressing for IPv4 depending on your ISP, and the lease times depend entirely on your ISP.



I run my own linux router, on a perfectly vanilla ONT - and it uses the same basic settings as it would as it was a client - automatic DHCP.



Looking at DHCP client logs (not my actual IPs - swapped them out for RFC 5737 IPs, and swapped out some other things for bogus values)



Nov 13 09:20:44 heckate_router dhclient[1231]: Internet Systems Consortium DHCP Client 4.3.5
Nov 13 09:20:44 heckate_router dhclient[1231]: Copyright 2004-2016 Internet Systems Consortium.
Nov 13 09:20:44 heckate_router dhclient[1231]: All rights reserved.
Nov 13 09:20:44 heckate_router dhclient[1231]: For info, please visit https://www.isc.org/software/dhcp/
Nov 13 09:20:44 heckate_router dhclient[1231]:
Nov 13 09:20:44 heckate_router dhclient[1231]: Listening on LPF/enp1s0/FF:FF:FF:FF:FF:FF
Nov 13 09:20:44 heckate_router dhclient[1231]: Sending on LPF/enp1s0/FF:FF:FF:FF:FF:FF
Nov 13 09:20:44 heckate_router dhclient[1231]: Sending on Socket/fallback
Nov 13 09:20:44 heckate_router dhclient[1231]: DHCPDISCOVER on enp1s0 to 255.255.255.255 port 67 interval 3 (xid=0xDEADBEEF)
Nov 13 09:20:47 heckate_router dhclient[1231]: DHCPDISCOVER on enp1s0 to 255.255.255.255 port 67 interval 8 (xid=0xDEADBEEF)
Nov 13 09:20:55 heckate_router dhclient[1231]: DHCPDISCOVER on enp1s0 to 255.255.255.255 port 67 interval 17 (xid=0xDEADBEEF)
Nov 13 09:20:55 heckate_router dhclient[1231]: DHCPREQUEST of 192.0.2.197 on enp1s0 to 255.255.255.255 port 67 (xid=0xDEADBEEF)
Nov 13 09:20:55 heckate_router dhclient[1231]: DHCPOFFER of 192.0.2.197 from 203.0.113.3
Nov 13 09:20:55 heckate_router dhclient[1231]: DHCPACK of 192.0.2.197 from 203.0.113.3
Nov 13 09:20:55 heckate_router dhclient[1231]: bound to 192.0.2.197 -- renewal in 74135 seconds.
Nov 14 05:56:30 heckate_router dhclient[1794]: DHCPREQUEST of 192.0.2.197 on enp1s0 to 198.51.100.201 port 67 (xid=0xDEADBEEF)
Nov 14 05:56:30 heckate_router dhclient[1794]: DHCPACK of 192.0.2.197 from 172.17.0.201
Nov 14 05:56:30 heckate_router dhclient[1794]: bound to 192.0.2.197 -- renewal in 88638 seconds.


This is almost the same way it would work inside a lan, and the IP address lease is refreshed periodically. In fact, on the "internet" facing end, once the underlying protocol is negotiated (in my case by the ONT, or in other cases your modem), it is indistinguishable from a client machine in your lan






share|improve this answer





















  • Hey appreciate your detailed answer ! it was helpful !
    – calveeen
    yesterday


















up vote
0
down vote













In the context of the service you contracted from your ISP and their network :




  • Your ISP issue router gets a static IP address


or




  • Your ISP issue router gets a dynamic IP address


The specific protocol that handles the IP assignment can vary depending on how up-to-date your ISP is in terms of equipment.



Assuming your ISP is using DHCP to address your ISP issue router your router is indeed a client to it and it get's it's address from a server within your provider's network.
When you first connect your router it does send a broadcast to the network requesting an address. When it get's one the type of address comes into play. If you have a static IP address this address will not change.



But more commonly a dynamic address is contracted and it has a lease time, that being how long it lasts until requiring renewal.
If you shutdown your router, and turn it back it won't request a new address because it already has one, assuming the lease is still valid ( If the router has the address in memory or the server keeps track of who is what address is another issue). Usually when the lease is halfway through it's time, a new IP is requested.






share|improve this answer





















  • Hey thanks for your answer it was helpful in helping me understand computer networking even more !
    – calveeen
    yesterday












  • @calveeen I'm glad I was of use!
    – Ricardo S.
    yesterday










  • Just to check my understanding IANA is an organization that hands allocates IP addresses to countries around the world. Within those countries, IP addresses are allocated to the different service providers in the country. Based on the IP addresses allocated to each ISP, the router may use DHCP to obtain one of the free IP addresses given to the ISP ?
    – calveeen
    yesterday










  • @calveen It's a little more complicated than that. I can't quite recall which organization handles addressing on that level but I have a feeling it is indeed IANA. The bulk of problem is the addressing space in IPv4, which simply isn't enough for every network and host. What happens is clever partition of the networks. You have global systems separated by regions and inside the regions you have ISP's which have their own networks. Your router gets an IP from your ISP network, which in turn, their network has a router that receives an IP based on the region..
    – Ricardo S.
    yesterday










  • @calveeen Character limits are a pain.I took a remote course on this very subject that glazed on these networks and organizations and oooh boy lotta readin'!
    – Ricardo S.
    yesterday











Your Answer








StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "3"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});






calveeen is a new contributor. Be nice, and check out our Code of Conduct.










 

draft saved


draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1375196%2fhow-does-a-home-router-acquire-its-ip-address%23new-answer', 'question_page');
}
);

Post as a guest
































3 Answers
3






active

oldest

votes








3 Answers
3






active

oldest

votes









active

oldest

votes






active

oldest

votes








up vote
1
down vote














When you first turn on your home router, how does it acquire a public IP address ?




In most cases any new SOHO router is set to obtain external IP dynamically (DHCP). Any other setting needs some hand-set values for proper connection.




which server does it request to for an IP address ?




Router sends its DHCP request like a broadcast. So the provider's DHCP accepts it (if it exists and if current client connection must use DHCP).




does it have to do a DHCP request every time you turn on the router ?




Yes.



Moreover, when router's address is set from DHCP, it has a property of its max. possible age (leased time), and when this time expired (in real - when near 80% of leased time expires) the router sends DHCP request again to renew the lease and reset leased time (but DHCP server in some cases may not renew, but alter leased IP address).






share|improve this answer





















  • Hey thanks for your answer ! it answered the questions that i had in my post !
    – calveeen
    yesterday















up vote
1
down vote














When you first turn on your home router, how does it acquire a public IP address ?




In most cases any new SOHO router is set to obtain external IP dynamically (DHCP). Any other setting needs some hand-set values for proper connection.




which server does it request to for an IP address ?




Router sends its DHCP request like a broadcast. So the provider's DHCP accepts it (if it exists and if current client connection must use DHCP).




does it have to do a DHCP request every time you turn on the router ?




Yes.



Moreover, when router's address is set from DHCP, it has a property of its max. possible age (leased time), and when this time expired (in real - when near 80% of leased time expires) the router sends DHCP request again to renew the lease and reset leased time (but DHCP server in some cases may not renew, but alter leased IP address).






share|improve this answer





















  • Hey thanks for your answer ! it answered the questions that i had in my post !
    – calveeen
    yesterday













up vote
1
down vote










up vote
1
down vote










When you first turn on your home router, how does it acquire a public IP address ?




In most cases any new SOHO router is set to obtain external IP dynamically (DHCP). Any other setting needs some hand-set values for proper connection.




which server does it request to for an IP address ?




Router sends its DHCP request like a broadcast. So the provider's DHCP accepts it (if it exists and if current client connection must use DHCP).




does it have to do a DHCP request every time you turn on the router ?




Yes.



Moreover, when router's address is set from DHCP, it has a property of its max. possible age (leased time), and when this time expired (in real - when near 80% of leased time expires) the router sends DHCP request again to renew the lease and reset leased time (but DHCP server in some cases may not renew, but alter leased IP address).






share|improve this answer













When you first turn on your home router, how does it acquire a public IP address ?




In most cases any new SOHO router is set to obtain external IP dynamically (DHCP). Any other setting needs some hand-set values for proper connection.




which server does it request to for an IP address ?




Router sends its DHCP request like a broadcast. So the provider's DHCP accepts it (if it exists and if current client connection must use DHCP).




does it have to do a DHCP request every time you turn on the router ?




Yes.



Moreover, when router's address is set from DHCP, it has a property of its max. possible age (leased time), and when this time expired (in real - when near 80% of leased time expires) the router sends DHCP request again to renew the lease and reset leased time (but DHCP server in some cases may not renew, but alter leased IP address).







share|improve this answer












share|improve this answer



share|improve this answer










answered yesterday









Akina

1,21528




1,21528












  • Hey thanks for your answer ! it answered the questions that i had in my post !
    – calveeen
    yesterday


















  • Hey thanks for your answer ! it answered the questions that i had in my post !
    – calveeen
    yesterday
















Hey thanks for your answer ! it answered the questions that i had in my post !
– calveeen
yesterday




Hey thanks for your answer ! it answered the questions that i had in my post !
– calveeen
yesterday












up vote
1
down vote













It actually depends a bit on your modem, but broadly that's how it works. There might be different protocols and setup until your modem, - with various protocols like PPPoe and such



enter image description here



here's an example of various ones my old router supports. (I have it disabled since I use it as an AP). Many of these run DHCP over the other protocol.



These may optionally use DHCP or static addressing for IPv4 depending on your ISP, and the lease times depend entirely on your ISP.



I run my own linux router, on a perfectly vanilla ONT - and it uses the same basic settings as it would as it was a client - automatic DHCP.



Looking at DHCP client logs (not my actual IPs - swapped them out for RFC 5737 IPs, and swapped out some other things for bogus values)



Nov 13 09:20:44 heckate_router dhclient[1231]: Internet Systems Consortium DHCP Client 4.3.5
Nov 13 09:20:44 heckate_router dhclient[1231]: Copyright 2004-2016 Internet Systems Consortium.
Nov 13 09:20:44 heckate_router dhclient[1231]: All rights reserved.
Nov 13 09:20:44 heckate_router dhclient[1231]: For info, please visit https://www.isc.org/software/dhcp/
Nov 13 09:20:44 heckate_router dhclient[1231]:
Nov 13 09:20:44 heckate_router dhclient[1231]: Listening on LPF/enp1s0/FF:FF:FF:FF:FF:FF
Nov 13 09:20:44 heckate_router dhclient[1231]: Sending on LPF/enp1s0/FF:FF:FF:FF:FF:FF
Nov 13 09:20:44 heckate_router dhclient[1231]: Sending on Socket/fallback
Nov 13 09:20:44 heckate_router dhclient[1231]: DHCPDISCOVER on enp1s0 to 255.255.255.255 port 67 interval 3 (xid=0xDEADBEEF)
Nov 13 09:20:47 heckate_router dhclient[1231]: DHCPDISCOVER on enp1s0 to 255.255.255.255 port 67 interval 8 (xid=0xDEADBEEF)
Nov 13 09:20:55 heckate_router dhclient[1231]: DHCPDISCOVER on enp1s0 to 255.255.255.255 port 67 interval 17 (xid=0xDEADBEEF)
Nov 13 09:20:55 heckate_router dhclient[1231]: DHCPREQUEST of 192.0.2.197 on enp1s0 to 255.255.255.255 port 67 (xid=0xDEADBEEF)
Nov 13 09:20:55 heckate_router dhclient[1231]: DHCPOFFER of 192.0.2.197 from 203.0.113.3
Nov 13 09:20:55 heckate_router dhclient[1231]: DHCPACK of 192.0.2.197 from 203.0.113.3
Nov 13 09:20:55 heckate_router dhclient[1231]: bound to 192.0.2.197 -- renewal in 74135 seconds.
Nov 14 05:56:30 heckate_router dhclient[1794]: DHCPREQUEST of 192.0.2.197 on enp1s0 to 198.51.100.201 port 67 (xid=0xDEADBEEF)
Nov 14 05:56:30 heckate_router dhclient[1794]: DHCPACK of 192.0.2.197 from 172.17.0.201
Nov 14 05:56:30 heckate_router dhclient[1794]: bound to 192.0.2.197 -- renewal in 88638 seconds.


This is almost the same way it would work inside a lan, and the IP address lease is refreshed periodically. In fact, on the "internet" facing end, once the underlying protocol is negotiated (in my case by the ONT, or in other cases your modem), it is indistinguishable from a client machine in your lan






share|improve this answer





















  • Hey appreciate your detailed answer ! it was helpful !
    – calveeen
    yesterday















up vote
1
down vote













It actually depends a bit on your modem, but broadly that's how it works. There might be different protocols and setup until your modem, - with various protocols like PPPoe and such



enter image description here



here's an example of various ones my old router supports. (I have it disabled since I use it as an AP). Many of these run DHCP over the other protocol.



These may optionally use DHCP or static addressing for IPv4 depending on your ISP, and the lease times depend entirely on your ISP.



I run my own linux router, on a perfectly vanilla ONT - and it uses the same basic settings as it would as it was a client - automatic DHCP.



Looking at DHCP client logs (not my actual IPs - swapped them out for RFC 5737 IPs, and swapped out some other things for bogus values)



Nov 13 09:20:44 heckate_router dhclient[1231]: Internet Systems Consortium DHCP Client 4.3.5
Nov 13 09:20:44 heckate_router dhclient[1231]: Copyright 2004-2016 Internet Systems Consortium.
Nov 13 09:20:44 heckate_router dhclient[1231]: All rights reserved.
Nov 13 09:20:44 heckate_router dhclient[1231]: For info, please visit https://www.isc.org/software/dhcp/
Nov 13 09:20:44 heckate_router dhclient[1231]:
Nov 13 09:20:44 heckate_router dhclient[1231]: Listening on LPF/enp1s0/FF:FF:FF:FF:FF:FF
Nov 13 09:20:44 heckate_router dhclient[1231]: Sending on LPF/enp1s0/FF:FF:FF:FF:FF:FF
Nov 13 09:20:44 heckate_router dhclient[1231]: Sending on Socket/fallback
Nov 13 09:20:44 heckate_router dhclient[1231]: DHCPDISCOVER on enp1s0 to 255.255.255.255 port 67 interval 3 (xid=0xDEADBEEF)
Nov 13 09:20:47 heckate_router dhclient[1231]: DHCPDISCOVER on enp1s0 to 255.255.255.255 port 67 interval 8 (xid=0xDEADBEEF)
Nov 13 09:20:55 heckate_router dhclient[1231]: DHCPDISCOVER on enp1s0 to 255.255.255.255 port 67 interval 17 (xid=0xDEADBEEF)
Nov 13 09:20:55 heckate_router dhclient[1231]: DHCPREQUEST of 192.0.2.197 on enp1s0 to 255.255.255.255 port 67 (xid=0xDEADBEEF)
Nov 13 09:20:55 heckate_router dhclient[1231]: DHCPOFFER of 192.0.2.197 from 203.0.113.3
Nov 13 09:20:55 heckate_router dhclient[1231]: DHCPACK of 192.0.2.197 from 203.0.113.3
Nov 13 09:20:55 heckate_router dhclient[1231]: bound to 192.0.2.197 -- renewal in 74135 seconds.
Nov 14 05:56:30 heckate_router dhclient[1794]: DHCPREQUEST of 192.0.2.197 on enp1s0 to 198.51.100.201 port 67 (xid=0xDEADBEEF)
Nov 14 05:56:30 heckate_router dhclient[1794]: DHCPACK of 192.0.2.197 from 172.17.0.201
Nov 14 05:56:30 heckate_router dhclient[1794]: bound to 192.0.2.197 -- renewal in 88638 seconds.


This is almost the same way it would work inside a lan, and the IP address lease is refreshed periodically. In fact, on the "internet" facing end, once the underlying protocol is negotiated (in my case by the ONT, or in other cases your modem), it is indistinguishable from a client machine in your lan






share|improve this answer





















  • Hey appreciate your detailed answer ! it was helpful !
    – calveeen
    yesterday













up vote
1
down vote










up vote
1
down vote









It actually depends a bit on your modem, but broadly that's how it works. There might be different protocols and setup until your modem, - with various protocols like PPPoe and such



enter image description here



here's an example of various ones my old router supports. (I have it disabled since I use it as an AP). Many of these run DHCP over the other protocol.



These may optionally use DHCP or static addressing for IPv4 depending on your ISP, and the lease times depend entirely on your ISP.



I run my own linux router, on a perfectly vanilla ONT - and it uses the same basic settings as it would as it was a client - automatic DHCP.



Looking at DHCP client logs (not my actual IPs - swapped them out for RFC 5737 IPs, and swapped out some other things for bogus values)



Nov 13 09:20:44 heckate_router dhclient[1231]: Internet Systems Consortium DHCP Client 4.3.5
Nov 13 09:20:44 heckate_router dhclient[1231]: Copyright 2004-2016 Internet Systems Consortium.
Nov 13 09:20:44 heckate_router dhclient[1231]: All rights reserved.
Nov 13 09:20:44 heckate_router dhclient[1231]: For info, please visit https://www.isc.org/software/dhcp/
Nov 13 09:20:44 heckate_router dhclient[1231]:
Nov 13 09:20:44 heckate_router dhclient[1231]: Listening on LPF/enp1s0/FF:FF:FF:FF:FF:FF
Nov 13 09:20:44 heckate_router dhclient[1231]: Sending on LPF/enp1s0/FF:FF:FF:FF:FF:FF
Nov 13 09:20:44 heckate_router dhclient[1231]: Sending on Socket/fallback
Nov 13 09:20:44 heckate_router dhclient[1231]: DHCPDISCOVER on enp1s0 to 255.255.255.255 port 67 interval 3 (xid=0xDEADBEEF)
Nov 13 09:20:47 heckate_router dhclient[1231]: DHCPDISCOVER on enp1s0 to 255.255.255.255 port 67 interval 8 (xid=0xDEADBEEF)
Nov 13 09:20:55 heckate_router dhclient[1231]: DHCPDISCOVER on enp1s0 to 255.255.255.255 port 67 interval 17 (xid=0xDEADBEEF)
Nov 13 09:20:55 heckate_router dhclient[1231]: DHCPREQUEST of 192.0.2.197 on enp1s0 to 255.255.255.255 port 67 (xid=0xDEADBEEF)
Nov 13 09:20:55 heckate_router dhclient[1231]: DHCPOFFER of 192.0.2.197 from 203.0.113.3
Nov 13 09:20:55 heckate_router dhclient[1231]: DHCPACK of 192.0.2.197 from 203.0.113.3
Nov 13 09:20:55 heckate_router dhclient[1231]: bound to 192.0.2.197 -- renewal in 74135 seconds.
Nov 14 05:56:30 heckate_router dhclient[1794]: DHCPREQUEST of 192.0.2.197 on enp1s0 to 198.51.100.201 port 67 (xid=0xDEADBEEF)
Nov 14 05:56:30 heckate_router dhclient[1794]: DHCPACK of 192.0.2.197 from 172.17.0.201
Nov 14 05:56:30 heckate_router dhclient[1794]: bound to 192.0.2.197 -- renewal in 88638 seconds.


This is almost the same way it would work inside a lan, and the IP address lease is refreshed periodically. In fact, on the "internet" facing end, once the underlying protocol is negotiated (in my case by the ONT, or in other cases your modem), it is indistinguishable from a client machine in your lan






share|improve this answer












It actually depends a bit on your modem, but broadly that's how it works. There might be different protocols and setup until your modem, - with various protocols like PPPoe and such



enter image description here



here's an example of various ones my old router supports. (I have it disabled since I use it as an AP). Many of these run DHCP over the other protocol.



These may optionally use DHCP or static addressing for IPv4 depending on your ISP, and the lease times depend entirely on your ISP.



I run my own linux router, on a perfectly vanilla ONT - and it uses the same basic settings as it would as it was a client - automatic DHCP.



Looking at DHCP client logs (not my actual IPs - swapped them out for RFC 5737 IPs, and swapped out some other things for bogus values)



Nov 13 09:20:44 heckate_router dhclient[1231]: Internet Systems Consortium DHCP Client 4.3.5
Nov 13 09:20:44 heckate_router dhclient[1231]: Copyright 2004-2016 Internet Systems Consortium.
Nov 13 09:20:44 heckate_router dhclient[1231]: All rights reserved.
Nov 13 09:20:44 heckate_router dhclient[1231]: For info, please visit https://www.isc.org/software/dhcp/
Nov 13 09:20:44 heckate_router dhclient[1231]:
Nov 13 09:20:44 heckate_router dhclient[1231]: Listening on LPF/enp1s0/FF:FF:FF:FF:FF:FF
Nov 13 09:20:44 heckate_router dhclient[1231]: Sending on LPF/enp1s0/FF:FF:FF:FF:FF:FF
Nov 13 09:20:44 heckate_router dhclient[1231]: Sending on Socket/fallback
Nov 13 09:20:44 heckate_router dhclient[1231]: DHCPDISCOVER on enp1s0 to 255.255.255.255 port 67 interval 3 (xid=0xDEADBEEF)
Nov 13 09:20:47 heckate_router dhclient[1231]: DHCPDISCOVER on enp1s0 to 255.255.255.255 port 67 interval 8 (xid=0xDEADBEEF)
Nov 13 09:20:55 heckate_router dhclient[1231]: DHCPDISCOVER on enp1s0 to 255.255.255.255 port 67 interval 17 (xid=0xDEADBEEF)
Nov 13 09:20:55 heckate_router dhclient[1231]: DHCPREQUEST of 192.0.2.197 on enp1s0 to 255.255.255.255 port 67 (xid=0xDEADBEEF)
Nov 13 09:20:55 heckate_router dhclient[1231]: DHCPOFFER of 192.0.2.197 from 203.0.113.3
Nov 13 09:20:55 heckate_router dhclient[1231]: DHCPACK of 192.0.2.197 from 203.0.113.3
Nov 13 09:20:55 heckate_router dhclient[1231]: bound to 192.0.2.197 -- renewal in 74135 seconds.
Nov 14 05:56:30 heckate_router dhclient[1794]: DHCPREQUEST of 192.0.2.197 on enp1s0 to 198.51.100.201 port 67 (xid=0xDEADBEEF)
Nov 14 05:56:30 heckate_router dhclient[1794]: DHCPACK of 192.0.2.197 from 172.17.0.201
Nov 14 05:56:30 heckate_router dhclient[1794]: bound to 192.0.2.197 -- renewal in 88638 seconds.


This is almost the same way it would work inside a lan, and the IP address lease is refreshed periodically. In fact, on the "internet" facing end, once the underlying protocol is negotiated (in my case by the ONT, or in other cases your modem), it is indistinguishable from a client machine in your lan







share|improve this answer












share|improve this answer



share|improve this answer










answered yesterday









Journeyman Geek

111k43216363




111k43216363












  • Hey appreciate your detailed answer ! it was helpful !
    – calveeen
    yesterday


















  • Hey appreciate your detailed answer ! it was helpful !
    – calveeen
    yesterday
















Hey appreciate your detailed answer ! it was helpful !
– calveeen
yesterday




Hey appreciate your detailed answer ! it was helpful !
– calveeen
yesterday










up vote
0
down vote













In the context of the service you contracted from your ISP and their network :




  • Your ISP issue router gets a static IP address


or




  • Your ISP issue router gets a dynamic IP address


The specific protocol that handles the IP assignment can vary depending on how up-to-date your ISP is in terms of equipment.



Assuming your ISP is using DHCP to address your ISP issue router your router is indeed a client to it and it get's it's address from a server within your provider's network.
When you first connect your router it does send a broadcast to the network requesting an address. When it get's one the type of address comes into play. If you have a static IP address this address will not change.



But more commonly a dynamic address is contracted and it has a lease time, that being how long it lasts until requiring renewal.
If you shutdown your router, and turn it back it won't request a new address because it already has one, assuming the lease is still valid ( If the router has the address in memory or the server keeps track of who is what address is another issue). Usually when the lease is halfway through it's time, a new IP is requested.






share|improve this answer





















  • Hey thanks for your answer it was helpful in helping me understand computer networking even more !
    – calveeen
    yesterday












  • @calveeen I'm glad I was of use!
    – Ricardo S.
    yesterday










  • Just to check my understanding IANA is an organization that hands allocates IP addresses to countries around the world. Within those countries, IP addresses are allocated to the different service providers in the country. Based on the IP addresses allocated to each ISP, the router may use DHCP to obtain one of the free IP addresses given to the ISP ?
    – calveeen
    yesterday










  • @calveen It's a little more complicated than that. I can't quite recall which organization handles addressing on that level but I have a feeling it is indeed IANA. The bulk of problem is the addressing space in IPv4, which simply isn't enough for every network and host. What happens is clever partition of the networks. You have global systems separated by regions and inside the regions you have ISP's which have their own networks. Your router gets an IP from your ISP network, which in turn, their network has a router that receives an IP based on the region..
    – Ricardo S.
    yesterday










  • @calveeen Character limits are a pain.I took a remote course on this very subject that glazed on these networks and organizations and oooh boy lotta readin'!
    – Ricardo S.
    yesterday















up vote
0
down vote













In the context of the service you contracted from your ISP and their network :




  • Your ISP issue router gets a static IP address


or




  • Your ISP issue router gets a dynamic IP address


The specific protocol that handles the IP assignment can vary depending on how up-to-date your ISP is in terms of equipment.



Assuming your ISP is using DHCP to address your ISP issue router your router is indeed a client to it and it get's it's address from a server within your provider's network.
When you first connect your router it does send a broadcast to the network requesting an address. When it get's one the type of address comes into play. If you have a static IP address this address will not change.



But more commonly a dynamic address is contracted and it has a lease time, that being how long it lasts until requiring renewal.
If you shutdown your router, and turn it back it won't request a new address because it already has one, assuming the lease is still valid ( If the router has the address in memory or the server keeps track of who is what address is another issue). Usually when the lease is halfway through it's time, a new IP is requested.






share|improve this answer





















  • Hey thanks for your answer it was helpful in helping me understand computer networking even more !
    – calveeen
    yesterday












  • @calveeen I'm glad I was of use!
    – Ricardo S.
    yesterday










  • Just to check my understanding IANA is an organization that hands allocates IP addresses to countries around the world. Within those countries, IP addresses are allocated to the different service providers in the country. Based on the IP addresses allocated to each ISP, the router may use DHCP to obtain one of the free IP addresses given to the ISP ?
    – calveeen
    yesterday










  • @calveen It's a little more complicated than that. I can't quite recall which organization handles addressing on that level but I have a feeling it is indeed IANA. The bulk of problem is the addressing space in IPv4, which simply isn't enough for every network and host. What happens is clever partition of the networks. You have global systems separated by regions and inside the regions you have ISP's which have their own networks. Your router gets an IP from your ISP network, which in turn, their network has a router that receives an IP based on the region..
    – Ricardo S.
    yesterday










  • @calveeen Character limits are a pain.I took a remote course on this very subject that glazed on these networks and organizations and oooh boy lotta readin'!
    – Ricardo S.
    yesterday













up vote
0
down vote










up vote
0
down vote









In the context of the service you contracted from your ISP and their network :




  • Your ISP issue router gets a static IP address


or




  • Your ISP issue router gets a dynamic IP address


The specific protocol that handles the IP assignment can vary depending on how up-to-date your ISP is in terms of equipment.



Assuming your ISP is using DHCP to address your ISP issue router your router is indeed a client to it and it get's it's address from a server within your provider's network.
When you first connect your router it does send a broadcast to the network requesting an address. When it get's one the type of address comes into play. If you have a static IP address this address will not change.



But more commonly a dynamic address is contracted and it has a lease time, that being how long it lasts until requiring renewal.
If you shutdown your router, and turn it back it won't request a new address because it already has one, assuming the lease is still valid ( If the router has the address in memory or the server keeps track of who is what address is another issue). Usually when the lease is halfway through it's time, a new IP is requested.






share|improve this answer












In the context of the service you contracted from your ISP and their network :




  • Your ISP issue router gets a static IP address


or




  • Your ISP issue router gets a dynamic IP address


The specific protocol that handles the IP assignment can vary depending on how up-to-date your ISP is in terms of equipment.



Assuming your ISP is using DHCP to address your ISP issue router your router is indeed a client to it and it get's it's address from a server within your provider's network.
When you first connect your router it does send a broadcast to the network requesting an address. When it get's one the type of address comes into play. If you have a static IP address this address will not change.



But more commonly a dynamic address is contracted and it has a lease time, that being how long it lasts until requiring renewal.
If you shutdown your router, and turn it back it won't request a new address because it already has one, assuming the lease is still valid ( If the router has the address in memory or the server keeps track of who is what address is another issue). Usually when the lease is halfway through it's time, a new IP is requested.







share|improve this answer












share|improve this answer



share|improve this answer










answered yesterday









Ricardo S.

527




527












  • Hey thanks for your answer it was helpful in helping me understand computer networking even more !
    – calveeen
    yesterday












  • @calveeen I'm glad I was of use!
    – Ricardo S.
    yesterday










  • Just to check my understanding IANA is an organization that hands allocates IP addresses to countries around the world. Within those countries, IP addresses are allocated to the different service providers in the country. Based on the IP addresses allocated to each ISP, the router may use DHCP to obtain one of the free IP addresses given to the ISP ?
    – calveeen
    yesterday










  • @calveen It's a little more complicated than that. I can't quite recall which organization handles addressing on that level but I have a feeling it is indeed IANA. The bulk of problem is the addressing space in IPv4, which simply isn't enough for every network and host. What happens is clever partition of the networks. You have global systems separated by regions and inside the regions you have ISP's which have their own networks. Your router gets an IP from your ISP network, which in turn, their network has a router that receives an IP based on the region..
    – Ricardo S.
    yesterday










  • @calveeen Character limits are a pain.I took a remote course on this very subject that glazed on these networks and organizations and oooh boy lotta readin'!
    – Ricardo S.
    yesterday


















  • Hey thanks for your answer it was helpful in helping me understand computer networking even more !
    – calveeen
    yesterday












  • @calveeen I'm glad I was of use!
    – Ricardo S.
    yesterday










  • Just to check my understanding IANA is an organization that hands allocates IP addresses to countries around the world. Within those countries, IP addresses are allocated to the different service providers in the country. Based on the IP addresses allocated to each ISP, the router may use DHCP to obtain one of the free IP addresses given to the ISP ?
    – calveeen
    yesterday










  • @calveen It's a little more complicated than that. I can't quite recall which organization handles addressing on that level but I have a feeling it is indeed IANA. The bulk of problem is the addressing space in IPv4, which simply isn't enough for every network and host. What happens is clever partition of the networks. You have global systems separated by regions and inside the regions you have ISP's which have their own networks. Your router gets an IP from your ISP network, which in turn, their network has a router that receives an IP based on the region..
    – Ricardo S.
    yesterday










  • @calveeen Character limits are a pain.I took a remote course on this very subject that glazed on these networks and organizations and oooh boy lotta readin'!
    – Ricardo S.
    yesterday
















Hey thanks for your answer it was helpful in helping me understand computer networking even more !
– calveeen
yesterday






Hey thanks for your answer it was helpful in helping me understand computer networking even more !
– calveeen
yesterday














@calveeen I'm glad I was of use!
– Ricardo S.
yesterday




@calveeen I'm glad I was of use!
– Ricardo S.
yesterday












Just to check my understanding IANA is an organization that hands allocates IP addresses to countries around the world. Within those countries, IP addresses are allocated to the different service providers in the country. Based on the IP addresses allocated to each ISP, the router may use DHCP to obtain one of the free IP addresses given to the ISP ?
– calveeen
yesterday




Just to check my understanding IANA is an organization that hands allocates IP addresses to countries around the world. Within those countries, IP addresses are allocated to the different service providers in the country. Based on the IP addresses allocated to each ISP, the router may use DHCP to obtain one of the free IP addresses given to the ISP ?
– calveeen
yesterday












@calveen It's a little more complicated than that. I can't quite recall which organization handles addressing on that level but I have a feeling it is indeed IANA. The bulk of problem is the addressing space in IPv4, which simply isn't enough for every network and host. What happens is clever partition of the networks. You have global systems separated by regions and inside the regions you have ISP's which have their own networks. Your router gets an IP from your ISP network, which in turn, their network has a router that receives an IP based on the region..
– Ricardo S.
yesterday




@calveen It's a little more complicated than that. I can't quite recall which organization handles addressing on that level but I have a feeling it is indeed IANA. The bulk of problem is the addressing space in IPv4, which simply isn't enough for every network and host. What happens is clever partition of the networks. You have global systems separated by regions and inside the regions you have ISP's which have their own networks. Your router gets an IP from your ISP network, which in turn, their network has a router that receives an IP based on the region..
– Ricardo S.
yesterday












@calveeen Character limits are a pain.I took a remote course on this very subject that glazed on these networks and organizations and oooh boy lotta readin'!
– Ricardo S.
yesterday




@calveeen Character limits are a pain.I took a remote course on this very subject that glazed on these networks and organizations and oooh boy lotta readin'!
– Ricardo S.
yesterday










calveeen is a new contributor. Be nice, and check out our Code of Conduct.










 

draft saved


draft discarded


















calveeen is a new contributor. Be nice, and check out our Code of Conduct.













calveeen is a new contributor. Be nice, and check out our Code of Conduct.












calveeen is a new contributor. Be nice, and check out our Code of Conduct.















 


draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1375196%2fhow-does-a-home-router-acquire-its-ip-address%23new-answer', 'question_page');
}
);

Post as a guest




















































































Popular posts from this blog

Plaza Victoria

Puebla de Zaragoza

Musa