Discussion:
Can Not Delete Route
Barry Skidmore
2004-07-21 01:33:32 UTC
Permalink
I am using gentoo-2004.1 with kernel 2.6.7 on an i386 machine.

I am unable to delete a route from the routing table. I believe I am
using the correct syntax based on the man file and a Google search.

These commands are entered as root:

# netstat -rn

Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
206.53.239.229 - 255.255.255.255 !H - - - -

# route del -net 206.53.239.229
SIOCDELRT: Invalid argument

What am I missing?

Thanks,
Barry

+----------------+
+ Barry Skidmore |
| Gentoo - i386 |
| kernel-2.6.7 |
| Hobbyist user |
+----------------+

--
gentoo-***@gentoo.org mailing list
Tom Furie
2004-07-21 01:38:02 UTC
Permalink
Post by Barry Skidmore
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
206.53.239.229 - 255.255.255.255 !H - - - -
# route del -net 206.53.239.229
SIOCDELRT: Invalid argument
What am I missing?
It's not what you're missing, but what your adding. The route is a host
route, so you don't want -net.

Cheers,
Tom
--
No one so thoroughly appreciates the value of constructive criticism as the
one who's giving it.
-- Hal Chadwick

--
gentoo-***@gentoo.org mailing list
Barry Skidmore
2004-07-21 01:53:30 UTC
Permalink
Post by Tom Furie
Post by Barry Skidmore
# route del -net 206.53.239.229
SIOCDELRT: Invalid argument
What am I missing?
It's not what you're missing, but what your adding. The route is a host
route, so you don't want -net.
Tom,

Still no luck using host, although now I am getting a different error:

# route del -host 206.53.239.229
SIOCDELRT: No such process

According to a Google search, that error can indicate that the target
does not exist, but according to netstat it _is_ there:

# netstat -rn

Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
206.53.239.229 - 255.255.255.255 !H - - - -

Any other thoughts?

Barry

+----------------+
+ Barry Skidmore |
| Gentoo - i386 |
| kernel-2.6.7 |
| Hobbyist user |
+----------------+

--
gentoo-***@gentoo.org mailing list
Tom Furie
2004-07-21 02:56:58 UTC
Permalink
Post by Barry Skidmore
# netstat -rn
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
206.53.239.229 - 255.255.255.255 !H - - - -
Any other thoughts?
I notice there's no gateway or interface being shown. Try bringing the
interface that this was being routed through back up, then deleting the
route, although the route should have been removed when the interface
was brought down.

Cheers,
Tom
--
Psychology. Mind over matter. Mind under matter? It doesn't matter.
Never mind.

--
gentoo-***@gentoo.org mailing list
Barry Skidmore
2004-07-21 12:18:16 UTC
Permalink
Post by Tom Furie
I notice there's no gateway or interface being shown. Try bringing the
interface that this was being routed through back up, then deleting the
route, although the route should have been removed when the interface
was brought down.
Tom,

I snipped the output of netstat to just show the route I am trying to
delete. There is indeed a gateway and interface in the routing table.

Barry

+----------------+
+ Barry Skidmore |
| Gentoo - i386 |
| kernel-2.6.7 |
| Hobbyist user |
+----------------+

--
gentoo-***@gentoo.org mailing list
b***@gonoph.net
2004-07-21 03:20:41 UTC
Permalink
Post by Barry Skidmore
# route del -host 206.53.239.229
SIOCDELRT: No such process
try just
# route del 206.53.239.229




--
gentoo-***@gentoo.org mailing list
Barry Skidmore
2004-07-21 11:04:28 UTC
Permalink
Post by b***@gonoph.net
Post by Barry Skidmore
# route del -host 206.53.239.229
SIOCDELRT: No such process
try just
# route del 206.53.239.229
# route del 206.53.239.229
SIOCDELRT: No such process

This does not work either.

Is there a text file where the route information is stored that I can
edit directly to remove the information, thus avoiding the 'route'
utility?

Barry

+----------------+
+ Barry Skidmore |
| Gentoo - i386 |
| kernel-2.6.7 |
| Hobbyist user |
+----------------+

--
gentoo-***@gentoo.org mailing list
Christoph Gysin
2004-07-21 13:20:39 UTC
Permalink
Post by Barry Skidmore
Is there a text file where the route information is stored that I can
edit directly to remove the information, thus avoiding the 'route'
utility?
The information is stored in kernel memory, so you could edit /dev/kmem ;-)

No, seriously:
There's only a readonly proc-entry for the routing table
(/proc/net/route), which can't be edited.

--
gentoo-***@gentoo.org mailing list
Barry Skidmore
2004-07-21 14:09:46 UTC
Permalink
Post by Christoph Gysin
Post by Barry Skidmore
Is there a text file where the route information is stored that I can
edit directly to remove the information, thus avoiding the 'route'
utility?
The information is stored in kernel memory, so you could edit /dev/kmem ;-)
There's only a readonly proc-entry for the routing table
(/proc/net/route), which can't be edited.
I have some additional information that hopefully will help diagnose
the problem I am having not being able to delete a route.

The route was added to the routing table by portsentry using the
following command in portsentry.conf:

# Newer versions of Linux support the reject flag now. This
# is cleaner than the above option.
KILL_ROUTE="/sbin/route add -host $TARGET$ reject"

I notice that the route is being added as a 'host', and in fact the
output of 'route' shows this:

# route (snipped):
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
mail.worldvenue - 255.255.255.255 !H 0 - 0 -

However, I still can not delete the route with the following:

# route del -host mail.worldvenue
mail.worldvenue: Unknown host

The complete host name is actually 'mail.worldvenue.org', but:

# route del -host mail.worldvenue.org
SIOCDELRT: No such process

As I have mentioned before, this error usually indicates that the
target does not exist.

Might the host be listed in the table as something other than
'mail.worldvenue.org'? I notice that it is not possible to see the
entire width of the 'Destination' column from the 'route' output.

As a reminder, I have also been unsuccessful deleting the route using
the ip address of 'mail.worldvenue.org'.

I hope this additional info might suggest a possible solution to this
problem.

Thanks,
Barry


+----------------+
| Barry Skidmore |
| Gentoo - i386 |
| kernel-2.6.7 |
| Hobbyist user |
+----------------+

--
gentoo-***@gentoo.org mailing list
Billy Holmes
2004-07-21 18:20:30 UTC
Permalink
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Barry Skidmore wrote:

| KILL_ROUTE="/sbin/route add -host $TARGET$ reject"

I haven't really messed with routing tables in about 10 years except for
doing more than setting up an interface manually.

but.. I recall some routes require that you remove them with exactly the
same syntax as you added them. Thus..

route del -host $TARGET reject

should remove your route
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFA/rPuhYqy4eLQxdkRAh8EAJ4puyy/90fznONt3TQzWa6HokMrZwCfWkAq
a2zMIxV9xTp9nbDd9wZhJj0=
=QamT
-----END PGP SIGNATURE-----

--
gentoo-***@gentoo.org mailing list
Barry Skidmore
2004-07-21 17:56:08 UTC
Permalink
Post by Billy Holmes
I haven't really messed with routing tables in about 10 years except for
doing more than setting up an interface manually.
but.. I recall some routes require that you remove them with exactly the
same syntax as you added them. Thus..
route del -host $TARGET reject
should remove your route
Well, this has become a moot point. I rebooted the machine and the
only routing information that was then displayed was the default
gateway and interface. I guess the rejected host information is not
retained between boots, which is both good news and bad news.

Barry

+----------------+
| Barry Skidmore |
| Gentoo - i386 |
| kernel-2.6.7 |
| Hobbyist user |
+----------------+

--
gentoo-***@gentoo.org mailing list
Ajai Khattri
2004-07-21 22:23:57 UTC
Permalink
Post by Barry Skidmore
I am using gentoo-2004.1 with kernel 2.6.7 on an i386 machine.
I am unable to delete a route from the routing table. I believe I am
using the correct syntax based on the man file and a Google search.
# netstat -rn
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
206.53.239.229 - 255.255.255.255 !H - - - -
# route del -net 206.53.239.229
SIOCDELRT: Invalid argument
What am I missing?
Did you try emerging the iproute2 package and using the ip command
instead?
--
Aj.
Sys. Admin / Developer

--
gentoo-***@gentoo.org mailing list
Loading...