router - If you connect directly to your modem how does the IP address get assigned?

06
2014-04
  • novs12

    From my understanding your ISP will assign (sometimes dynamically) an IP address to your router.

    (Or is it assigned to the modem? [I'm starting to think it is.])

    If it is assigned to the router, then this question follows:

    What if I plug my PC directly into the modem via an Ethernet cable.

    Does my computer have hardware that interprets the IP being assigned by the ISP the same way the router does?

    If anyone can offer up some details on how this work that'd be great.

    Thanks!

  • Answers
  • Crippledsmurf

    The automatic assignment of IP addresses happens via a standard known as the Dynamic Host Configuration Protocol.

    When a computer connects to the network, the DHCP client, generally a component of the operating system sends out a DHCP request and recieves an offer from a DHCP server. The offer generally contains:

    1. An IP Address
    2. A subnet mask for that IP address
    3. A gateway that should be used for off-network requests (like those going via the internet)
    4. One or more DNS server addresses so the computer knows where to send DNS requests.

    Connecting to a Router

    When you plug your computer into a router or associate your wireless adapter with an access point, the computer will usually receive a DHCP response directly from the router, which may itself have requested an IP from the ISP for the interface the modem uses. it will then route traffic from the computer via it's interface connected to the modem where appropriate.

    Connecting to a Modem

    When you connect your computer to a modem, the DHCP request generated by the computer may be handled directly by the modem itself if the modem is running a DHCP server.

    Static Address Assignment

    If the modem is not running a DHCP server, you may have to staticly configure the client device's IP address, subnet mask, default gateway and DNS servers. If this is the case, the correct values will be giiven to subscribers, or entered by a service technician when the service is setup.

    Side note: This answer deals with addresses for end-user devices. Your modem also has an interface to the ISPs network, the address for this interface may also be configured by a DHCP server on the provider's network, however this depends how the provider chooses to configure their network.

  • Alex P.

    Your PC has software (DHCP client) that can request IP settings to be assigned to it by the ISP the same way the router does.

  • PsychoData

    In my experience, your modem is normally a DHCP client and a DHCP server, but they dont have to be either.

    IF your modem is a DHCP client, then when you connect it to your upstream network (IE. Plug the modem into cable of the DSL Line) and power it on IT will ask for an address on that interface. The ISP will then respond with an address for the modem. Alternatively it might be a static assignment, where it turns on, sets the address that the cable tech probably set up, and begins communicating. Another alternative is that there may be some sort of login system combined in with either of these two options. This takes care of upstream traffic (modem to ISP)

    IF your modem is a DHCP server (has been my experience as of late, then your device that plugs into the Modem will be asking for an address (similar to the modem asking the ISP above). Whatever device you plug in most likely has DHCP already turned on. If it is turned on already (whether router or computer) it is going to ask for an address. Alternatively, you may have been instructed to Set a manual address. In this case, the modem will most likely be expecting communication on this address and ignoring any other attempts. BONUS: The modem could potentially also act as a DHCP helper and forward your routers DHCP request to a place where it will get the REAL public IP that refers to your internet conection. 1

    If you have a router doing DHCP for your home network as well (most common), then all of your other devices are going to be asking your router for an address as well.

    Example Scenario: Power failure just ended. Everything starts back up. Modem asks ISP for its address, and gets one. Router asks Modem for address and gets one. (Maybe the public address!) Your Desktop computer finished booting and asks the router for an address, and the router gives it one. Now if the desktop asks for Google.com the router gets the request, the router forwards to the modem, the modem forwards to the ISP and the ISP forwards to the Internet, where it comes back down the other side to Google and Google responds. All of this happens in Usually Less than 20ms (~1/50th) of a second.

    The Internet is incredible.

    So, for a short answer, assuming you dont have DHCP turned off in your computer, it wont matter plugging into the modem directly or plugging your router into the modem and the computer into the router. But, using the router often does another process called NAT that allows you to have multiple devices behind your single internet connection, so routers are still usually recommended


  • Related Question

    networking - How do I use a Zyxel P660 router as just modem so that I can connect a WRT54GL router in cascade?
  • Questioner

    I have a Zyxel P660HW-t1 v2 router (which has a DSL port) and a WRT54GL router (which does not) and the exact same situation as in this thread (UPDATE: the connection between both devices is the important part, since I have been able to set the zyxel router to act as bridge by itself quite nicely. I have accessed my internet connection directly through a PC using PPPoE without any problems, the issues arise when I try to connect the WRT54GL router between the zyxel "modem" and my PCs).

    I've been trying to use my Zyxel P660 as a modem only:

    1. Setup P660 to bridge mode.
    2. Changed WRT54GL's IP address to 192.168.2.1 to avoid a conflict on the network.
    3. Configured the PPPoE settings as required on WRT54GL.

    The thing is that when I connect the Zyxel modem/router on the WRT54GL's internet port the light doesn't turn on. I can confirm that this port has been working ok, so I'm not really sure what's going between the devices. I checked several settings such as IPs, tried disabling DHCP on Zyxel/Linksys, Firewall on both and still nothing. Also, I tried connecting Zyxel directly to a computer in bridge mode and dialed successfully.

    I have even posted a question here before, thinking that what I asked there was the only thing I needed to get things done. Unfortunately it wasn't, and the guy that solved his issue didn't give enough details in his post (and is quite unlikely to give more details since he was an anonymous user).

    For one, I don't know how to do this part:

    connected to the Zyxel through telnet and forced LAN port 1 to be at 100mb as well

    I can't find the option that does this on the zyxel router. Not through telnet or the web admin.

    Can anyone help me solve this?

    EDIT: I noticed, in the end, that the router takes a while to tell you it "connected" to the WAN. So a bit of patience may be needed before making hasty assumptions. My case was possibly because of this, in the end.


  • Related Answers
  • njd

    You should be able to configure your P660 in bridge mode as explained in the manual. Once configured in bridge mode configure you WRT54GL to obtain the WAN IP address and DNS automatically. Also, make sure that the WRT54GL's LAN IP address is not the same as the IP assigned to the P660 (192.168.1.1 if following the guide, so something like 192.168.2.1 should work). Make sure the DHCP server is turned on on the WRT54GL and you should be good to go.