1755694 Members
3323 Online
108837 Solutions
New Discussion юеВ

route problem

 
Jeff.Z
Frequent Advisor

route problem

Just want to delete a route and add it again from the routing table and sth wired happen.

route delete shows "no such route", netstat -rn shows that it's not there, but having problem when try to add it again.

Any suggestions on this? thanks.

# route delete 192.168.83.0 192.168.215.1
delete net 192.168.83.0: gateway 192.168.215.1: no such route

# netstat -rn
Routing tables
Destination Gateway Flags Refs Interface Pmtu
127.0.0.1 127.0.0.1 UH 0 lo0 4136
10.3.43.10 10.3.43.10 UH 0 lan900 4136
192.168.215.5 192.168.215.5 UH 0 lan1 4136
10.3.43.0 10.3.43.10 U 2 lan900 1500
192.168.215.0 192.168.215.5 U 2 lan1 1500
192.168.80.0 192.168.215.1 UG 0 lan1 1500
192.168.81.0 192.168.215.1 UG 0 lan1 1500
192.168.82.0 192.168.215.1 UG 0 lan1 1500
192.168.84.0 192.168.215.1 UG 0 lan1 1500
127.0.0.0 127.0.0.1 U 0 lo0 4136
192.168.80.0 192.168.215.1 UG 0 lan1 1500
default 10.3.43.1 UG 0 lan900 1500

# route add net 192.168.83.0 netmask 255.255.252.0 192.168.215.1 >
add net 192.168.83.0: gateway 192.168.215.1: entry in use


Thanks,
JEff
3 REPLIES 3
Steven E. Protter
Exalted Contributor

Re: route problem

Shalom

Looks like you are trying to delete a route that is not on the routing table

192.168.83 ? I don't see it.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Matti_Kurkela
Honored Contributor

Re: route problem

When adding a route, you'll usually have to specify the route "count".

route add net 192.168.83.0 netmask 255.255.252.0 192.168.215.1 1

Note the extra "1" at the end of the command line. It tells HP-UX the gateway is a remote host, not a LAN interface on the local host.

The need to specify a route count is probably a historical artifact: current versions of HP-UX automatically create a local route for any LAN interface and IP alias, so any explicit routes are normally remote hosts. However, the current behaviour is what numerous HP-UX applications and sysadmins expect, so it has not been changed so far.

MK
MK
Jeff.Z
Frequent Advisor

Re: route problem

Problem solved, thanks all of your reply. Need to specify the netmask to delete that perticular entry.

# route delete 192.168.83.0 netmask 255.255.252.0 192.168.215.1
delete net 192.168.83.0: gateway 192.168.215.1