Can't delete route

Alexandre Biancalana ale at seudns.net
Thu May 18 17:52:35 UTC 2006


Oliver Fromme wrote:
> Alexandre Biancalana <ale at seudns.net> wrote:
>  >     Today I had to add a new route in the company gateway. So I ran the 
>  > command:
>  > 
>  > # route add 128.110.0.0 255.255.0.0 10.0.0.17
>  > add net 128.110.0.0: gateway 255.255.0.0
>
> You used the wrong syntax.  Correct syntax is:
> # route add -net <destination> <gateway> [<netmask>]
>
> So what your command actually did was to add 255.255.0.0
> as a gateway for 128.110.0.0 (with an illegal netmask of
> 10.0.0.17).  You certainly didn't want that, but the
> route command did exactly what you told it to do.  ;-)
>   
Ok ! Right ! My fault ! In the running of make the new configuration I 
typed the command in wrong order.... :-(

>  >    Running   netstat -nr I get the following:
>  > 
>  > 0&0xa000011        255.255.0.0        UGSc       15      332   fxp0 =>
>  > 
>  > this is incorrect, the interface should be fxp1 not fxp0 (that is the 
>  > default interface).
>
> That's expected.  255.255.0.0 is probably on your default
> route, so it'll be routed to fxp0.
>
>  > And Why the destination network is 0&0xa000011 and 
>  > not 128.110.0.0
>
> You specified 10.0.0.17 as the netmask, which is 0xa000011
> in hexadecimal.  When you perform a bitwise-and operation
> between your destination (128.110.0.0) and your netmask
> (10.0.0.17), you get zero.  That's why netstat(1) displays
> "0".  It also displays the netmask, usually CIDR notation
> if possible (i.e. "/x"), but that's not possible with your
> weird netmask, so it just displays "&" followed by the mask
> in hex.
>   
Have some way to remove this stupid route without flushing the routing 
table ???
This machine is main gateway of the company and I can't do a route flush 
now, but I need to have this new route working...

# route delete -net 128.110.0.0
route: writing to routing socket: No such process
delete net 128.110.0.0: not in table

> Best regards
>    Oliver
>
>   

 Thank you for ALL the replies, all of then was great !!

Alexandre


More information about the freebsd-net mailing list