LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Solaris / OpenSolaris (https://www.linuxquestions.org/questions/solaris-opensolaris-20/)
-   -   Can not delete route (https://www.linuxquestions.org/questions/solaris-opensolaris-20/can-not-delete-route-602438/)

scoban 11-26-2007 05:21 AM

Can not delete route
 
Hi, There is a route entry in my netstat -rn output and I cannot delete it using route delete net <network> <gateway> command. I googled a bit, there is similar problems but no solutions. I also tried to delete it by deleting all routes using flush option without success. Any opinions?

ADxD_7 11-27-2007 04:36 PM

What error do you get when you try to delete it ?

It could be you need to specify the netmask in the route as well.

scoban 11-28-2007 01:31 AM

Already tried every possible way to delete the route without success. I am getting "gateway not in table" error. But I see it in routing table. I also tried route -p flush but after reboot route appears in table again...

jlliagre 11-28-2007 01:55 AM

Can you post all of the actual commands you run and their output ?

scoban 11-28-2007 03:00 AM

Quote:

Can you post all of the actual commands you run and their output ?
Here It comes.

Code:

bash-3.00# netstat -rn

Routing Table: IPv4
  Destination          Gateway          Flags  Ref    Use    Interface
-------------------- -------------------- ----- ----- ---------- ---------
default              10.5.1.1            UG        1        314 bge0     
10.5.0.0            10.5.3.1            U        1        54 bge0     
127.0.0.1            127.0.0.1            UH        1        315 lo0     

Routing Table: IPv6
  Destination/Mask            Gateway                  Flags Ref  Use    If 
--------------------------- --------------------------- ----- --- ------- -----
::1

I want to remove second line in above table.

Code:

bash-3.00# route delete net 10.5.0.0 10.5.3.1
delete net 10.5.0.0: gateway 10.5.3.1: not in table

I also tried 255.0.0.0 and 255.255.255.0 netmasks, same result.

Code:

bash-3.00# route delete net 10.5.0.0 -netmask 255.255.0.0 10.5.3.1
delete net 10.5.0.0: gateway 10.5.3.1: not in table

Code:

bash-3.00# route delete net 10.5.0.0 -netmask 255.255.0.0 -gateway 10.5.3.1
delete net 10.5.0.0: gateway 10.5.3.1: not in table

Code:

bash-3.00# route delete host 10.5.0.0 10.5.3.1
delete host 10.5.0.0: gateway 10.5.3.1: not in table
bash-3.00# route delete host 10.5.0.0 -netmask 255.255.0.0 10.5.3.1
delete net 10.5.0.0: gateway 10.5.3.1: not in table


jlliagre 11-28-2007 03:28 AM

This one isn't a route to a router (a.k.a gateway).
Why do you want to delete this route which is the only way for your machine to communicate with the network ?

scoban 11-28-2007 03:52 AM

I added it accidentally, my connection was working through default route.

jlliagre 11-28-2007 04:54 AM

I don't think you added it as it is created by default.

As I wrote, removing that route would prevent your machine to reach your default router or any other device connected to your LAN.

The problem must be elsewhere, and by the way, what is the problem you are trying to fix in the first place ?

scoban 11-28-2007 05:18 AM

As I was trying to communicate to global zone (IP:10.5.3.1) from local zone (IP:192.168.0.1), I set up this entry in routing table. Then I see it is not what I wanted so I just tried to get rid of it. This is a test machine and I want to delete this route entry, I don't care if my net goes down:) I am confused why I cannot delete it?

jlliagre 11-28-2007 05:43 AM

You didn't tell you used zones.

Anyway, you can't directly communicate between 10.5.3.1 to 192.168.0.1, you need IPs on the same network on each connected zones.

scoban 11-28-2007 05:59 AM

Quote:

Anyway, you can't directly communicate between 10.5.3.1 to 192.168.0.1, you need IPs on the same network on each connected zones.
Are you sure about that? I read some posts (1) about routing between local and global zones in different subnets is possible.

Anyway forget about zones, I want to get rid of that entry in routing table is this possible in any way? I am ready to reinstall the OS because of this:)

1-http://forum.java.sun.com/thread.jspa?threadID=5075797&messageID=9276196

pkochummen 11-28-2007 08:12 AM

Use the routeadm command from the global zone . Not sure of the exact switch though

man routeadm


Rgds
PK

jlliagre 11-28-2007 05:32 PM

Quote:

Originally Posted by scoban (Post 2973215)
Are you sure about that?

This is basic TCP/IP by design. Two machines can directly communicate only when they are on the same (sub)network. As far as networking is concerned, zones are considered as different machines even while they share the same TCP/IP stack (Latest Solaris Express allows separate stacks).
Quote:

I read some posts (1) about routing between local and global zones in different subnets is possible.
May be. I'm skeptical about the interest of such hacks if at all possible.
Quote:

Anyway forget about zones, I want to get rid of that entry in routing table is this possible in any way?
I doubt you can, and that would make your interface useless anyway.
Quote:

I am ready to reinstall the OS because of this:)
In my opinion, that wouldn't remove that route which is hardcoded.

scoban 11-29-2007 02:21 AM

Thanks for replays, I did not manage to remove this route entry, I am giving up for now:)

jlliagre 11-29-2007 04:12 AM

I'm afraid you are still missing you didn't add this route and deleting it would be useless.

You can remove that route by using the correct syntax, but after that your host is isolated:
Code:

bestouan:~ $ netstat -rn

Routing Table: IPv4
  Destination          Gateway          Flags  Ref    Use    Interface
-------------------- -------------------- ----- ----- ---------- ---------
default              192.168.1.1          UG        1        13 iwi0     
192.168.1.0          192.168.1.5          U        1          1 iwi0     
127.0.0.1            127.0.0.1            UH        3        395 lo0     

bestouan:~ $ pfexec route delete 192.168.1.0          192.168.1.5
delete net 192.168.1.0: gateway 192.168.1.5
bestouan:~ $ netstat -rn                                     

Routing Table: IPv4
  Destination          Gateway          Flags  Ref    Use    Interface
-------------------- -------------------- ----- ----- ---------- ---------
default              192.168.1.1          UG        1        13 iwi0     
127.0.0.1            127.0.0.1            UH        3        395 lo0     
bestouan:~ $ ping 192.168.1.1
ICMP Host Unreachable from gateway 192.168.1.5
 for icmp from 192.168.1.5 to 192.168.1.1
bestouan:~ $ sudo route add 192.168.1.0          192.168.1.5 
add net 192.168.1.0: gateway 192.168.1.5: Network Unreachable
bestouan:~ $ ifconfig -a
lo0: flags=2001000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4,VIRTUAL> mtu 8232 index 1
        inet 127.0.0.1 netmask ff000000
skge0: flags=1004842<BROADCAST,RUNNING,MULTICAST,DHCP,IPv4> mtu 1500 index 2
        inet 0.0.0.0 netmask 0
iwi0: flags=201004843<UP,BROADCAST,RUNNING,MULTICAST,DHCP,IPv4,CoS> mtu 1500 index 3
        inet 192.168.1.5 netmask ffffff00 broadcast 192.168.1.255
bestouan:~ $ pfexec route add 192.168.1.0 192.168.1.5 0
add net 192.168.1.0: gateway 192.168.1.5
bestouan:~ $

You should focus on fixing the communication issue you are facing instead.


All times are GMT -5. The time now is 12:34 AM.