|
|
|
|
|
by X-Istence
1684 days ago
|
|
ip doesn't exist on macOS. That is a Linuxism. You can use the following: netstat -rn -f inet | grep default | head -n 1 | awk '{ print $2 }'
To get the default gateway that is the preferred one on macOS, so you don't need to hard code it. scutil --dns
Will display the DNS servers/split DNS configuration as well. |
|
If on wifi one can also simply option click the wifi icon in the menu bar. Maybe some people don't know yet, it was a late discovery for me option click shows more information there.
For quick internet access check I like 'curl ipconfig.sh'