https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=272818
--- Comment #3 from Wencey Wang <[email protected]> --- (In reply to Greg Becker from comment #1) I don't think having awk stop on the first match is a fix. As there's no default route on an Internet router. Instead, there are routes for every routable CIDR. (https://en.wikipedia.org/wiki/Default-free_zone) Here goes my example, which contains several lines of IPv6 route in the `netstat -rn` output, I have to hide the next-hop and ifname but you can easily get the idea. ``` Internet6: Destination Gateway Flags Netif Expire ::/96 ::1 URS lo0 ::1 link#1 UHS lo0 ::ffff:0.0.0.0/96 ::1 URS lo0 2001::/32 hidden next-hop UG1 hidden ifname 2001:4:112::/48 hidden next-hop UG1 hidden ifname 2001:200::/32 hidden next-hop UG1 hidden ifname 2001:200:900::/40 hidden next-hop UG1 hidden ifname 2001:200:e00::/40 hidden next-hop UG1 hidden ifname 2001:200:c000::/35 hidden next-hop UG1 hidden ifname 2001:200:e000::/35 hidden next-hop UG1 hidden ifname 2001:218::/32 hidden next-hop UG1 hidden ifname 2001:218:2002::/48 hidden next-hop UG1 hidden ifname 2001:218:2200::/40 hidden next-hop UG1 hidden ifname 2001:218:3004::/48 hidden next-hop UG1 hidden ifname ``` As comment #2 suggested, `route(8)` is much better than parsing the output of `netstat -rn`. I also think `route(4)` can be used as a good data source instead of parsing text. -- You are receiving this mail because: You are the assignee for the bug.
