Solved

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

Posted on 2007-11-20
2
281 Views
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 192.168.1.0 netmask 255.255.255.0 gw 172.16.20.1
route add -net 192.168.2.0 netmask 255.255.255.0 gw 172.16.20.1
route add -net 192.168.3.0 netmask 255.255.255.0 gw 172.16.20.1
route add -net 192.168.4.0 netmask 255.255.255.0 gw 172.16.20.1
route add -net 192.168.5.0 netmask 255.255.255.0 gw 172.16.20.1
route add -net 192.168.6.0 netmask 255.255.255.0 gw 172.16.20.1
route add -net 192.168.7.0 netmask 255.255.255.0 gw 172.16.20.1
route add -net 192.168.8.0 netmask 255.255.255.0 gw 172.16.20.1
route add -net 192.168.9.0 netmask 255.255.255.0 gw 172.16.20.1
route add -net 192.168.10.0 netmask 255.255.255.0 gw 172.16.20.1

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

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?

Thanks!
0
Comment
Question by:kamermans
2 Comments
 
LVL 6

Accepted Solution

by:
Spot_The_Cat earned 500 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 255.255.255.0 mask. You could route based on this though:

route add -net 192.168.0.0 netmask 255.255.240.0 gw 172.16.20.1

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

Hope that helps.
0
 
LVL 13

Author Closing Comment

by:kamermans
ID: 31410096
Works like a charm - thanks Spot!
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Don’t let your business fall victim to the coming apocalypse – use our Survival Guide for the Fax Apocalypse to identify the risks and signs of zombie fax activities at your business.
PRTG Network Monitor lets you monitor your bandwidth usage, so you know who is using up your bandwidth, and what they're using it for.
Viewers will learn how to connect to a wireless network using the network security key. They will also learn how to access the IP address and DNS server for connections that must be done manually. After setting up a router, find the network security…
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…

807 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