Actually I'm doing an online course and in the Address Resolution Protocol video lecture, this statement is made in the following context. enter image description here enter image description here

And here's what the instructor says:

It needs to because of the concept of a netmask. For example, look at this hypothetical setup. The gateway, in the middle, has a single IP address: It has two network cards, one connecting it to the destination, one connecting it to the source, The address can really only be in one of these networks, the source network. The netmask needed for to be in the same network as is, or just one bit of netmask! But it can’t be that all IP addresses whose first bit is 1 are in the same network as --, for example, needs to be reached through the gateway. So instead we often see setups like this, where the gateway or router has multiple interfaces, each with their own link layer address to identify the card, and also each with their own network layer address to identify the host within the network that card is part of. For the gateway, the left interface has IP address, while the right interface has IP address

I specially don't understand the bold statements. Why can't be in both networks?

  • That is one of the more convoluted explanations I've seen in a while. Part of the confusion is that he is using "network" to refer to two different things: an IP subnet and a physical medium, I think you need to back up and fully understand IP addressing and the role the netmask plays. Then the answer will be much clearer.
    – Ron Trunk
    Commented Jul 19, 2015 at 17:25
  • yes, it's enough of a dupe. Understanding prefixes/network numbers is the key to answreing this Q. Commented Jul 20, 2015 at 15:10
  • Thanks a lot guys! The answer you linked to indeed cleared the confusion completely. Commented Jul 22, 2015 at 15:11

3 Answers 3


For my explanation lets assume the mask on both subnet's is /24

On any single subnet, all the hosts (including the gateway) must have the same network portion (as defined by the mask), else they are not on the same subnet.

  • net1: range of ip's - in subnet.
  • net2: range of ip's -

Thus if a GW/Router has interfaces in different subnet's it needs a IP on each interface that is from that subnet, to allow it to talk to the hosts in the subnet.

In your example, if the Gateway only had ip it would not be able to talk to directly, as would refuse to send packets to a ip not on its subnet, and rather forward them to it's configured gw(who has to be in the subnet)


Each port of router MUST BE connected to a different network. If we connect the ports of the router to the same network, then the router will discard any incoming packets.

So if we assume a mask of 24, then the left side is in the network and the right side is in the network So if you try to configure for the right network, then you are connecting both ports of the router to the same network, which you must not.


Okay so lets start off with what a Network mask is.

Most people are familiar with or sometimes we see, now the network mask you typically see for this is

Evert time you see a 255, that part of the Ip/address is part of the "network" address. Every time you see a 0. That part is part of the "host" address.

so for with a net mask of the network part is 192.168.0 (and we would actually say the network is and the host part is just .1 if we compare this to we look at the network part and we see that they are in 2 different networks

for with a netmask of (also called /24 and ill get to that) the network part is 171.43.22 (remember that network is and the host part is .8

Now because the netmask is /24 ( only the last part can be used for host, .1-.254 (.255 is your broadcast address)

Now what if the mask changes? or /16 ? well lets look again.

192.168 is now network and the rest will point to host. so and are now in the same network.

so what's all the /16 and /24? it's just another way to express the netmask. Each 255 in binary is 8 bit's of all 11111111's so if I say a netmask of /8 it means and /16 and /24

Now this was just a primer, lots more to learn about netmask and how to apply them using ACL's and stuff's.

So now you can answer your own question =)

Each NIC can only be in one network. And since has a gateway of we know the netmask to be /24. If you apply the /24 to it's easy to see they are not in the same network and will need a router to route the packets for them from network to network.

Good Luck with your studies =)

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