Need help - how to get ipv4 stats

Trying to troubleshoot some ip forwarding problem and tried to use netstat -s, but it does not show ipv4 stats, only ipv6.

When I launch Network Utiliy and do netstat there, get this error message:


netstat: sysctl: net.inet.ip.input_perf_data: No such file or directory


This problem only exists on OS Sierra, El Capitan works just fine.


Is there any other way of getting IPv4 stats, such as forwarded/dropped/etc packets? Thanks!

Replies

When I launch Network Utiliy and do netstat there, get this error message:

netstat: sysctl: net.inet.ip.input_perf_data: No such file or directory

Indeed, that also shows up in the middle of the

netstat
output:
$ netstat -s | grep input_perf_data
netstat: sysctl: net.inet.ip.input_perf_data: No such file or directory

AFAICT there was a deliberate change in the kernel to remove these statistics from production builds. You can see this in the Darwin source, comparing the 10.11 code with the 10.12 code.

I was unable to track down the backstory to this but, regardless, you should file a bug against

netstat
here; even if this info was removed for a good reason,
netstat
shouldn’t be spitting out an error. You will probably want to also file an enhancement request for a way to statistics you need.

Please post the numbers of any bugs you file, just for the record.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

We've just run into this issue, too. The radar is radar://42579258

Thanks