Skip to content

Instantly share code, notes, and snippets.

@comoc
Created October 2, 2013 02:00
Show Gist options
  • Save comoc/6788059 to your computer and use it in GitHub Desktop.
Save comoc/6788059 to your computer and use it in GitHub Desktop.
Inspect the maximum MTU value of your Mac. Please specify the IP value to your environment.
#!/usr/bin/env ruby
ruby -e 'IP="192.168.1.1"; puts "Progress..."; for i in 1454..1500 do; cmd="ping -D -c 1 -s " + i.to_s + " " + IP; s=`#{cmd} 2>&1`; if s.include?("100.0% packet loss") && !s.include?("too") then; puts IP + " was not found"; exit(1); elsif s.include?("too") then ; puts "Max MTU is " + (i - 1).to_s; exit(0) end; end'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment