Link to home
Start Free TrialLog in
Avatar of kamermans
kamermans

asked on

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

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!
ASKER CERTIFIED SOLUTION
Avatar of Spot_The_Cat
Spot_The_Cat
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of kamermans
kamermans

ASKER

Works like a charm - thanks Spot!