subnetting problem will this work?

Will this work guys?
i need 2 networks with 1 ip range for my exam tomorrow.

so i had this in thought; i only need 20 hosts but i want to have some spare adresses
network 0
network 1 or does this need to be different?
klaas vaakAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

i need 2 networks with 1 ip range for my exam tomorrow.
What exactly do you mean by this?

The two networks you have are certainly OK, but it depends on exactly what you want to accomplish.
klaas vaakAuthor Commented:
2 seperated networks using the same ip. so with or is this not possible.
Hi Klaas,

I'm not entirely sure what the requirement actually is, but if you mean two subnets with no overlap, but with no 'gap' between the two, then what you have set out does achieve that.

Your second subnet ( / 25) is not a 'standard' subnet, but mathematically it works.  If you are setting this up on hardware for real, it will depend on whether the router or whatever device(s) are involved will accept that subnet or not (some cheap routers only allow a few predefined subnets).

Again, not sure what you mean exactly, but the two combined subnets are also equal to this one: /

or if you prefer: / 24

Hope that helps,

Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

2 seperated networks using the same ip. so with or is this not possible.
This is the portion that's not quite clear.

If by "same ip" you mean 192.168.10.x range, then yes, what you're doing is fine. You could've made the networks even smaller had you wanted to by adding additional bits to the subnet mask.

You proposed subnet mask. You actually could've gone as far as subnet mask and still had enough hosts.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
klaas vaakAuthor Commented:
okay so i won't need to use any vlans whatsoever. when i have gigabitethernet 0/1 with with and i have gigabitethernet 0/2 with also using

Also is it better to use vlans for this?
Hi Klaas,

It is not clear what your objective is here.

I had thought from your initial question, this was an exam setup / question?

No, you wouldn't *have* to use VLANs.

VLANs would work, but whether they're better depends on the use case (like device locations and so on).
klaas vaakAuthor Commented:
Okee the VLAN are clear now. To clear things up i have the office and the warehouse. they want the networks to be seperated but i only have 1 router.

so i thought about this : network 0
                                            network 1
The only doubts i have is about the subnet using the 255.128.
i recreated this situation in packet tracer and it worked. but I still have my doubts about it
As others have suggested, what you have specified will give you two different subnets.  In addition to the concern about whether or not a /25 net mask will be allowed in your router, there is also concern about whether or not your router allows two different LAN IP addresses.  Lastly, be sure to configure the routing so that you either keep the two subnets isolated or to allow communication between them.
Jose Gabriel Ortega CastroCEOCommented:
Applying Cisco Logic, for 20 host.

2^n-2 > #host    
for n=0 and #host=20
2^0 -2 > 20
1-2 > 20  
-1 > 20 (doens't comply), then increase n in 1.

for n=1 and #host=20
2^1-2 > 20
2-2 > 20
0 > 0   (doesn't c omply), then increase n in 1

for n=2 and #host =20;
2^2-2 > 20
4-2 > 20
2 > 20 (doesn't comply), then increase n in 1

for n=3 and #host =20;
2^3 - 2  > 20
8-2 > 20
6 > 20 (doesn't comply then increase n in 1)

for n=4 and #host =20;
2^4-2 > 20
16-2 >20
14 > 20  (doesn't comply then increase n in 1)

n=5 and #host =20;
2^5-2 > 20
32-2 > 20 (it complies, then you need 5 bits for hosts)

Now you need to apply a similar equation  to the number of subnets that you want. (just remove the -2 on the left side, since you don't have to remove the Network and Broadcast Address).
If you just want 2 subnets then the formula would be
2^n  > 2, note that is "strict major than",  and this is true when n= 3 (8>=4), you can see the n=3 in the math above.

Then you need a total of 7 bits (5 from host) and (3 for subnets).

As you should know ipv4 it's the formation of 4 octets of bytes.
- - - - - - - - . - - - - - - - - . - - - - - - - - . - - - - - - - -

they are counted from right to left on each from 2^7 to 2^0  (in decimal: 128 64 32 16 8 4 2 1) and if you add them all, you got the famous in the submask.

Now we are going to take away the Host, and subnets bytes from RIGHT to LEFT. (remember 5 and 2 respectively) I'll mark them as H for host and S for subnets.

- - - - - - - - . - - - - - - - - . - - - - - - - - . S S S H H H H H

The remained "-"s will be the submask. So

You already get the basic Network mask that is: and the submask is /24
All the subneting.

As I stated above, there is nothing mathematically wrong with those subnets.

The only issue is whether any given router will be able to implement it.

Mitul PrajapatiIT SupervisorCommented:
your thought is absolute right but it will waste many IP addresses in real world. Instead of using, you can use which will give you 30 IP address in its range

For Example

Network 0 -31              (30 Host)
Network 1 -63            (30 Host)
Network 2 -95            (30 Host)
Network 3 -127         (30 Host)
Network 4 -159       (30 Host)
Network 5 -191       (30 Host)
Network 6 -223       (30 Host)
Network 7 -255       (30 Host)
Jose Gabriel Ortega CastroCEOCommented:
The networking you are proposing it's with a different submask, it's not what he wants he wants a single network (class C) with subnets within the same network, you are changing everything with the change of the submask.
Also you are giving him the "network lan address" as a host  from 0 to 31 are 32 addresses, not just 30, you need to remove the "lan address" and the "broadcast address"
Fred MarshallPrincipalCommented:
Your initial question suggests doing something that is "mathematically" correct.  There are two subnets that are contiguous and, yes, they use the same subnet mask because each one is the same size as the other: 128 addresses total with 126 hosts.

Here is a "thought experiment" (it is NOT a suggestion as you will see):
1) Set the router with 2 IP addresses on the same port or on separate ports even better: and and use subnet mask <<<<<<!!
These become the gateway addresses for two subnets but the router may treat it as one.
2) configure the hosts on each subnet like this:
IP address
IP address

Now, when a host launches a packet to any address in its subnet, it just goes out on the wire.
And, if it launches a packet that's not on its subnet, it goes to the gateway address of its own subnet.
When the packet arrives at the router, there is no network address in the packet and the router will treat the packet as either within it's own (larger) subnet and put it back on the wire or it will direct the traffic out the WAN or it will drop it altogether.

One problem I see with this is that is the broadcast address for the lower subnet but it's NOT the broadcast address for the router (which is  So that's likely going to be a problem with some protocols.

Your original question is ambiguous:
i need 2 networks with 1 ip range for my exam tomorrow
Just what does "network" mean in this context?
2 *wire* networks?
2 *network address ranges*?

You may wish to consider what is a "LAN" and what is a "subnet".  They are often used interchangeably because they coincide.  But that's not necessary.  

Think of a "LAN" as a collection of cables and (Level 2) switches - forget about IP addresses and subnets.  You can run multiple subnets (that don't overlap) on the same wires and switches.  So you could have 2 (or more) routers as gateways for their respective subnets while ALL on the same LAN (i.e. copper).  So here you have 2 (or more) subnets with ONE physical network, the LAN.

Think of a "VLAN" as a somewhat abstract version of the same thing.  Again, there is no necessity to connect it with a subnet address range at all!  That would be a true Virtual LAN.

Think of a "subnet" as an address space.  Most often, we use one subnet per LAN or VLAN.  But, as above, it's not necessary.

That's why this clarifying question about what is a "network" is important.

My guess is that you want one LAN with a split address space or, perhaps, 2 LANs each with their own address space.
You've not mentioned DHCP.  How do you envision that being implemented?
klaas vaakAuthor Commented:
Thanks!! everyone who assisted me. Everything is clear and i am confident that i passed my exam. There were multiple good answers but i can only select one as the best -_-
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.