Operating System - HP-UX
1828365 Members
2843 Online
109976 Solutions
New Discussion

problem to add static route using netconf

 
Andrey_20
Advisor

problem to add static route using netconf

Hello everybody.
I've got a problem to make static route permanent usinf /etc/rc.config.d/netconf file on HPUX 11.11.

I've got 2 lan interfaces lan0 and lan1. The content of /etc/hosts file:
172.17.13.132 testmts
127.0.0.1 localhost loopback
192.168.4.1 lan1

I would like to make a static route for the net 10.0.1.0 255.255.255.0 via lan1 (192.168.4.1).
In the terminal I issue the following command
route add net 10.0.1.0 netmask 255.255.255.0 192.168.4.1
after it I issue netstat -r and the line for net 10.0.1.0 is displayed in the output of this command. Anyway it's ok until the reboot, so I modify the /etc/rc.config.d/netconf file adding the following lines
ROUTE_DESTINATION[1]="net 10.0.1.0"
ROUTE_MASK[1]=""
ROUTE_GATEWAY[1]="192.168.4.1"
ROUTE_COUNT[1]="0"
ROUTE_ARGS[1]=""

After the reboot I enter netstat -r again and I see no line dedicated to net 10.0.1.0. That means there is no such a route in the routing table. Can you help me to find the problem, please?

Andrey
10 REPLIES 10
CAS_2
Valued Contributor

Re: problem to add static route using netconf

Set the route mask

ROUTE_MASK[1]=255.255.255.0
RAC_1
Honored Contributor

Re: problem to add static route using netconf

The syntax looks ok in netconf file. What is the error that you get?? check /etc/rc.log file and post the error.
There is no substitute to HARDWORK
Andrey_20
Advisor

Re: problem to add static route using netconf

CAS,

I tried both variants - no success. going to check the log.
Andrey_20
Advisor

Re: problem to add static route using netconf

I found nothing critical in /etc/rc.log

These are the lines related to routind

Configure pseudo devices for MAC/LLA access
Output from "/sbin/rc2.d/S462maclan start":
----------------------------

Start multicast routing daemon
Output from "/sbin/rc2.d/S490mrouted start":
----------------------------
"/sbin/rc2.d/S490mrouted start" SKIPPED

Start Internet services daemon
Output from "/sbin/rc2.d/S500inetd start":
----------------------------
Internet Services started

Start dynamic routing daemon
Output from "/sbin/rc2.d/S510gated start":
----------------------------
"/sbin/rc2.d/S510gated start" SKIPPED
Start router discover protocol daemon
Output from "/sbin/rc2.d/S520rdpd start":
----------------------------
"/sbin/rc2.d/S520rdpd start" SKIPPED

Configuring PPP Interface
Output from "/sbin/rc2.d/S522ppp start":
----------------------------
Creating 16 tunnel device nodes at major 31...

Start RARP protocol daemon
Output from "/sbin/rc2.d/S525rarpd start":
----------------------------
"/sbin/rc2.d/S525rarpd start" SKIPPED

RAC_1
Honored Contributor

Re: problem to add static route using netconf

egrep "fail|warning|error" /etc/rc.log
There is no substitute to HARDWORK
Muthukumar_5
Honored Contributor

Re: problem to add static route using netconf

Can you try and post output of,

# route add net 10.0.1.0 netmask 255.255.255.0 192.168.4.1 0
# route del net 10.0.1.0 netmask 255.255.255.0 192.168.4.1 0

# route add net 10.0.1.0 netmask 255.255.255.0 192.168.4.1 1
# route del net 10.0.1.0 netmask 255.255.255.0 192.168.4.1 1

May be a problem with ROUTE_COUNT[1]="" entry.

hth.
Easy to suggest when don't know about the problem!
Andrey_20
Advisor

Re: problem to add static route using netconf

Muthukumar

these commands work fine - add command output is
add net 10.0.1.0: gateway 192.168.4.1
delete command output is
delete net 10.0.1.0: gateway 192.168.4.1
CAS_2
Valued Contributor

Re: problem to add static route using netconf

Check for output from "/sbin/rc2.d/S340net start".

Routes are added by this rc script (/sbin/init.d/net), not by /sbin/rc2.d/S490mrouted.
RAC_1
Honored Contributor

Re: problem to add static route using netconf

How many files you have in there??

ll /etc/rc.config.d/netcon*

There should not be files like *.bak, *.org etc. The directory /etc/rc.config.d/ should hold only configuration files.
There is no substitute to HARDWORK
Andrey_20
Advisor

Re: problem to add static route using netconf

Thanks a lot to everybody, especially to RAC. The problem was as RAC correctly mentioned as that I had to files netcof and netconf.saved. After I deleted netconf.saved everuything works fine. That is a good lesson for me :)

Thanks again