Can I make a route to a class B instead of the actual bunch of class Cs?

Posted on 2007-11-20
Medium Priority
Last Modified: 2013-12-23
I have a RHEL5 server that needs static routes to a bunch of class C subnets (192.168.*.0).  Right now I am using this:

route add -net netmask gw
route add -net netmask gw
route add -net netmask gw
route add -net netmask gw
route add -net netmask gw
route add -net netmask gw
route add -net netmask gw
route add -net netmask gw
route add -net netmask gw
route add -net netmask gw

...but I was wondering, can I just use this?:
route add -net netmask gw

I know the broadcast and network addresses will be different if I treat it like a Class B, but for the sake of routing, will it even make a difference?  As far as I can tell, the route should lead me to the same gateway, and once I'm there I should be good, right?

Question by:kamermans

Accepted Solution

Spot_The_Cat earned 2000 total points
ID: 20319144
Yes you can but keep it in mind that some routers do not like supernetting addresses so if you introduce a hardware router to take care of this in the future then it may well complain and you may need to revert to the mask. You could route based on this though:

route add -net netmask gw

Which would limit the route to 192.168.0.x to 192.168.15.x

Hope that helps.
LVL 13

Author Closing Comment

ID: 31410096
Works like a charm - thanks Spot!

Featured Post

Train for your Pen Testing Engineer Certification

Enroll today in this bundle of courses to gain experience in the logistics of pen testing, Linux fundamentals, vulnerability assessments, detecting live systems, and more! This series, valued at $3,000, is free for Premium members, Team Accounts, and Qualified Experts.

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.

Join & Write a Comment

Unable to change the program that handles the scan event from a network attached Canon/Brother printer/scanner. This means you'll always have to choose which program handles this action, e.g. ControlCenter4 (in the case of a Brother).
How to fix a SonicWall Gateway Anti-Virus firewall blocking automatic updates to apps like Windows, Adobe, Symantec, etc.
After creating this article (http://www.experts-exchange.com/articles/23699/Setup-Mikrotik-routers-with-OSPF.html), I decided to make a video (no audio) to show you how to configure the routers and run some trace routes and pings between the 7 sites…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

607 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question