1
Is there a command for the OS X Terminal that shows you only the most vital IP configuration information about your machine? I know there is "ifconfig" but that brings up a bunch of (in most cases) unnecessary information. I just want to know my current IP, subnet mask, default gateway and DNS.
UPDATE
Output of netstat -rn
Axels-MacBook-Air:~ axelkennedal$ netstat -rn
Routing tables
Internet:
Destination Gateway Flags Refs Use Netif Expire
default 10.164.192.1 UGSc 75 0 en0
10.164.192/19 link#4 UCS 3 0 en0
10.164.192.1 c0:62:6b:e2:7a:c0 UHLWIir 76 20 en0 1150
10.164.206.216 127.0.0.1 UHS 0 25 lo0
10.164.223.255 ff:ff:ff:ff:ff:ff UHLWbI 0 14 en0
127 127.0.0.1 UCS 0 0 lo0
127.0.0.1 127.0.0.1 UH 4 644 lo0
169.254 link#4 UCS 0 0 en0
Internet6:
Destination Gateway Flags Netif Expire
::1 ::1 UHL lo0
fe80::%lo0/64 fe80::1%lo0 UcI lo0
fe80::1%lo0 link#1 UHLI lo0
fe80::%en0/64 link#4 UCI en0
fe80::7ed1:c3ff:fef1:9b1f%en0 7c:d1:c3:f1:9b:1f UHLI lo0
ff01::%lo0/32 ::1 UmCI lo0
ff01::%en0/32 link#4 UmCI en0
ff02::%lo0/32 ::1 UmCI lo0
ff02::%en0/32 link#4 UmCI en0
Could you show us the output of
ifconfig
on your machine? The details are different on different OSs. Doesifconfig
show your DNS and default gateway? – terdon – 2014-03-04T16:19:33.700@terdon Sure! http://gyazo.com/ecd50ef22bc0393a87fff8136386fa4a The thing is though that as you can tell by the name "ifconfig" is "InterFaceconfig" meaning it only states addressing for interfaces on the machine running the terminal.
– Axel Kennedal – 2014-03-04T16:21:45.883What machines would you want it to state addresses for? Of course it returns information for the machine it's running on. Anyway, thanks for the output but please just copy paste it into your question. I need to be able to copy it to my terminal to test and I can't use an screenshot. – terdon – 2014-03-04T16:30:05.190
The script in my answer has not been tested on OSX. Please let me know if you get any errors. – terdon – 2014-03-04T16:57:17.980
I only want info concerning my own machine, I just said that to clarify that it didnt show info about other devices (like the DNS server) @terdon – Axel Kennedal – 2014-03-04T17:16:22.707