`route get` for ipv6


1

如何查找特定IPv6地址的路由?

对于IPv4,我可以这样做:

$ route -n get 1.1.1.1
   route to: 1.1.1.1
destination: 1.1.1.1
  interface: utun1
      flags: <UP,HOST,DONE,WASCLONED,IFSCOPE,IFREF>
 recvpipe  sendpipe  ssthresh  rtt,msec    rttvar  hopcount      mtu     expire
       0         0         0         0         0         0      1420         0

但对于IPv6:

$ route -n get 2606:4700:4700::1111
route: bad address: 2606:4700:4700::1111

Answers:


2

所以,答案是

route -n get -inet6 2606:4700:4700::1111

我发现这种语法非常神秘,最糟糕的是,从帮助输出中找出来是不可能的,甚至在阅读手册后理解这一点也很棘手。

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.