Skip to content

Instantly share code, notes, and snippets.

@danielvcorreia
Last active March 11, 2024 16:41
Show Gist options
  • Select an option

  • Save danielvcorreia/2ec85e321cfd3f26a1c8f11377b09f9e to your computer and use it in GitHub Desktop.

Select an option

Save danielvcorreia/2ec85e321cfd3f26a1c8f11377b09f9e to your computer and use it in GitHub Desktop.
Finding host IP address

MacOS

Use ipconfig command to show a specific interface:

For Wi-Fi connection

ipconfig getifaddr en0

For Wired connection

ipconfig getifaddr en1

Use scutil command to show active interfaces and their IPv4/6 addresses (it does not show AWDL interfaces):

scutil --nwi

Linux

Use ifconfig command to show a specific interface:

For Wi-Fi connection

ifconfig wlan0

For Wired connection

ifconfig eth0

Use ifconfig command to display all the network interfaces that are currently up, including the loopback interface:

ifconfig

Windows

Use ipconfig command to display a specific TCP/IP interface:

For a Wi-Fi connection

ipconfig /renew Wireless*

For a Wired connection

ipconfig /renew Ethernet*

Use ipconfig command to display the full TCP/IP configuration for all adapters

ipconfig /all
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment