无法删除手动添加的静态路由


4

在Mountain Lion上,我手动添加了一条静态路由,如下所示:

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

那很好。现在,我想删除静态路由,但是失败了:

$ 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

根据netstat和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

这是怎么了

编辑:10.0.0.1/24网络上的我的本地接口是OpenVPN创建的Tap设备。停止OpenVPN客户端会清除路由。仍然想知道为什么我不停止VPN客户端就无法删除此路由。


man openvpn并查看所有--route *选项?
MK 2013年

Answers:


By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.