Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

This is part of a question from a networking class.

A router has IP on the local network eth0), and uses IP address 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 and

I have a few questions about this setup:

  1. Since the router has an external address of, does that mean the ISP's gateway also takes an address in the 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.

share|improve this question

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 ( 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).

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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