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

$ sudo route -n add
add net gateway

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

$ sudo route -n delete
route: writing to routing socket: not in table
delete net gateway 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           UGSc            1        2    tap0

$ route get
   route to:
  interface: tap0
 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 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

I was using the wrong syntax. This works:

$ sudo route -n delete

You must log in to answer this question.

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