1829738 Members
1816 Online
109992 Solutions
New Discussion

delete route

 
SOLVED
Go to solution
Ceesjan van Hattum
Esteemed Contributor

delete route

I should be so simple, but i fail to delete this route entry:

145.7.71.64 10.126.254.17 UG 0 0 lan1 1500

I would expect that
route delete 145.7.71.64 10.126.254.17
would be enough to delete the entry from the table, but i get:
#route delete 145.7.71.64 10.126.254.17
delete host 145.7.71.64: gateway 10.126.254.17: No such file or directory

what is it that i do not see?
Regards,
Ceesjan

13 REPLIES 13
harry d brown jr
Honored Contributor

Re: delete route

route delete net 145.7.71.64 10.126.254.17

??

live free or die
harry
Live Free or Die
John Poff
Honored Contributor

Re: delete route

Hi,

How about:

route delete 145.7.71.64 10.126.254.17 1

It might need the hop count to delete the gateway.

JP
Stefan Farrelly
Honored Contributor

Re: delete route


If this route was pushed to your server from a network router/switch then you wont be able to delete it on your HP since it wasnt added with a route add ....

Any routes added to your server should be in /etc/rc.config.d/netconf and only these ones can you delete manually with route delete.
Im from Palmerston North, New Zealand, but somehow ended up in London...
Ceesjan van Hattum
Esteemed Contributor

Re: delete route

Up until now, no succes.
I added the entry myself manually by:
route add net 145.7.71.67 netmask 255.255.255.240 10.126.254.17 1

I still suppose i should be able to delete it as well.
By the way: what does 'no such file or directory' imply in this context?

Ceesjan
John Poff
Honored Contributor

Re: delete route

Ok, try this:

route delete net 145.7.71.64 10.126.254.17 1

JP
harry d brown jr
Honored Contributor

Re: delete route

Did you try:

route delete net 145.7.71.67 netmask 255.255.255.240 10.126.254.17 1


live free or die
harry
Live Free or Die
Stefan Farrelly
Honored Contributor

Re: delete route

Ive just tested it myself - No such file or directory means the route was NOT added on your HP server with a route add command - so its not in the table of routes for you to delete. I still think it was pushed to your HP server from a network device which means you will not be able to delete it. You need to speak to your network people about it.
Im from Palmerston North, New Zealand, but somehow ended up in London...
harry d brown jr
Honored Contributor

Re: delete route


If you do a

netstat -rn | grep -e 145.7.71.64 -e 10.126.254.17

what do you get back??

live free or die
harry
Live Free or Die
John Palmer
Honored Contributor
Solution

Re: delete route

route delete net 145.7.71.64 netmask 255.255.255.240 10.126.254.17

If the netmask differs from the default (depends on the class) then you have to specify the netmask. If you don't know it, you can check it with netstat -rnv

Regards,
John
Sridhar Bhaskarla
Honored Contributor

Re: delete route

Ceesjan,

Use the netmask in the delete statement.

route delete net 145.7.71.64 netmask 255.255.240.0 10.126.254.17 1

??

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
Sridhar Bhaskarla
Honored Contributor

Re: delete route

... "no such file or directory" means it is not able to find this route in it's routing table.

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
Ceesjan van Hattum
Esteemed Contributor

Re: delete route

THANKS.
Add the netmask, but not the Metric.
Greetings,
Ceesjan
W.C. Epperson
Trusted Contributor

Re: delete route

Just to clear some things up, the "No such file or directory" error does NOT indicate anything about how the route was added: a routing table entry is a routing table entry. The message indicates that the command could not find a match in the routing table. This is because it's a bitwise match, and the system is making incorrect assumptions about how many bits to match because it doesn't know the netmask. And I've seen inexplicable situations where the hop metric was required to get a delete to work.
"I have great faith in fools; self-confidence, my friends call it." --Poe