cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
3347
Views
0
Helpful
10
Replies

Subnet Mask

wrwiii122
Level 1
Level 1

If I have an IP of 10.102.1.1 with a mask of 255.255.0.0, can another machine exist with the same ip but a mask of 255.0.0.0 and will they talk? How about with a router? Can one side(serial) be the first ip and mask and the ethernet side be the other?

10 Replies 10

gpulos
Level 8
Level 8

technically, yes, another machine can exist with 10.102.1.1 255.0.0.0. (this is not recommended as you still have other addressing issues with this scenario that will prevent communication)

no, they wont be able to talk to each other without a router to perform routing between the subnets.

no, you cannot have 10.102.1.1 255.255.0.0 on your serial interface and then 10.102.1.1 255.0.0.0 on your ethernet interface.

(technically the 10.102.0.0 255.255.0.0 is part of the 10.0.0.0 255.0.0.0 network and you cannot assign the same subnet to two different routed interfaces. you could create a bridgeGroup between the interfaces but you stil would have a subnetMask/broadcast domain problem)

see this link for ip addressing & subnetting:

http://www.cisco.com/en/US/tech/tk365/technologies_tech_note09186a00800a67f5.shtml

a better solution for your serial and ethernet interfaces is as follows:

serial 0/0 - 10.102.1.1 255.255.0.0

ethernet 1/0 - 10.103.1.1 255.255.0.0

(although this would work for your router, i would recommend using some IP Addressing tips to keep your broadcast domains only as big as the number of hosts they need to support)

ie:

serial 0/0 - 10.102.1.1 255.255.255.0

ethernet 0/0 10.103.1.1 255.255.255.0

(this provides two subnets with 254 hosts each versus the previous example which provides two subnets with 16382 hosts each)

Hi,

It doesn't matter what subnet mask you are using the IP address has to be unique for each device. Not only they will not talk to each other this configuration is considered illegal.

HTH,

Sundar

Hi,

I am afraid I have to disagree with the posting by the fellow Netpro regarding his statement that you could have 2 devices configured with the same IP but it could create problems. While the second part of his statement is true the first part of you could have 2 hosts configured with the same address will virtually be of no use unless you can make sure the host will have uninterrupted access to the network resources. I have seen some rare situations that might warrant using the same IP on two devices but that was more for backup reasons and not meant to function simulatenously.

Hope that helps!

Regards,

Sundar

Ok we are getting somewhere. I have read the CCNA books over and over and just cant get to the reason for subnetting. I understand its to break down the IPs to a better network to host ratio. But it just doesn't make any sense if you can't use the same IP over and over with different masks. If you can give me a refrence to explain this a little better it would be appreciated.

William

I can not give you a reference right now, but I can give you an example which I think will make sense.

I am not clear whether your difficulty is really just understanding the reasons for subnetting as you seem to say or whether it is difficulty in understanding subnetting with different masks. So I will give examples which will explain both.

First: why subnet. Lets assume that you have a router and have been assigned network 150.150.0.0. So you configure interface fastethernet0/0 with ip address 150.150.0.1 255.255.0.0. So far so good (it is a class B network with a class B mask - no subnets). The network on interface fastethernet 0/0 has enough address space to accomodate 65,000 addresses (roughly). But your router also has interface fastethernet0/1. What will you do with that interface. You have used 150.150.0.0 already so do you need a different network for the other interface?

That example may be a little silly but it does illustrate a couple of important things. The network by itself without subnetting is so large that it is not useful. We use subnetting to break the network down into useable sizes. So we can subnet and put 150.150..0.1 255.255.255.0 on fastethernet 0/0 and can put 150.150.1.1 255.255.255.0 on fastethernet 0/1. Now we have used our network more efficiently and subdivided it into more useable size parts. That is the essence of subnetting.

So hopefully that clears up why we should subnet. Now lets look at why we subnet with different size masks. On the router we have got with 150.150.0.1 on fastethernet 0/0 and 150.150.1.1 on fastethernet 0/1 lets assume that we have a serial interface. What shall we do with addressing on the serial interface? If we use the same mask we can put address 150.150.2.1 on the serial. But if we use the same mask of 255.255.255.0 on the serial then the subnet on the serial is big enough to have 254 addresses. How many addresses can you realistically use on a serial link? So we might want to subnet on the LAN interfaces with mask 255.255.255.0 because that number of hosts is useful on LAN interfaces. But on serial interfaces we might want to use 255.255.255.252 (because it wasts fewer addresses).

I hope that helps. If you still have questions then please ask some more questions.

HTH

Rick

HTH

Rick

First, keep in mind that using Network Address Translation (NAT) you can re-use addresses, as demonstrated with the countless 10.x.x.x and 192.168.x.x network in-use today.

We're not going to talk about that.

Perhaps some discussion on the mask may help, don't focus so much on the address for now.

I'm sure you've read by now that the mask defines which part of the address is "network" and which part defines "hosts."

When describing the "networks," according to the mask as represented by the binary version of the value, each bit of the (binary representation) of the IP address that has a corresponding mask bit set to a "1" is considered the network portion of the address ... nothing new here, right?

When a device gets information coming down the (OSI model) stack, it looks at the destination IP address, and compares it to the mask defined for the egress interface.

If the destination address matches the network portion of the device's IP address, the device decides that the traffic is destined for a "local" host (same segment / broadcast domain as the transmitting device).

If the destination address doesn't match the device's network address (according to the mask), the device decides that the destination address is not local, so the traffic should be packaged in a layer two frame and sent to the Default Gateway (also called "Gateway of Last Resort" for Cisco routers / L3 devices).

The point, at this point, is to recognize that the mask is critical for the device to make the "local" / "not local" decision as to where it should send the frame (direct to the destination host or the Default Gateway, which should will forward the packet to the next network segment).

Using the same "host" IP address with two different masks means a couple things can happen:

1) Both addresses can point to a host

2) Both addresses could point to a "network address"

3) One address will be a host address and the other will be a network address.

In item 2 and item 3, the packet will not be forwarded properly (if at all - "Invalid IP address"), because a device cannot send a unicast (one source, one destination) to a network address.

In item 1, you will successfully get bidirectional communication ... but only for the range of addresses contained in the address with the longest network mask. Once the host number increments above the mask into the network portion, that device/host will think the address belongs to a different network and send the traffic to the Default Gateway (who will throw it away or forward it to the next hop ... depending on the mask for that interface of the Default Gateway).

Anything you may have read referring to route aggregation or "supernetting" only refers to network addresses, not host addresses.

It is possible (in fact, desirable)to use a single NETWORK address to represent a group of network addresses handled by a given router/Layer 3 device ... but there is no way, using unicast, to accurately define a complete block of hosts using more than one mask for a given segment; the device with the longest mask will define the size of the host address block that will work successfully for the segment.

NAT works because some gateway device has a map of inbound / outbound addresses to corelate ... there is no NAT on a single segment.

As for reading, here's a link to Cisco's INternetworking Guide online. It's a very good reference for dscribing the various technologies and protocols.

http://www.cisco.com/univercd/cc/td/doc/cisintwk/ito_doc/index.htm

Good Luck

Scott

Ok it makes sense now about the reason for subnetting and saving addresses. Now, so you use 10.10.10.x 255.255.255.252 on a serial interface does that mean you could use 10.10.10.x 255.255.255.0 on the ethernet interface?

Senerio 2

Kind of the same question as about but with more detail. Could this be done?

R1 = 10.102.3.x 255.255.255.0(eth0)->10.102.3.1 255.255.255.252(s0/0)

R2 = 10.102.3.2 255.255.255.252(s0/0)->10.102.32.x 255.255.0.0(eth0)

From your post:

>>>>>>>>>

R1 = 10.102.3.x 255.255.255.0(eth0)->10.102.3.1 255.255.255.252(s0/0)

R2 = 10.102.3.2 255.255.255.252(s0/0)->10.102.32.x 255.255.0.0(eth0)

>>>>>>>>>>>>>>>>>>>>>>>>>>

This is an invalid network layout.

You are overlapping addresses on R1

Ideally it should be

R1 = 10.102.31.x 255.255.255.0(eth0)->10.102.3.1 255.255.255.252(s0/0)

R2 = 10.102.3.2 255.255.255.252(s0/0)->10.102.32.x 255.255.0.0(eth0)

Note. R1 internet segment is now using 10.102.31.x /24

rameshwarhiwale
Level 1
Level 1

Just go through the rules of VLSM

Ok it makes sense now about the reason for subnetting and saving addresses. Now, so you use 10.10.10.x 255.255.255.252 on a serial interface does that mean you could use 10.10.10.x 255.255.255.0 on the ethernet interface?

Senerio 2

Kind of the same question as about but with more detail. Could this be done?

R1 = 10.102.3.x 255.255.255.0(eth0)->10.102.3.1 255.255.255.252(s0/0)

R2 = 10.102.3.2 255.255.255.252(s0/0)->10.102.32.x 255.255.0.0(eth0)

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community:

Review Cisco Networking products for a $25 gift card