ipconfig
How should this situation be resolved?
MacBook Pro 13″, macOS 13.0
How should this situation be resolved?
MacBook Pro 13″, macOS 13.0
You need to give it a specific interface and request the ip as shown above.
ipconfig getifaddr <interfacename>
You can verify the available interfaces by using the ipconfig getiflist command.
Normally en0 is the main interface, either wi-fi or ethernet. So ipconfig getifaddr en0 should provide the IP address.
You need to give it a specific interface and request the ip as shown above.
ipconfig getifaddr <interfacename>
You can verify the available interfaces by using the ipconfig getiflist command.
Normally en0 is the main interface, either wi-fi or ethernet. So ipconfig getifaddr en0 should provide the IP address.
JokerQian wrote:
Before, ipconfig could see the IP address directly, but now can not see the ip address directly
You're probably remembering ifconfig here, and not ipconfig command. (What you see here is what ipconfig has long done.)
systemsetup and networksetup and airport and networkQuality are some other commands in this same general area, as well.
In your Bash or Zsh dot file, enter the following:
alias localIP='ifconfig -l | xargs -n1 ipconfig getifaddr'
and invoked at the shell as:
localIP
The syntax tells ifconfig to feed every available network interface at ipconfig and when one has the local IP address, it is returned. Cuts down on guesswork.
What situation? Resolve what?
It's telling you it expects some command or argument. There's nothing to resolve beyond providing a correct command and argument.
What are you trying to accomplish?
You can type: ipconfig getiflist
to get the list of interfaces.
Or you can type ipconfig getifaddr <interfacename> to get the IP address of a specific interface.
Since you are in the Terminal:
man ipconfig
user% ipconfig -all
this will show interfaces which up, connected, and running. If you know the particular interface you can
user% ipconfig en0 for Ethernet port
or ipconfig en1 for wireless port
it should say connected and running, as well as report the ip address of each
One of the principles that the hosts expect of us is that we test something before we post it.
It is bad enough that you don't know the difference between ipconfig and ifconfig, but none of the syntax that you offer works either. You would have discovered this immediately had you tested, or at least reviewed some of the preceding posts.
Before, ipconfig could see the IP address directly, but now can not see the ip address directly
ipconfig