Network Info, July 2003

In Windows, you can type 'ipconfig /all' to discover lots of useful information about your network connection (IP address, DNS servers, etc). What is the equivalent command in OS X?

There are several:

  • % ifconfig gives you this:
     lo0: flags=8049 mtu 16384
            inet6 ::1 prefixlen 128 
            inet6 fe80::1%lo0 prefixlen 64 scopeid 0x1 
            inet 127.0.0.1 netmask 0xff000000 
    gif0: flags=8010 mtu 1280
    stf0: flags=0<> mtu 1280
    en0: flags=8863 mtu 1500
            inet6 fe80::203:93ff:fe9e:ffb6%en0 prefixlen 64 scopeid 0x4 
            inet 17.516.27.121 netmask 0xfffffc00 broadcast 17.516.27.255
            ether 00:03:93:9e:ff:b6 
            media: autoselect (100baseTX ) status: active
            supported media: none autoselect 10baseT/UTP <half-duplex> 10baseT/UTP <half-duplex,hw-loopback> 10baseT/UTP <full-duplex> 10baseT/UTP <full-duplex,hw-loopback> 100baseTX <half-duplex> 100baseTX <half-duplex,hw-loopback> 100baseTX <full-duplex> 100baseTX <full-duplex,hw-loopback> 1000baseTX <full-duplex> 1000baseTX <full-duplex,hw-loopback> 1000baseTX <full-duplex,flow-control> 1000baseTX <full-duplex,flow-control,hw-loopback>
    
     

  • To find the DNS servers, just do 'cat /etc/resolv.conf'

  • Use the Applications -> utilities -> network utility app. Watch out -- there can be several interfaces on a system - be sure to chose the correct one. It looks like this:


    The sysctl command - try "man sysctl" for more info.

    % sysctl hw
    hw.machine = Power Macintosh
    hw.model = PowerMac6,1
    hw.ncpu = 1
    hw.byteorder = 4321
    hw.physmem = 1073741824
    hw.usermem = 986660864
    hw.pagesize = 4096
    hw.epoch = 1
    hw.vectorunit = 1
    hw.busfrequency = 133121428
    hw.cpufrequency = 999999997
    hw.cachelinesize = 32
    hw.l1icachesize = 32768
    hw.l1dcachesize = 32768
    hw.l2settings = 2147483648
    hw.l2cachesize = 262144
    hw.tbfrequency = 33181397