1753359 Members
6543 Online
108792 Solutions
New Discussion юеВ

Creating routes

 
Maarten van Maanen
Regular Advisor

Creating routes

I seem to be unable to create a route using a non-standard gateway (router) to a remote network using the route command.

Default gateway of HP9000 is 132.147.160.178
Router to be used is 132.147.3.68
Network to be reached: 10.109.x.x

I have performed the following command:
route add net 10.109 132.147.3.68 1

The result in Netstat is as follows:
10.0.0.0 132.147.3.68 UG 0 0 lan3 1500

What I don't understand is why the 10.109 is translated into 10.0.0.0
Also, when the system is rebooted, the route has to be recreated manually.

I'm obviously doing something wrong hear.

Maarten van Maanen
Netherlands

4 REPLIES 4
Andreas Voss
Honored Contributor

Re: Creating routes

Hi,

for your second question:
To add a route permanently edit the /etc/rc.config.d/netconf:
ROUTE_DESTINATION[1]="net 10.109.0.0"
ROUTE_MASK[1]=""
ROUTE_GATEWAY[1]="132.147.3.68"
ROUTE_COUNT[1]="1"
ROUTE_ARGS[1]=""

Note: Im my example the routing is indexed with 1, you have to look if you must choose i higher index if you have already routes in there.

Regards

Andrew
Ruediger Noack
Valued Contributor

Re: Creating routes

Hi Maarten,

try
route add net 10.109 netmask 255.255.0.0 132.147.3.68 1

Good luck

Ruediger
Alan Riggs
Honored Contributor

Re: Creating routes

Andreas is correct about adding the route to the configuration file for automatic creation at boot time. The dynamic command I would try is:

route add net 10.109.0.0 netmask 255.255.0.0 132.147.3.68 1
Jason Luginbuhl
Frequent Advisor

Re: Creating routes

The reason that your 10.109 network is being converted to 10.0.0.0 in your routing table is actually quite simple. The 10 network (being a number lower than 128) is defaulted to a class A network and thus only the first octet (10) defines the entire network. If you want to define 10.109 as a class B style network then you need to tell the system this via the netmask of 255.255.0.0 as the others have mentioned. Otherwise the system will assume the Class A netmask of 255.0.0.0 and your routing table will look like 10.0.0.0.

The net result of using the 10.0.0.0 in your routing table will not be a problem as long as every 10 network/subnet that this system will need to reach will go thru the same router/gateway.
"Unfortunately you can't out-program stupidity"