How does a router obtain its IP address?

Regnard Groob

So let's assume I connect a secondary router to my first. An Ethernet cable from one of the LAN ports to the secondary router's WAN.

Now, how does my secondary router actual obtain its IP address? Is it through DHCP protocol or any other?

The reason that I ask is that, when my ISP upgraded my 1st router (it's also a modem) firmware, apparently according to them I had to bridge the 2nd router through its LAN interface 4. There's no possibility to assign an IP Address manually to this interface, they started use the concept of "DMZ" somehow misleadingly. However, when I configured the first router to bridge LAN interface 4 like they said – my 2nd router started acting like a switch, even though it was connected through WAN. Although, a DHCP server (Windows Server 2012) connected to the 2nd router works perfectly fine; it receives an IP address from 1st router's DHCP and hands out addresses to its clients.

So perhaps a weird question, but do routers obtain their external addresses differently from DHCP clients? From a theoretical standpoint, routers shouldn't be any different.

Attie

Many people don't realise that a consumer "Router" is usually a number of components smushed into a single box.

The WAN / external ports are typically set to 'auto configure' using DHCP... that is they will ask for an IP address, and then use it. Many people don't care what the external IP is, so long as things work.

Hopefully this diagram will help to clarify some points, and hopefully I've drawn it correctly from your description:

Network

  • Each of the colored IP stacks will typically have a distinct IP address... thus each router will have an 'internal' and an 'external' IP.
  • The Blue IP stack will have an IP address assigned by your ISP. Don't even try to configure it yourself.
  • The Green IP stack will have a private address - typically 192.168.0.0/24 or similar by default. You are free to configure this.
    • The "Computer" in Router 1 will likely be running a DHCP server, and will lease addresses to clients on the network in this range. You can disable this.
  • The Red IP stack will follow on in a similar vein to the Blue... it will likely request an address from the service provider (in this case, Router 1).
  • If, instead of LAN4 of Router 1 acting like a dumb switch, you have configured it to act as a bridge, then you might find that Router 2's WAN port will try to get an IP directly from your ISP, not from Router 1's DHCP server... I suspect this is not what you want, as you'll need to have provision from your ISP for two public IPs.
  • It's not clear what you mean by "my 2nd router started acting like a switch"... If you could now communicate directly with clients connected to Router 1's LAN* ports, then as has been mentioned before, this is typical.
    • Router 2 would be 'Masquerading', allowing its internal hosts to communicate with external hosts using it's external IP. This is a standard feature of Network Address Translation.
    • Hosts on Router 1's LAN* ports likely won't be able to communicate with hosts on Router 2's LAN* ports.

As a side note, the "Router 2" block in the diagram above is often marketed as a "Cable Router", as many cable providers will supply their own external cable modem. This is just a marketing term, and it is of course possible to use such a router in this configuration, with an external DSL modem, etc...

Equally, it is possible to purchase a "Router" that contains a DSL modem, or a Cable modem built-in (as per "Router 1" above).

この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。

侵害の場合は、連絡してください[email protected]

編集
0

コメントを追加

0

関連記事

分類Dev

How does geolocation based on IP address work?

分類Dev

How to know a mac address for a Node knowing its IP on local network?

分類Dev

How to get the ip address of a computer from its hostname?

分類Dev

How does a browser distinguish whether the address in the address bar is an IP address or a Host name?

分類Dev

How does ARP Poisoning work if the IP address is wrong?

分類Dev

How to set static IP address?

分類Dev

How to find ip address in codeigniter?

分類Dev

Being able to use router's global address from its LAN?

分類Dev

SSL cert does not work with IP address for SAN

分類Dev

Browser does not load when ip address is entered directly into the address bar

分類Dev

How to obtain all available Elastic IP addresses in boto3

分類Dev

How to redirect a URL to a custom IP address?

分類Dev

How to reserve IP Address in DHCP Server

分類Dev

How to block an IP address from a network share

分類Dev

Unix: How to Test Ip Address is resolved to name

分類Dev

how to calculate length of an IP address using php

分類Dev

How to cut broadcast ip address into another variable

分類Dev

How to sort IP address stored as a varchar in Oracle

分類Dev

How to change IP address to point to localhost?

分類Dev

How to contact a person knowing their public IP address?

分類Dev

How to mount from an IP address using NFS?

分類Dev

My Docker container does not have IP address. Why?

分類Dev

RewriteRule with an IPv6 IP address does not work

分類Dev

How does someone obtain a large block of IPv6 adresses?

分類Dev

How to substitute actual type arguments in a generic method to obtain final types of its value arguments?

分類Dev

Python: How would it be possible to have the value of a variable instead of its address

分類Dev

How to connect to elasticsearch server using rest client with IP address

分類Dev

How to monitor ip address change using RTNETLINK socket in go language

分類Dev

how can i get clients ip address on UDP server in golang?

Related 関連記事

  1. 1

    How does geolocation based on IP address work?

  2. 2

    How to know a mac address for a Node knowing its IP on local network?

  3. 3

    How to get the ip address of a computer from its hostname?

  4. 4

    How does a browser distinguish whether the address in the address bar is an IP address or a Host name?

  5. 5

    How does ARP Poisoning work if the IP address is wrong?

  6. 6

    How to set static IP address?

  7. 7

    How to find ip address in codeigniter?

  8. 8

    Being able to use router's global address from its LAN?

  9. 9

    SSL cert does not work with IP address for SAN

  10. 10

    Browser does not load when ip address is entered directly into the address bar

  11. 11

    How to obtain all available Elastic IP addresses in boto3

  12. 12

    How to redirect a URL to a custom IP address?

  13. 13

    How to reserve IP Address in DHCP Server

  14. 14

    How to block an IP address from a network share

  15. 15

    Unix: How to Test Ip Address is resolved to name

  16. 16

    how to calculate length of an IP address using php

  17. 17

    How to cut broadcast ip address into another variable

  18. 18

    How to sort IP address stored as a varchar in Oracle

  19. 19

    How to change IP address to point to localhost?

  20. 20

    How to contact a person knowing their public IP address?

  21. 21

    How to mount from an IP address using NFS?

  22. 22

    My Docker container does not have IP address. Why?

  23. 23

    RewriteRule with an IPv6 IP address does not work

  24. 24

    How does someone obtain a large block of IPv6 adresses?

  25. 25

    How to substitute actual type arguments in a generic method to obtain final types of its value arguments?

  26. 26

    Python: How would it be possible to have the value of a variable instead of its address

  27. 27

    How to connect to elasticsearch server using rest client with IP address

  28. 28

    How to monitor ip address change using RTNETLINK socket in go language

  29. 29

    how can i get clients ip address on UDP server in golang?

ホットタグ

アーカイブ