In the realm of networking, understanding your IP address is as fundamental as knowing your device's MAC address. For Mac users, finding your IP address via the terminal can be a breeze, and it's a skill that comes in handy when you're troubleshooting network issues or configuring network services. Let's dive into the process, step by step.
Understanding IP Address and MAC Address
Before we proceed, let's quickly understand what IP and MAC addresses are. An IP (Internet Protocol) address is a unique numerical identifier assigned to each device connected to a computer network. It's how devices communicate with each other on the internet. On the other hand, a MAC (Media Access Control) address is a unique identifier assigned to a network interface controller (NIC) for use as a network address in communications within a network segment.
While MAC addresses are hardware-specific and set by the manufacturer, IP addresses can be changed and are typically assigned by your network's router or DHCP (Dynamic Host Configuration Protocol) server.

Finding Your IP Address on Mac via Terminal
The terminal on a Mac is a powerful tool that allows you to interact with your system at a lower level. Here's how you can use it to find your IP address:
Using the ifconfig Command
The `ifconfig` command is a classic in the Unix/Linux world, and it works just as well on MacOS. Here's how to use it:
- Open Terminal. You can do this by pressing Command + Space, typing "Terminal", and pressing Enter.
- Type `ifconfig` and press Enter. You'll see a lot of information about your network interfaces. Look for the line that starts with "inet" under the interface you're using (like "en0" for Ethernet or "awdl0" for Wi-Fi). The number next to "inet" is your IP address.
For example, you might see something like this:

en0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
inet 192.168.1.5 netmask 0xffffff00 broadcast 192.168.1.255
inet6 fe80::250:56ff:fe6e:914c%en0 prefixlen 64 scopeid 0x1
ether 24:6f:25:6e:91:4c
nd6 options=201<PERFORMNUD,ACCEPT_RTADV>
media: autoselect
status: active
In this case, the IP address is 192.168.1.5.
Using the ip addr Command
If you're using a newer version of MacOS, you might find that `ifconfig` is no longer available. In that case, you can use the `ip addr` command instead:
- Open Terminal.
- Type `ip addr` and press Enter. You'll see a list of network interfaces. Look for the one that's up (it will have a line starting with "state: UP") and has an inet address. The number next to "inet" is your IP address.
For example, you might see something like this:
2: en0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default
inet 192.168.1.5/24 brd 192.168.1.255 scope global dynamic noprefixroute
valid_lft 86399sec preferred_lft 86399sec
inet6 fe80::250:56ff:fe6e:914c/64 scope link noprefixroute
valid_lft forever preferred_lft forever
In this case, the IP address is 192.168.1.5.
Finding Your MAC Address on Mac via Terminal
While we're at it, let's also look at how to find your MAC address via the terminal. This can be useful when you're setting up network services or troubleshooting network issues.
To find your MAC address, you can use the `ifconfig` or `ip addr` command, just like we did to find your IP address. Look for the line that starts with "ether" or "link/ether" under the interface you're using. The number next to this line is your MAC address.
For example, you might see something like this:
en0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
inet 192.168.1.5 netmask 0xffffff00 broadcast 192.168.1.255
inet6 fe80::250:56ff:fe6e:914c%en0 prefixlen 64 scopeid 0x1
ether 24:6f:25:6e:91:4c
nd6 options=201<PERFORMNUD,ACCEPT_RTADV>
media: autoselect
status: active
In this case, the MAC address is 24:6f:25:6e:91:4c.
Conclusion
Finding your IP and MAC addresses on a Mac via the terminal is a straightforward process. Whether you're a seasoned network administrator or a curious user, understanding how to do this can be a valuable skill. It's a small step towards mastering the command line and unlocking the full potential of your Mac.