combine subnets to make a larger subnet

I want to take the subnet 192.168.26.0 and use the last 14 addresses for a new subnet (192.168.26.240/28)

This means breaking the entire subnet down into 16 smaller subnets.  Other than this one small subnet, I would like to keep the other addresses as one larger subnet.

Does anyone know how to do this?  What would the mask be?

RFExpertAsked:
Who is Participating?
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.

jabiiiCommented:
you can use 192.168.26.0/25 which is 1-126
26.128/26 = 129-190
192/26 = 193-222


there are plenty of combinations you can use.....
0
jabiiiCommented:
0
Danny_LaroucheCommented:
You mean using 192.168.26.0/24 and 192.168.26.240/28 at the same time?  

You can't have 2 overlaping subnet.

You may use  192.168.26.0/25 (as said jabill) and 192.168.26.240/28 together.
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

The--CaptainCommented:
>This means breaking the entire subnet down into 16 smaller subnets

No, it doesn't.

>you can use 192.168.26.0/25 which is 1-126

jabiii,
Why would you do this? - the need to break up the subnet into a bunch of pieces is based upon a flawed premise.

Breaking off a piece of a subnet is as simple as adding a route to the device that contains an interface (or another route) to the piece of the subnet in question.  IP routing works by choosing the most specific route first.  Therefor, if you have a route to a /24 (because it is directly connected), and a route to a /28 (the /28 being originally part of the /24) which is now somewhere else, when something tries to connect to the /28, the more specific route is used, and no conflicts arise.

Cheers,
-Jon
0
The--CaptainCommented:
>You can't have 2 overlaping subnet.

Half-true.  It's technically correct to say that the subnets do not overlap once you have correct routes in place, but your statement is quite misleading, and I'd say you yourself are using an incorrect interpretation.

Think about it for half a second.  Your ISP might have a /8 subnet.  How do they give you a smaller block (like a /28) without "overlapping"?  The answer is simple routing, as I already said.

jabiii and Danny are quite wrong, period.

Cheers,
-Jon


0
scrathcyboyCommented:
There is no logic in trying to divide a class C subnet.  That is what the net MASK is for, it lets you (i.e. the systems) see only ALL or part of the subnet.  IF the last digit of the mask is 0, it sees all, if it is 128, it sees half, and so on.  It goes against IP addressing to try to separate parts of a subnet, the mask is a filter, than that does exactly what you want to do.  Anything more/less will get you into trouble.  Use the MASK !!!!
0
Sam PanwarSr. Server AdministratorCommented:
Hi,

I think this is not possible.

subnet calculator

http://www.subnet-calculator.com/

This help for network
0
The--CaptainCommented:
No one here understands IP routing.  Am I going to have to go digging so I can smack everyone here with the RFC clue-by-four?

Sigh.  Do you think your ISP divides their /8 (or whatever they have) into a bunch of /30s (which can be handy for static point-to-point business connections) simply because they have a few customers who need this?  Of course not - that would waste %50 of their allocated space.  I notice no one is trying to argue logically with me, but rather just saying "Umm, uhhh, I think that this won't work for some vague reason that I cannot for some reason articulate".

There's a reason no one is articulating this reason - it doesn't exist!!!

>There is no logic in trying to divide a class C subnet.

Why the hell does it matter if it's class C?  By your reasoning, dividing any network block is illogical.  I guess we're just going to go ahead and bridge the entire entire internet, since you've thrown subnets and routing out the window...

>It goes against IP addressing to try to separate parts of a subnet, the mask is a filter, than that does exactly what you
>want to do

Exactly what, specifically, is "against IP addressing"?  I'd say it's exactly in line with IP addressing, and perhaps more importantly, IP routing.

Hands up all here who understand (and by understand, I mean have actually deployed) BGP.  If you understand BGP, you cannot be sane and still try to argue with me.  BGP routing tables contain numerous "overlapping" routes - BGP routers first choose the most specific route (as I mentioned previously), and then if two routes of the same specificity exist, it uses additional metrics from there.

>I think this is not possible.
Is that a guess, or can you back up that statement with some actual technical arguments?  (Yes, that was a rhetorical question).

RFExpert,
Do you understand my advice?  Do you require more clarification (if so, what?)

Cheers,
-Jon

0
The--CaptainCommented:
For all you unbelievers, I've got better than an RFC clue-by-four (since I'm sure there are no shortage of folks who would like to argue RFCs, I've got actual proof instead).

A narration of what you are seeing:

1. Let's turn on tcpdump to watch internal traffic on eth1
2. Let's show our ARP table so folks aren't confused about what machines are where
3. Prove we can ping a local machine at 192.168.20.15
4. Show initial routing table to unbelievers
5. Punch a /30 sized hole in our local subnet by routing a piece of it out our internet gateway.
6. Try to ping 192.168.20.15 again - it no longer works...  Where are those packets going?
7. Fire up tcpdump on our external interface eth0, and ping again...
8. Yup, the packets are now going out our external interface (as expected).
9. Since we can route our newly allocated /30 to an internet host, how about a local one?
10. Delete remote route, add local route, ping again...
11. Turn off tcpdump on the external interface so we can be sure we are only seeing internal packets
12. Yup, they're being delivered to the local network now
13. Is the reason I'm not getting a response from the 192.168.20.15 is because I'm trying to route it's /30 packets through another device?
14. Delete local route [unpunch the "hole"], check routing table, and try ping again...
15.  Indeed, everything I said is and has been quite correct.
16. Moral of the story - don't post guesses (unless you are prepared to admit that they are just that - guesses) as answers to questions at EE.  Rely on your own personal experience, or verifiable, repeatable proof (as I have done).  You will avoid looking very foolish when confronted by someone who actually has real knowledge of the subject.
17. If you want to be further humiliated, try arguing some more so I can add IP 192.168.20.15 as an alias to 192.168.20.254 and show you how I can route 4 IPs out of a /24 to a different device and it will respond to my pings (I can even put up a real machine with the IP 192.168.20.15 behind 192.168.20.254 and ping that too if you want to look really silly.)  Yeah, I know .15 is the broadcast IP of the block, but .15 is one of few static machines on my local net, and I'm not going to renumber - if I must prove my point even further, I will assign a static of .14 to my wife's laptop and use that as my test IP.

[root@hal root]# tcpdump -l -n -i eth1 'icmp' &
[1] 23868
[root@hal root]# tcpdump: listening on eth1

[root@hal root]# arp -an            
? (X.Y.166.10) at 00:0B:23:6A:7E:A9 [ether] on eth0
? (X.Y.166.8) at 00:0B:23:6A:7E:A9 [ether] on eth0
? (192.168.20.254) at 00:09:5B:45:C9:B1 [ether] on eth1
? (192.168.20.15) at 00:A0:CC:DA:93:F8 [ether] on eth1
[root@hal root]# ping 192.168.20.15  
PING 192.168.20.15 (192.168.20.15) from 192.168.20.1 : 56(84) bytes of data.
03:18:47.018570 192.168.20.1 > 192.168.20.15: icmp: echo request (DF)
03:18:47.019346 192.168.20.15 > 192.168.20.1: icmp: echo reply (DF)
64 bytes from 192.168.20.15: icmp_seq=1 ttl=255 time=0.856 ms
03:18:48.020105 192.168.20.1 > 192.168.20.15: icmp: echo request (DF)
03:18:48.020650 192.168.20.15 > 192.168.20.1: icmp: echo reply (DF)
64 bytes from 192.168.20.15: icmp_seq=2 ttl=255 time=0.600 ms
03:18:49.020083 192.168.20.1 > 192.168.20.15: icmp: echo request (DF)
03:18:49.020655 192.168.20.15 > 192.168.20.1: icmp: echo reply (DF)
64 bytes from 192.168.20.15: icmp_seq=3 ttl=255 time=0.604 ms
03:18:50.020110 192.168.20.1 > 192.168.20.15: icmp: echo request (DF)
03:18:50.020655 192.168.20.15 > 192.168.20.1: icmp: echo reply (DF)
64 bytes from 192.168.20.15: icmp_seq=4 ttl=255 time=0.601 ms

--- 192.168.20.15 ping statistics ---
4 packets transmitted, 4 received, 0% loss, time 3001ms
rtt min/avg/max/mdev = 0.600/0.665/0.856/0.111 ms
[root@hal root]# netstat -nr
Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
192.168.20.0    0.0.0.0         255.255.255.0   U        40 0          0 eth1
X.Y.166.0    0.0.0.0         255.255.255.0   U        40 0          0 eth0
5.0.0.0         0.0.0.0         255.0.0.0       U        40 0          0 ham0
127.0.0.0       0.0.0.0         255.0.0.0       U        40 0          0 lo
0.0.0.0         X.Y.166.10   0.0.0.0         UG       40 0          0 eth0
[root@hal root]# route add -net 192.168.20.12 netmask 255.255.255.252 gw X.Y.166.10
[root@hal root]# netstat -nr
Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
192.168.20.12   X.Y.166.10   255.255.255.252 UG       40 0          0 eth0
192.168.20.0    0.0.0.0         255.255.255.0   U        40 0          0 eth1
X.Y.166.0    0.0.0.0         255.255.255.0   U        40 0          0 eth0
5.0.0.0         0.0.0.0         255.0.0.0       U        40 0          0 ham0
127.0.0.0       0.0.0.0         255.0.0.0       U        40 0          0 lo
0.0.0.0         X.Y.166.10   0.0.0.0         UG       40 0          0 eth0
[root@hal root]# ping 192.168.20.15
PING 192.168.20.15 (192.168.20.15) from X.Y.166.9 : 56(84) bytes of data.

--- 192.168.20.15 ping statistics ---
7 packets transmitted, 0 received, 100% loss, time 6000ms

[root@hal root]# tcpdump -l -n -i eth0 'icmp' &
[2] 23876
[root@hal root]# tcpdump: listening on eth0
[root@hal root]#
[root@hal root]# ping 192.168.20.15
PING 192.168.20.15 (192.168.20.15) from X.Y.166.9 : 56(84) bytes of data.
03:21:12.276143 X.Y.166.9 > 192.168.20.15: icmp: echo request (DF)
03:21:13.275928 X.Y.166.9 > 192.168.20.15: icmp: echo request (DF)
03:21:14.275953 X.Y.166.9 > 192.168.20.15: icmp: echo request (DF)
03:21:15.275927 X.Y.166.9 > 192.168.20.15: icmp: echo request (DF)

--- 192.168.20.15 ping statistics ---
4 packets transmitted, 0 received, 100% loss, time 2999ms

[root@hal root]# route del -net 192.168.20.12 netmask 255.255.255.252 gw X.Y.166.10
[root@hal root]# route add -net 192.168.20.12 netmask 255.255.255.252 gw 192.168.20.254
[root@hal root]# netstat -nr
Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
192.168.20.12   192.168.20.254  255.255.255.252 UG       40 0          0 eth1
192.168.20.0    0.0.0.0         255.255.255.0   U        40 0          0 eth1
X.Y.166.0    0.0.0.0         255.255.255.0   U        40 0          0 eth0
5.0.0.0         0.0.0.0         255.0.0.0       U        40 0          0 ham0
127.0.0.0       0.0.0.0         255.0.0.0       U        40 0          0 lo
0.0.0.0         X.Y.166.10   0.0.0.0         UG       40 0          0 eth0
[root@hal root]# ping 192.168.20.15
PING 192.168.20.15 (192.168.20.15) from 192.168.20.1 : 56(84) bytes of data.
03:22:59.762176 192.168.20.1 > 192.168.20.15: icmp: echo request (DF)
03:23:00.762269 192.168.20.1 > 192.168.20.15: icmp: echo request (DF)
03:23:01.762279 192.168.20.1 > 192.168.20.15: icmp: echo request (DF)
03:23:02.762265 192.168.20.1 > 192.168.20.15: icmp: echo request (DF)

--- 192.168.20.15 ping statistics ---
4 packets transmitted, 0 received, 100% loss, time 3000ms

[root@hal root]# fg %2
tcpdump -l -n -i eth0 'icmp'
^C
51 packets received by filter
0 packets dropped by kernel
[root@hal root]# ping 192.168.20.15
PING 192.168.20.15 (192.168.20.15) from 192.168.20.1 : 56(84) bytes of data.
03:23:09.588065 192.168.20.1 > 192.168.20.15: icmp: echo request (DF)
03:23:10.600145 192.168.20.1 > 192.168.20.15: icmp: echo request (DF)
03:23:11.600165 192.168.20.1 > 192.168.20.15: icmp: echo request (DF)
03:23:12.600150 192.168.20.1 > 192.168.20.15: icmp: echo request (DF)

--- 192.168.20.15 ping statistics ---
4 packets transmitted, 0 received, 100% loss, time 3012ms

[root@hal root]# route del -net 192.168.20.12 netmask 255.255.255.252 gw 192.168.20.254
[root@hal root]# netstat -nr
Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
192.168.20.0    0.0.0.0         255.255.255.0   U        40 0          0 eth1
X.Y.166.0    0.0.0.0         255.255.255.0   U        40 0          0 eth0
5.0.0.0         0.0.0.0         255.0.0.0       U        40 0          0 ham0
127.0.0.0       0.0.0.0         255.0.0.0       U        40 0          0 lo
0.0.0.0         X.Y.166.10   0.0.0.0         UG       40 0          0 eth0
[root@hal root]# ping 192.168.20.15
PING 192.168.20.15 (192.168.20.15) from 192.168.20.1 : 56(84) bytes of data.
03:23:26.463247 192.168.20.1 > 192.168.20.15: icmp: echo request (DF)
03:23:27.463461 192.168.20.1 > 192.168.20.15: icmp: echo request (DF)
03:23:27.464116 192.168.20.15 > 192.168.20.1: icmp: echo reply (DF)
64 bytes from 192.168.20.15: icmp_seq=2 ttl=255 time=0.701 ms
03:23:28.463439 192.168.20.1 > 192.168.20.15: icmp: echo request (DF)
03:23:28.463941 192.168.20.15 > 192.168.20.1: icmp: echo reply (DF)
64 bytes from 192.168.20.15: icmp_seq=3 ttl=255 time=0.529 ms
03:23:29.463460 192.168.20.1 > 192.168.20.15: icmp: echo request (DF)
03:23:29.463995 192.168.20.15 > 192.168.20.1: icmp: echo reply (DF)
64 bytes from 192.168.20.15: icmp_seq=4 ttl=255 time=0.580 ms
03:23:30.463433 192.168.20.1 > 192.168.20.15: icmp: echo request (DF)
03:23:30.464000 192.168.20.15 > 192.168.20.1: icmp: echo reply (DF)
64 bytes from 192.168.20.15: icmp_seq=5 ttl=255 time=0.588 ms

--- 192.168.20.15 ping statistics ---
5 packets transmitted, 4 received, 20% loss, time 4000ms
rtt min/avg/max/mdev = 0.529/0.599/0.701/0.067 ms

[root@hal root]#


0

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
RFExpertAuthor Commented:
I agree.  I knew I could use the 192.168.26.0/25  and get the first 126 addresses.

I am using 192.168.26.240/28 for a small subnet.   I was hoping to be able to find a msk that would cover the remaining addresses.



I was just wondering if there was a mask (that I had missed) that would cover from 192.168.26.1 thru 192.168.26.238 while using the .0 as the network address and the .239 as the broadcast address?

0
jabiiiCommented:
Jon, Nice rambling :)

>jabiii,
>Why would you do this? - the need to break up the subnet into a bunch of pieces is based upon a flawed premise

Simple because that's what he asked for. I didn't say I agreed with the logic it or that the logic was right, but that's what the question was, and I answered it accordingly.

>jabiii and Danny are quite wrong, period.
My posts are actually quite correct thank you. The question was can you subnet this. Answer yes. Here are some examples. All valid subnets.
>you can use 192.168.26.0/25 which is 1-126
>26.128/26 = 129-190
>192/26 = 193-222

On a side note... nobody said this post was about routing, except you. The question wasn't how do I route or can routing be handled, it was can I subnet this, and how.

Tx,

Jim
0
RFExpertAuthor Commented:
I would do this because I have a vlan that only needs a few IP addresses.  We are part of a Corporate Network and I am limited on my address ranges so I must conserve even my private addresses.  If I can use a block of 16 addresses for one area, and then use the rest for a different area that does not need all 254 addresses, then I can have more subnets.
0
The--CaptainCommented:
Your current mask remains the same, you simply create a new subnet with a smaller mask, and everything works if your routes are configured accordingly.

Thanks for the affirmation.

Cheers,
-Jon
0
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
Networking

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.