1

I understand the basics. WAN is a network that connects multiple LANs together. Usually the router is the connection between the LAN and WAN. But I have some questions books and the internet could not answer yet.

  • What is a WAN Address?
  • How can I distinguish between a WAN and LAN address?
  • How does the whole WAN addressing work? (I imagined a WAN address is the address of a router and the router somewhat forwards a package to my LAN IP)

2 Answers 2

5

Routers route packets between networks. Routers could have all LAN connections, all WAN connections, or some combination. It doesn't matter, each router interface needs an address in the network connected to that interface. Because routers route packets between networks, each router interface is in a different network.

The terms "WAN" (Wide Area Network) and "LAN" (Local Area Network) are somewhat subjective. It is generally accepted that a WAN connection is a connection to a network at a remote site, while a LAN connection is a connection to a network at the local site (perhaps one or a few close buildings). There are also other network terms tossed around: CAN (Campus Area Network), MAN (Metropolitan Area Network), etc.

A router really has no idea about these terms; it simply knows that is has multiple networks attached to its various interfaces, and it will route packets received on an interface to a different interface towards the destination address in the packet header. WAN and LAN play no part in a router decision. The routing decision is made based on the packet destination address and the routing table.


What is a WAN Address?

It is a layer-3 network address, just like a LAN address is.

How can I distinguish between a WAN and LAN address?

There is nothing in IP (either IPv4 or IPv6) that distinguishes between WAN and LAN, so there is no difference between LAN and WAN addresses. IANA maintains the IANA IPv4 Special-Purpose Address Registry and the IANA IPv6 Special-Purpose Address Registry. They classify IP addresses in multiple ways (Source, Destination, Forwardable, Globally Reachable, Reserved-by-Protocol), but there is no distinction for WAN and LAN.

How does the whole WAN addressing work? (I imagined a WAN address is the address of a router and the router somewhat forwards a package to my LAN IP)

It works the same way as any other IP addressing. See the How do you calculate the prefix, network, subnet, and host numbers? question for how to do IPv4 addressing.

0

What is a WAN Address? How can I distinguish between a WAN and LAN address?

So in a IPv4 world a WAN address should be an address not in RFC1918 by the IETF. That means roughly speaking any address not in the range 10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16 and of course some others, like the loopback subnet or the unassigned/ reserved space above 240.0.0.0/4. @Ron-Maupin has presented some helpful links on this. UPDATE: @Ron-Maupin correctly points out, WAN is actually just a description of breadth of the network in the physical sense. Logically a WAN and LAN don't have to be any different. I would say, WAN is usually the upstream link to another administrative domain or a different network, but that doesn't have to be true. Actually, I haven't found the original author or source of the distinction between LAN, MAN, WAN and what not.

Actually, e.g. in Linux, routing is prevented by default (rp_filter setting, ip_forwarding=0) between "private" (Your LAN) addresses to prevent some bad behaviour by mistake. Generally, how You treat You addresses is up to You and in some cases the ISPs or other networks, You connect to.

How does the whole WAN addressing work?

First of all, the addresses are syntactically the same, we may assign them a different meaning.

So You might ask, how do other networks (or LANs) know, how to reach the other networks? Well, they could phone each other or write a letter and determine, who has what addresses. That is how the internet basically worked at the beginning and how some networks communicate with their provider (ISP). Some very important configurations in the internet are probably done in a similar way too. Most networks actually communicate this information by using a dynamic routing protocol. For participation, You apply at IANA or Your RIR for an Autonomous System Number. To obtain one, You have to give at least two other ASNs - Your upstream (WAN) connections. This is to prevent a split of the network, if one connection has a problem. After You have paid Your membership fee (which is about 2000 € for the first year here in Europe), You will get an ASN assigned, You will also very likely get some public IP addresses, so You can actually connect to the other networks so You can setup the connection over which the dynamic protocol (BGPv4) works. How this gets configured can be seen in a video (Keith Barker explains stuff in a simple enough way).

What they don't tell You so much is, in Your test lab, You can use any number or address You want. It should work all the same - just be so kind and don't connect it to the internet until You follow the standards. Actually, Keith Barker uses public IPs, such as 1.1.1.1 and 2.2.2.2 often in his videos, because they are simple.

Well, in IPv6 there are no private IPs, but IPs with special use too. Keith Barker has good videos on how IPv6 works.

I am a hands on guy, I need to see it work to really understand -> Read on

All of this, You can actually try out with free software on one computer at home. For that, I would recommend You get comfortable with GNU/ Linux, such as the Ubuntu 18.04 LTS, which has great support for network namespaces (by David Mahler) that can be used to simulate many computers on one machine in a fast and efficient way. For BGP you can use the BIRD routing daemon. David Bombal has some good training videos on networking also.

So in general, the addressing is more or less same and You don't need special equipment to be able to really participate on the internet. What You need is the knowledge, the AS number and the related money and work. That is it, no black magic!

8
  • 1
    "So in a IPv4 world a WAN address should be an address not in RFC1918 by the IETF." That is not necessarily true. We have thousands of sites that use RFC 1918 addresses for the WAN addresses. To IP itself, and to a router, there is no such thing as a private or public addressing. IP addresses are IP addresses. The only distinction is that the ISPs have agreed to not route RFC 1918 addressing on the public Internet. Not all WAN interfaces connect to the public Internet, and not all LAN addresses are RFC 1918 Private addresses.
    – Ron Maupin
    Commented Aug 9, 2018 at 1:17
  • In fact, if you look at the IANA IPv4 Special-Purpose Address Registry, the RFC 1918 address ranges are not Reserved-by-Protocol, "indicating whether the special-purpose address block is reserved by IP, itself." Your answer is actually very misleading, and it only considers one case where the LAN uses private addressing and needs to connect to the public Internet. What about a business that has all public addressing?
    – Ron Maupin
    Commented Aug 9, 2018 at 1:20
  • I know all this. I tried to somehow connect to Leslies vocabulary to bridge the void... Running firewalls and routers is my daily bread. Actually, it is a bad habit, that the ISPs and companies connect over private IP space in some regard. That makes it likely, somebody will use the 10.0.0.1 somewhere again and You get a conflict. That is what You get, when there is a shortage :-(
    – AdamKalisz
    Commented Aug 9, 2018 at 1:26
  • You missed my point We have over 10,000 sites, from very small, to very large. They use ISP MPLS clouds to connect to each other, and all the WAN addressing at each site is RFC 1918 addressing. This has nothing to do with the (off-topic here) residential addressing that the ISPs are forcing on home users.
    – Ron Maupin
    Commented Aug 9, 2018 at 1:29
  • 1
    The commonly accepted definition of a WAN is a network that spans a large geographical distance. You may want to point out in your answer that your definition of WAN is something different than the common definitions you will find by searching on the term. Besides, the carrier MPLS clouds are outside our administrative control, which ends at the carrier PoP.
    – Ron Maupin
    Commented Aug 9, 2018 at 1:52

Not the answer you're looking for? Browse other questions tagged or ask your own question.