Why is my public my IP change based on whether I'm using my modem solo or using my modem through my router?

0

When I am using my cable modem through my router to my PC, I have one IP address. When I skip my router and go from modem directly to PC, I get another IP address. When I go back through the router again, my IP changes back to what it was.

What is going on here?

oscilatingcretin

Posted 2013-10-09T19:44:41.257

Reputation: 4 093

Answers

5

This is fairly standard - the DHCP server on the ISP side remembers the MAC address of the client device and assigns IP address based on the history (unless the lease expired).

So the fact that you have 2 different network cards with 2 different MACs will result in the 2 different IPs.

More info: http://en.wikipedia.org/wiki/Dynamic_Host_Configuration_Protocol

TomEus

Posted 2013-10-09T19:44:41.257

Reputation: 3 355

Ah, so this is the core concept behind "MAC spoofing", isn't it? – oscilatingcretin – 2013-10-09T20:08:46.757

1Yes, in some cases MAC spoofing will be used to obtain the same IP but in most cases it is used to overcome network security where only specific MAC has access. I would not call it concept though – TomEus – 2013-10-09T20:49:34.993

3

In addition to what @TomEus has suggested regarding the lease time on the server, many/most DHCP clients will also request the last address they had, and if it's available for lease (and nothing else prevents it) then the DHCP server will give it to the client again.

Ƭᴇcʜιᴇ007

Posted 2013-10-09T19:44:41.257

Reputation: 103 763

1

I think you're seeing your WAN IP when on your cable modem and a LAN IP when you're on your router.

A router routes traffic between two networks (in a typical setup, a WAN side and a LAN side). When you directly connect your computer into your cable modem, you are directly connecting to your provider's network, and get one IP that they have assigned.

When you connect your router to the modem, the router gets that WAN IP, and it routes traffic between the provider and the devices that are connected to the router. Those internal devices all have different local IP addresses so they can be uniquely identified and talk to eachother. The router uses a NAT (network address translation) table to send traffic to the right device.


If you are getting a different WAN IP address when you switch devices that are plugged into your modem, it means that your ISP has set your service up so that every time a device requests an IP, it will give it a new one. You can request that your service come with a static IP, so that your WAN (Internet) IP address never changes.

Moses

Posted 2013-10-09T19:44:41.257

Reputation: 10 813