Operating System - HP-UX
1752328 Members
5491 Online
108786 Solutions
New Discussion юеВ

Re: adding a route and gets an error when activating it

 
SOLVED
Go to solution
paul fritzsche
Advisor

adding a route and gets an error when activating it

Hi,

I want to add a route 217.174.65.4/32 to 192.168.100.225 and do it like this

I edit this file
/etc/rc.config.d/netconf

Add the following
ROUTE_DESTINATION[4]="217.174.65.4"
ROUTE_MASK[4]="255.255.255.255"
ROUTE_GATEWAY[4]="192.168.100.255"
ROUTE_COUNT[4]="1"
ROUTE_ARGS[4]=""

and then re-reads the routingtable with
/sbin/init.d/net start

and get an error
ERROR: usage: add destination [netmask mask] gateway [metric]


what am I doing wrong?

Regards
Paul
11 REPLIES 11
Paula J Frazer-Campbell
Honored Contributor

Re: adding a route and gets an error when activating it

Paul

Revit your netmask .

From command line syustax is:-

route add net 10.125.0.0 netmask 255.255.0.0 192.1.0.254 1

To delete:-

route delete net 10.125.0.0 netmask 255.255.0.0 192.1.0.254



HTH

Paula
If you can spell SysAdmin then you is one - anon
Paula J Frazer-Campbell
Honored Contributor

Re: adding a route and gets an error when activating it

Paul

Revisit your netmask .

From command line syustax is:-

route add net 10.125.0.0 netmask 255.255.0.0 192.1.0.254 1

To delete:-

route delete net 10.125.0.0 netmask 255.255.0.0 192.1.0.254



HTH

Paula
If you can spell SysAdmin then you is one - anon
Paula J Frazer-Campbell
Honored Contributor

Re: adding a route and gets an error when activating it

Paul

Sorry - day for typos


Revisit your netmask .

From command line syntax is:-

route add net 10.125.0.0 netmask 255.255.0.0 192.1.0.254 1

To delete:-

route delete net 10.125.0.0 netmask 255.255.0.0 192.1.0.254



HTH

Paula
If you can spell SysAdmin then you is one - anon
paul fritzsche
Advisor

Re: adding a route and gets an error when activating it


Sorry, but I dont want to add a whole net. Only a specific host.

217.174.65.4

I had no problem in adding the whole net

//P
Patrick Chim
Trusted Contributor

Re: adding a route and gets an error when activating it

Hi,

I think you are no need to specify the network mask.

i.e. route add 217.174.65.4 192.168.100.255 1

After that, you can type 'netstat -nr' to check it and it should show

217.174.65.4 192.168.100.255 UGH 0 lanX 0

Beware that there exist a 'H' in 'UGH' as your destination is a host.

Hope this help

Regards,
Patrick
paul fritzsche
Advisor

Re: adding a route and gets an error when activating it


but, how do I edit this in the netconf file?
I dont add the netmask at all in this file?

ROUTE_DESTINATION[4]="217.174.65.4"
ROUTE_MASK[4]=""
ROUTE_GATEWAY[4]="192.168.100.255"
ROUTE_COUNT[4]="1"
ROUTE_ARGS[4]=""



BFA6
Respected Contributor
Solution

Re: adding a route and gets an error when activating it

Hi Paul,

This is the type of entry I've got in netconf for a host

ROUTE_DESTINATION[4]="host 194.75.33.133"
ROUTE_MASK[4]=""
ROUTE_GATEWAY[4]=131.131.1.34
ROUTE_COUNT[4]=1
ROUTE_ARGS[4]=""

Hope this helps.

Regards,

Hilary
Patrick Chim
Trusted Contributor

Re: adding a route and gets an error when activating it

Hi,

Your syntax is OK.

Did you try adding the route in commnad prompt ? Is it work ?

Everytime I will first adding the route in command line, then edit netconf file to let it effective at next reboot.

Can you do a /sbin/init.d/net stop and then start ? Moreover, is it possible to reboot the machine now ?

Regards,
Patrick
paul fritzsche
Advisor

Re: adding a route and gets an error when activating it


Thankyou. That was what I was after =)

Do you know anywhere on the web, where I can read about how I add routes, why it has to be in a specific way?