Getting Currently Connected Network/Wi-Fi IP Address with ipconfig Command on Linux
I’ll introduce how I got the IP address of the currently connected network/Wi-Fi on Linux using the ipconfig command.
I encountered a situation where I wanted to get only the connected IP address so I could pass it to other commands via xargs.
You can get the connected IP address by running the ipconfig command as follows:
ipconfig getifaddr en0
When I ran this on my macOS environment, I got the following result:
$ ipconfig getifaddr en0
192.168.0.3
That’s all from the Gemba on getting the IP address of currently connected network/Wi-Fi with the ipconfig command.