1

It is well know that usually in small networks the IP of a host is allocated by the router, which acts as a DHCP server. Also, since my router acts as a NAT, it is sufficient to give my subnet a single external IP address.

My question is how does my router gets the external IP address? Does it uses a DHCP-like protocol? Is it ISP-dependent?

3 Answers 3

3

My question is how does my router gets the external IP address? Does it uses a DHCP-like protocol? Is it ISP-dependent?

It's somewhat ISP-dependent. However, since most wired networks provide the same upper-layer services (i.e. either you get Ethernet, or some Ethernet emulation), practically all wired ISPs use one of these two protocols:

  • DHCP (and SLAAC for IPv6) – literally the same protocol as in your LAN, and it works in the same way. The exact implementation varies between ISPs though (e.g. some require special options and customize their issued router to make replacing it more difficult).

  • PPP – now commonly seen as "PPPoE" (PPP-over-Ethernet), originally this was the mechanism used by dial-up modem clients. In addition to address configuration, it can also handle client authentication via username/password.

As far as I know, cable (DOCSIS) always uses DHCP, while other connection types – e.g. ADSL, VDSL, fiber – can use either one, depending on what the ISP prefers. Note that a single connection will usually use DHCP or PPP(oE), but not both at the same time.

Meanwhile, mobile (such as 4G) doesn't imitate an Ethernet-style network and doesn't use DHCP nor PPPoE – instead it has everything built directly into the connection (bearer) establishment procedure, and as a result, all 4G ISPs use the same protocol. Unfortunately I don't have any more information about it.

0

Your ISP assigns your modem-router device (properly known as a 'gateway') the external IP address; often, that's dynamically assigned. Should you pull the plug on the gateway before you go on holiday, and power up when you return, you likely will find a different external IP address has been assigned.

Different networks (cable vs DSL vs fiber optic) and different ISPs do it different ways because they have different head end equipment.

5
  • 1
    And you'll see something like Nov 26 14:19:08 syslog: Received NTP Sync Reply from ntp1.isp.sky.com Nov 26 14:19:08 syslog: System time is up to date Nov 26 14:38:46 syslog: Lease renewed 3600 ip 94.x.197.1x7 Commented Nov 26, 2019 at 18:26
  • 1
    Thanks! Can you please elaborate on the different ways/protocols? Commented Nov 26, 2019 at 18:28
  • Not without knowing a) your ISP b) doing research on your ISP and finding what equipment they have, and c) knowing the make and model of your gateway.
    – K7AAY
    Commented Nov 26, 2019 at 18:36
  • 1
    I understand. So I guess it is vendor-specific, and there is no well-know protocol to distribute the IP address? Commented Nov 26, 2019 at 18:44
  • No, but the wonderful thing about protocols is that we have so many of them, and I don't want to seize upon the wrong one and mislead.
    – K7AAY
    Commented Nov 26, 2019 at 18:48
0

my router acts as a NAT, it is sufficient to give my subnet a single external IP address.

Your modem gets the external IP and the router uses what is given (assuming the modem is in Bridged mode). If not Bridged, the modem does the initial NAT for you and the router does not need the external IP in this case.

More and more external IP last quite a while in your system. Mine go for a year or more on one external IP address

3
  • And how the Modem gets its IP? I.e., which protocols enables distributing externals IP addresses? Commented Nov 26, 2019 at 18:33
  • Your modem must be in Bridged mode for this to happen (and some modems are set up this way
    – anon
    Commented Nov 26, 2019 at 18:36
  • 2
    The question here is not about if the modem or the router acts as NAT. But how they get the (external) IP from the ISP in general. Commented Nov 26, 2019 at 18:46

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .