0

This is part of a question from a networking class.

A router has IP 202.55.0.5 on the local network 202.55.0.0/21(through eth0), and uses IP address 202.55.0.6 to communicate with the internet through eth1.

And the question asks for how many addresses are available for hosts in this local network.

I know there are 32 bits in the address, where 21 bits are used to identify the network, leaving 32-21 = 11 bits available, which give 2^11 addresses.

Within this 2^11 addresses, all-one address and all-zero address are not allowed to be used. And the router uses 202.55.0.5 and 202.55.0.6.

I have a few questions about this setup:

  1. Since the router has an external address of 202.55.0.6, does that mean the ISP's gateway also takes an address in the 202.55.0.0/21 range?

  2. How do this router and the ISP's gateway setup their routing tables to allow this configuration?

Usually I only see that a router connects 2 different networks, and this one looks strange.

TheCleaner
  • 32,627
  • 26
  • 132
  • 191
Qi Fan
  • 350
  • 3
  • 12

1 Answers1

0

You are right on the 2^11 parts.

To answer your questions (in order):

A1) The router's LAN range and WAN/external IP assigned from the ISP are different. If what you are referring to here is what was assigned to you by the ISP (202.55.0.0/21 block), and the eth1 is the external interface on the router with an IP assigned on the ISP/WAN network, then yes the next-hop/gateway for the router to the ISP will be in this range (typically the first host address in the range). In the router you would configure (typically) the default route to have that IP as the gateway/next-hop. NOTE: it's very rare nowadays that an ISP would assign such a large ipv4 block to a customer.

A2) That's up to the routing protocol used (static, bgp). The ISP and the customer will work that info out ahead of time to determine which to use and then you would configure the CPE router accordingly while the ISP configures their side. (sometimes as well they might have a managed router at the customer location and that router has a single ethernet handoff with static routes to the CPE router/firewall/l3 switch).

TheCleaner
  • 32,627
  • 26
  • 132
  • 191