Need to delete a host route from Linux

Posted on 2003-03-10
Medium Priority
Last Modified: 2008-02-01
In my route list I have a route showing:

destination    Subnet             GW   Flags     -     !H

No matter what I do, I cannot delete this route. I have tried statements with syntax that allows me to remove other routes from this box, but this one gives me the same type of reply everytime I try to delete it.

*No such process*
*No such host*
*netmask 00000000 doesn't make sense with host route*

I think I have tried just about everything. This route is preventing the connection of two computers on different networks. I need to get rid of it. Please help!
Question by:miataman92
  • 2
LVL 22

Expert Comment

ID: 8107442
This is a *really* irritating problem with the route command - you must use exactly the same syntax for deleting a route as when you created it:

route add -net netmask dev eth0

can only be deleted by:

route del -net netmask dev eth0

route add -net netmask

will not work:( Also if you have defined a gw, then you must include that.

Therefore, my suggestion to deal with this is:

route print

and then route del including *ALL* the parameters:)

Hope that helps:)
LVL 22

Accepted Solution

pjedmond earned 225 total points
ID: 8107464
Otherwise, you can delete tham manually:

/etc/sysconfig/static-routes contains a list of static routes for redhat 7.2

For your system, I recommend:

find /etc/ | grep rout

and you should find the file you need.

Hope that helps:)

Expert Comment

ID: 8111205

route delete -host
route delete -host
route delete -host netmask

try them with and without the -host option

(btw, route print is not valid, route print works on windows


Expert Comment

ID: 9077692
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
Post your closing recommendations!  No comment means you don't care.

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have seen several blogs and forum entries elsewhere state that because NTFS volumes do not support linux ownership or permissions, they cannot be used for anonymous ftp upload through the vsftpd program.   IT can be done and here's how to get i…
Note: for this to work properly you need to use a Cross-Over network cable. 1. Connect both servers S1 and S2 on the second network slots respectively. Note that you can use the 1st slots but usually these would be occupied by the Service Provide…
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…
How to fix display issue, screen flickering issue when I plug in power cord to the machine. Before I start explaining the solution lets check out once the issue how it looks like after I connect the power cord. most of you also have faced this…
Suggested Courses

601 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question