Operating System - HP-UX
1837751 Members
3191 Online
110118 Solutions
New Discussion

Re: unable to add route to server

 
SOLVED
Go to solution
Brent W. Moll
Advisor

unable to add route to server

Have been asked by network engineer to add route to server using the following parameters:

route add 10.5.192.0 netmask 255.255.192.0 172.31.14.1 1

Recieving error saying netmask: bad value.

I'm not familiar with netmasks. can someone tell me what I'm not doing right ?
8 REPLIES 8
Volker Borowski
Honored Contributor
Solution

Re: unable to add route to server

Hello
shouldn't it be

route add -net .......

Volker
Jeff Schussele
Honored Contributor

Re: unable to add route to server

Hi Brent,

Well for one thing you're routing to a Class-A network 10.5.192 but using a Class-C netmask.

I think that route statement should look soemthing like:

route add net 10.5.192 netmask 255.0.0.0 172.31.14.1 1

But the netmask really depends on how they have the 10.5.192 network subnetted.
You should always use either "net" or "host" in the statement when routing to a subnet or a particular host respectively to to be explicit.

HTH,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
Donny Jekels
Respected Contributor

Re: unable to add route to server

send me a copy of your routing table.

netstat -nr

lanscan

and a ifconfig of all your nics

for x in 0 1 2 3
do
ifconfig lan$x
done

attach the output to your next reply.

thanks
Donny
"Vision, is the art of seeing the invisible"
Brent W. Moll
Advisor

Re: unable to add route to server

output attached as a .txt file

Thank you all for your assistance :)
doug mielke
Respected Contributor

Re: unable to add route to server

the only real requirement for netmask regardless of class is that it needs to be a number that converts to a binary string of all 11111s followed by all 0000s.

So, 255.255.192.0 is a valid netmask
11111111.11111111.11000000.00000000

Look for a space in your command.This should be a valid netmask.
doug mielke
Respected Contributor

Re: unable to add route to server

...valid netmask, but it doesn't match any of your existing ones. This should still be okay, but is it really what the network folks want?

You could also try the hex equiv. command

route add 10.5.192.0 netmask 0xffffc000 172.31.14.1 1
Brent W. Moll
Advisor

Re: unable to add route to server

needed to add the 'route add net'

thank you all for your assistance :)
Ron Kinner
Honored Contributor

Re: unable to add route to server

You are not doing anything wrong but HPUX is trying to enforce an obsolete RFP which says that when breaking a network down into the smaller subnets you should not use the first or last subnet. 255.255.192 means you have four subnets: 0-63, 64-127, 128-191, 192-255. By the old RFP the first (0-63 and last 192-255) are illegal and thus you get the nasty message since you are trying to use the last one. You can turn it off in ndd.

ndd -set /dev/ip ip_check_subnet_addr 0

It should now let you put in your route.

You should also kill it in /etc/rc.config.d/nddconf with

TRANSPORT_NAME[0]=ip
NDD_NAME[0]= ip_check_subnet_addr
NDD_VALUE[0]= 0

(Use the next higher integer in the brackets if you already have an entry in nddconf) If you don't you will lose it at the next reboot.

Your new route should also be entered in /etc/rc.config.d/netconf so that it remains after the next reboot.

ROUTE_DESTINATION[2]="10.5.192.0"
ROUTE_MASK[2]="255.255.192.0"
ROUTE_GATEWAY[2]="172.31.14.1"
ROUTE_COUNT[2]="1"
ROUTE_ARGS[2]=""

(again use the next higher integer in the brackets.)
Ron