Router's IP vs. LAN IP: A Comparison

  • Thread starter prashantgolu
  • Start date
  • Tags
    Comparison
In summary, the main difference between a router's IP address and a LAN IP address is that the router's IP address is provided by the ISP and is used to connect to the Internet as a single device, while the LAN IP address is used for local communication between devices on the same network. The router also uses Network Address Translation (NAT) to modify packets and make the devices on the LAN appear as a single device on the Internet. The LAN IP addresses can be obtained through DHCP and should be reserved for local traffic. Multiple WAN IP addresses can be used to avoid NAT and allow for direct communication between devices on the Internet, but this can be costly. Additionally, having multiple WAN IP addresses can cause issues with online gaming and a separate
  • #1
prashantgolu
50
0
what is the difference between router's ip address and my lan ip adress...

what i understood is that we have a lan ip adress and a wan ip adrress ...now my wan ip address is found using what's my ip address address.com and it changes...hence dynamic...and my lan ip address is using ifconfig...but then everybody seeems to have same lan ip address ...and what's the work of a NAT...?
 
Technology news on Phys.org
  • #2
Since Internet IP addresses are limited and expensive, your ISP gives your router one IP address so that it can appear on the Internet as a single device. Most ISPs change this address periodically for various reasons, unless you pay them extra for a static (unchanging) IP address--which you might do if you are running a server, for example, so that the name servers on the Internet (the devices that know how a domain name maps to an IP address) know your IP address.

The router is a single device on the Internet. So one of the router's jobs, then, is to make everything behind it (everything on your LAN) appear as a single device on the Internet. It does this by modifying the packets as they come in and go out. That's NAT.

So that devices on your LAN can talk among themselves (including the LAN side of the router) each of them can be given a separate IP address and you don't have to pay for those because you're using them locally. You can either program an IP address into every device, or tell a device to ask the router for a free IP address for use on the LAN. The latter is most often used. The process of asking the router for an IP address to use locally is called DHCP. The IP addresses used locally should use those that are reserved for local traffic, like those that start with 192.168.x.x. This is so they are never confused with actual Internet IP addresses, as described in the next paragraph.

When a LAN device does want to access the Internet, it simply acts as if its on the Internet (sending packets to the Internet device using that destination device's Internet IP address). The router sees those packets and translates them accordingly before sending them out to the internet.

On a side note, there's not really a standardized way for a local device to find out the WAN (Internet) IP address of its own router in case it wants to tell it to some other device on the Internet so that other device can send unsolicited packets to the first device (also, your router won't allow unsolicited incoming packets unless it see a local device first send a packet to that device. Both devices must send a packet or two to the other to get the router to allow subsequent packets--this is called hole-punching). That's why an Internet peer-to-peer connection always requires a server on the Internet to set it up--because that server can see what the WAN addresses are for the two peers, and tell each the other's address. Then each device can send a hole-punching packet to the other to get their routers to allow more packets. There are even free servers out there just for doing this, called STUN servers. That's so you can, for example, write a game that sets up peer-to-peer connections using a free STUN server.
 
Last edited:
  • #3
fleem said:
Since Internet IP addresses are limited and expensive, your ISP gives your router one IP address.
The price for multiple WAN ip's is being reduced over time. Cable modems support up to 16 WAN IP's, although in the case of Cox cable, it's limited to 3 WAN ip's and each additional ip costs about $7 / month. ATT's DSL static ip block is $15 / month for 8 ip's, but 3 of those are overhead, so you end up with 5 static ip's.

Note that when you have a multiple ip setup with one ip per computer, you lose the LAN, since each computer is effectively connected to directly to the internet and not directly to each other. In the case of a cable modem, if you remove the ISP (coax) cable from the cable modem, it will then act as a LAN router, and assign local ips (192.168.x.x) to each computer. (Note you could have a mix of computers and routers, each with it's own WAN ip, connected to the ISP modem).

A router using one ip for multiple computers remaps the "port" addresses in each packet sent by the computers (it undoes the mapping on packets sent back to the computers). This can be an issue if trying to play an online game with multiple computers since the games often want to use specific port addresses. Having a multiple ip setup (one external WAN ip per computer) solves this issue (but then there's no LAN unless you disconnect the cable or dsl modem from the ISP and reboot everything).
 

Related to Router's IP vs. LAN IP: A Comparison

What is the difference between a router's IP and a LAN IP?

A router's IP is the unique address assigned to the router itself, which allows it to connect to other devices and networks. A LAN IP is the unique address assigned to a device on a local area network (LAN), which allows it to communicate with other devices on the same network.

How do I find my router's IP address?

You can typically find your router's IP address by accessing your router's settings or configuration page. This can be done by typing your router's default IP address into a web browser, or by using a command prompt or network utility tool.

Can a router's IP and a LAN IP be the same?

No, a router's IP and a LAN IP must be different in order to properly route network traffic. If they are the same, it can cause conflicts and connectivity issues on the network.

Why do routers have different IP addresses for different LANs?

Routers have different IP addresses for different LANs because they act as a gateway between different networks. Each LAN has its own unique IP address range, and the router's IP address is used as the default gateway for devices on that LAN to access the internet or communicate with devices on other networks.

Can a router's IP and a LAN IP be on different networks?

Yes, a router's IP and a LAN IP can be on different networks. This is because the router's IP is used to connect to other networks, while a LAN IP is used to connect devices on the same network. As long as the router is properly configured to route traffic between networks, it can have a different IP address than the devices on the network.

Similar threads

  • Programming and Computer Science
Replies
20
Views
3K
  • Programming and Computer Science
Replies
11
Views
3K
  • Computing and Technology
Replies
14
Views
1K
  • Computing and Technology
Replies
27
Views
2K
  • Computing and Technology
Replies
4
Views
1K
  • Programming and Computer Science
Replies
4
Views
2K
Replies
13
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
1
Views
610
  • Calculus and Beyond Homework Help
Replies
2
Views
2K
  • Computing and Technology
Replies
9
Views
6K
Back
Top