4

On Mountain Lion, I manually added a static route like this:

$ sudo route -n add 10.10.10.1/24 10.0.0.2
add net 10.10.10.1: gateway 10.0.0.2

That worked just fine. Now I want to remove the static route, but this fails:

$ sudo route -n delete  10.10.10.1/24 10.0.0.2
route: writing to routing socket: not in table
delete net 10.10.10.1: gateway 10.0.0.2: not in table

Even though it says "not in table", the entry is there, according to netstat and route:

$ netstat -rn | grep 10.10.10
10.10.10/24        10.0.0.2           UGSc            1        2    tap0

$ route get 10.10.10.1
   route to: 10.10.10.1
destination: 10.10.10.0
       mask: 255.255.255.0
    gateway: 10.0.0.2
  interface: tap0
      flags: <UP,GATEWAY,DONE,STATIC,PRCLONING>
 recvpipe  sendpipe  ssthresh  rtt,msec    rttvar  hopcount      mtu     expire
       0         0         0         0         0         0      1500         0

What's going wrong here?

Edit: My local interface on the 10.0.0.1/24 network is a tap device created by OpenVPN. Stopping the OpenVPN client clears the route. Would still like to know why I can't remove this route without stopping the VPN client.

  • man openvpn and look at all the --route* options? – M K Sep 17 '13 at 18:15
6

I was using the wrong syntax. This works:

$ sudo route -n delete 10.10.10.0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .