Operating System - HP-UX
1819791 Members
3436 Online
109607 Solutions
New Discussion юеВ

How to Save route delete ...?

 
SOLVED
Go to solution
Mozhdeh
Occasional Contributor

How to Save route delete ...?

Hi,
I used route delete to delete route of 10.0.0.0 from the system route table.
Now, I need to save this change to the system. This route delete must be performed whenever that we have reboot. How must I do that? ( I saved my route changes in the "/rc.config.d/netconf" file, but I don't know how to save route delete?!)

Thank you.
Mozhdeh
4 REPLIES 4
RAC_1
Honored Contributor

Re: How to Save route delete ...?

You do not need to do anything, if route is not there in netconf file. Only those route which are in netconf will be added to route table.
There is no substitute to HARDWORK
Mozhdeh
Occasional Contributor

Re: How to Save route delete ...?

Hi,
Thanks for your answer, but one of my server interfaces is in the LAN with this IP: 10.1.11.x , so when I reboot this server, it add this route in its route table:

10.0.0.0 10.1.11.100 ...

I have to delete this route because don't want to route all of 10.0.0.0 to this interface. So I need this route to be deleted automatically. How can I do that?

Sincerely,
Mozhdeh
Matti_Kurkela
Honored Contributor
Solution

Re: How to Save route delete ...?

If I understood correctly, you don't have any ROUTE definitions in /etc/rc.config.d/netconf other than the default gateway - right?

Your problem then must be ultimately caused by the netmask setting on your 10.1.11.100 interface. Each interface automatically gets an autogenerated "direct" route according to the IP address and netmask settings.
(When you remove this direct route, no traffic should go out through that interface - so you might actually be able to disable that interface completely!)

The 10.x.x.x is part of the so-called Class-A addresses, so HP-UX gives it the default netmask of 255.0.0.0 (0xff000000 in hex, or /8 if expressed as a number of 1 bits) unless you specify a different netmask. These address classes are a remnant of early history of the IP protocol - in modern networks, the HP-UX's choice of a default netmask amounts to just a wild guess.

The combination of netmask and IP address should normally describe the set of hosts that are directly reacheble through that interface, without using a router. The default netmask of 255.0.0.0 is apparently too wide for your network. You should find out the correct netmask: for example, netmask 255.255.0.0 (or 0xffff0000) will cause your interface to have a "direct" route to 10.1.*.*, and netmask 255.255.255.0 (0xffffff00) will make the direct route as narrow as 10.1.11.*.

If you cannot change the netmask, your network is either badly configured or contains some very old devices. In this case, if you're unable to fix the root cause (the netmask) you may have to treat the symptom by writing a custom startup script that does the necessary "route delete"... but I'd strongly prefer fixing the netmask problem.
MK
Mozhdeh
Occasional Contributor

Re: How to Save route delete ...?

Hi,
Thank you very much for your answer.
All of your descriptions are true. This network has been configured very very bad. We have another net with this IPs: 10.2.x.x, so I must route each net traffics to its own net. When I use this statement:
"Route add 10.1.11.x 255.255.255.0 10.1.11.100 ... ",
It set netmask with 255.0.0.0 not 255.255.255.0 so all of the 10.x.x.x packets go to the, for example 10.1.11.100 interface!
I have to add all of my 7 static routes for the 10.1.11.x network manually, and then delete 10.0.0.0 route of route table. Then route 0.0.0.0 to the next interface!
Ok, that was my problem, as you told, I have to write a script to delete that route.

Thank you for your guides.
Sincerely,