Router's IP vs. LAN IP: A Comparison

  • Thread starter Thread starter prashantgolu
  • Start date Start date
  • Tags Tags
    Comparison
Click For Summary
SUMMARY

The discussion clarifies the distinction between a router's WAN IP address and a LAN IP address. The WAN IP, which is dynamic and assigned by the ISP, allows the router to connect to the Internet, while the LAN IP addresses, typically in the 192.168.x.x range, are used for local devices. Network Address Translation (NAT) enables multiple devices on a LAN to share a single WAN IP address, facilitating communication with the Internet. Additionally, Dynamic Host Configuration Protocol (DHCP) is commonly used to assign local IP addresses to devices within the LAN.

PREREQUISITES
  • Understanding of Network Address Translation (NAT)
  • Familiarity with Dynamic Host Configuration Protocol (DHCP)
  • Knowledge of IP address types: WAN and LAN
  • Basic comprehension of peer-to-peer networking and STUN servers
NEXT STEPS
  • Research the configuration and management of NAT on routers
  • Explore DHCP server setup and IP address allocation
  • Learn about STUN servers and their role in peer-to-peer connections
  • Investigate the implications of using multiple WAN IP addresses for gaming and networking
USEFUL FOR

Network engineers, IT professionals, and anyone interested in understanding home networking, IP address management, and the functionality of routers in a local area network.

prashantgolu
Messages
50
Reaction score
0
what is the difference between router's ip address and my lan ip address...

what i understood is that we have a lan ip address 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
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:
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).
 

Similar threads

  • · Replies 20 ·
Replies
20
Views
4K
  • · Replies 11 ·
Replies
11
Views
4K
  • · Replies 1 ·
Replies
1
Views
380
  • · Replies 1 ·
Replies
1
Views
519
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 3 ·
Replies
3
Views
4K
  • · Replies 27 ·
Replies
27
Views
3K
  • · Replies 14 ·
Replies
14
Views
2K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 9 ·
Replies
9
Views
6K