- Просмотр IP-адресов LAN-устройств из командной строки в Mac OS
- Найти IP-адреса локального устройства с помощью arp
- Как найти IP-адреса устройств в локальной сети с помощью ping & arp
- View IP Addresses of LAN Devices from Command Line in Mac OS
- Find Local Device IP Addresses with arp
- How to Find IP Addresses of Devices on a Local Network with ping & arp
- How do I find IP addresses of all other computers on my network?
- Mac os arp table
- Table of Content
- Overview
- How to Open Command Prompt
- ARP Syntax
- ARP Parameters
- Dynamic versus Static Entries
- Example Usage
- arp /a — Displays the Arp Cache Table for all Interfaces
- arp /d Inetaddr — Delete an Arp Entry
- arp /d — Delete the Entire Arp Cache
- arp /s — Manually Add an Entry to Arp Cache
- Other Usages and Getting Help
- Redirect Output to Text File
- Recommended Reading
- Summary
- MeridianOutpost
Просмотр IP-адресов LAN-устройств из командной строки в Mac OS
Если вам необходимо просмотреть IP-адреса другого оборудования в той же локальной сети (локальной сети), что и Mac, инструмент командной строки командной строки работает достаточно хорошо. Вы быстро найдете другие устройства IP и сопутствующие MAC-адреса, что упростит прямые сетевые подключения и будет полезно для многих других сетей и устранения неполадок.
Найти IP-адреса локального устройства с помощью arp
Для начала запустите приложение «Терминал» из / Приложения / Утилиты / (или получив доступ с помощью Spotlight и Command + Spacebar). Инструмент arp использует ARP (протокол разрешения адресов) для отображения и управления функциями разрешения сетевых адресов. Для целей, которые мы хотим достичь здесь, самое простое использование arp с прикрепленным флагом:
Это вернет устройства, найденные в локальной сети, включая другие компьютеры Mac, ПК, маршрутизаторы, iPhones и iPads, отображающие как их IP-адрес LAN, так и их индивидуальный MAC-адрес. (Для последнего вы можете помочь отличить аппаратное обеспечение, сопоставляя их с MAC-адресом, найденным в MacOS X или iOS).
Пример вывода arp -a выглядит следующим образом:
% arp -a
? (192.168.0.1) при 0: 0: ca: 1: 2: 3 на en0 ifscope [ethernet]
? (192.168.0.2) в 68: b8: 3d: 22: 1c: 42 на en0 ifscope [ethernet]
? (192.168.0.11) при b4: 12: 23: 5a: d3: 6f на en0 ifscope [ethernet]
? (192.168.0.255) в ff: ff: ff: ff: ff: ff на en0 ifscope [ethernet]
Как найти IP-адреса устройств в локальной сети с помощью ping & arp
Если выход не обновляется, или если отсутствует IP-адрес, который, по вашему мнению, должен быть там, выполните ping IP-адрес широковещательной передачи (обычно это последний результат arp -a, заканчивающийся на «255»), затем выполните arp — опять так.
Первый пинг широковещательного IP:
Терминал% ping 192.168.0.255
PING 192.168.0.255 (192.168.0.255): 56 байтов данных
64 байт от 192.168.0.6: icmp_seq = 0 ttl = 64 раз = 0,077 мс
64 байта из 192.168.0.1: icmp_seq = 0 ttl = 64 раз = 1,922 мс
— 192.168.0.255 ping статистика —
2 переданных пакета, 2 принятых пакета, +6 дубликатов, 0,0% потери пакетов
мин. / авг / макс / stddev = 0.079 / 39.404 / 303.510 / 75.738 мс
Затем запустите команду arp -a еще раз:
Терминал% arp -a
? (192.168.0.1) при 0: 0: ca: 1: 2: 3 на en0 ifscope [ethernet]
? (192.168.0.2) в 68: b8: 3d: 22: 1c: 42 на en0 ifscope [ethernet]
? (192.168.0.10) в 22: 12: bb: a0: 3d: fd на en0 ifscope [ethernet]
? (192.168.0.11) при b4: 12: 23: 5a: d3: 6f на en0 ifscope [ethernet]
? (192.168.0.255) в ff: ff: ff: ff: ff: ff на en0 ifscope [ethernet]
Обратите внимание, что в этом примере 192.168.0.10 представляет собой новый IP-адрес по сравнению с предыдущими результатами, поскольку эта машина только что присоединилась к сети.
Вы можете игнорировать предложение протокола в конце результатов arp, в этом примере, несмотря на устройства, показывающие как «сеть», они фактически все в беспроводной сети с wi-fi интерфейсом en0.
Обратите внимание, что вы не увидите собственный IP-адрес или MAC-адрес Mac в этом списке. В случае необходимости вы можете найти свой собственный IP-адрес через Terminal, System Preferences или используя внешнюю службу, если вы ищете внешний адрес.
Хотя arp работает достаточно хорошо для большинства случаев, и имеет то преимущество, что он встроен во все версии Mac OS X, этого может быть недостаточно для всех. Для более продвинутых пользователей nmap — еще лучший вариант для инструмента обнаружения сети, но nmap требует установки либо напрямую, либо с помощью источника, либо через что-то вроде homebrew.
Как найти IP-адреса всех других компьютеров в моей сети?
Вышеупомянутый пинг и трюк arp найдут и перечислит все IP-адреса любых устройств или компьютеров в сети. Это означает, что IP-адрес любого из подключенных к сети компьютеров Mac, ПК с ОС Windows, компьютеров Linux, устройств iOS, таких как iPhone и iPad, телефонов и планшетах Android в одной сети, даже установленные с поддержкой IP-адреса, такие как Apple TV или Playstation, будут что эти устройства и компьютеры подключены к той же локальной сети, что и компьютер, выполняющий поиск.
Знаете ли вы еще один полезный способ найти, найти и перечислить сетевые устройства и компьютеры в одной сети? Поделитесь им с нами в комментариях!
Источник
View IP Addresses of LAN Devices from Command Line in Mac OS
If you need to view the IP addresses of other hardware on the same LAN (Local Area Network) as a Mac, the command line arp tool works quite well. You’ll quickly find other devices IP and accompanying MAC addresses, which can make direct network connections easier and be helpful for many other network and troubleshooting purposes.
Find Local Device IP Addresses with arp
To get started, launch the Terminal app from /Applications/Utilities/ (or accessed with Spotlight and Command+Spacebar). The arp tool is uses ARP (Address Resolution Protocol) to display and control network address resolution functions. For the purposes we want to achieve here, the most simple use of arp is with an -a flag attached:
This will return devices found on the local network, including other Macs, PCs, routers, iPhones, and iPads, displaying both their LAN IP address as well as their individual MAC address. (For the latter, you can help distinguish hardware by matching them up to the MAC address found in MacOS X or in iOS).
An example of arp -a output looks like this:
% arp -a
? (192.168.0.1) at 0:0:ca:1:2:3 on en0 ifscope [ethernet]
? (192.168.0.2) at 68:b8:3d:22:1c:42 on en0 ifscope [ethernet]
? (192.168.0.11) at b4:12:23:5a:d3:6f on en0 ifscope [ethernet]
? (192.168.0.255) at ff:ff:ff:ff:ff:ff on en0 ifscope [ethernet]
How to Find IP Addresses of Devices on a Local Network with ping & arp
If the output doesn’t look up to date, or if it’s missing an IP you believe should be there, ping the broadcast IP (typically the last result of arp -a ending with “.255”), then run arp -a again like so.
First ping the broadcast IP:
Terminal% ping 192.168.0.255
PING 192.168.0.255 (192.168.0.255): 56 data bytes
64 bytes from 192.168.0.6: icmp_seq=0 ttl=64 time=0.079 ms
64 bytes from 192.168.0.1: icmp_seq=0 ttl=64 time=1.922 ms
— 192.168.0.255 ping statistics —
2 packets transmitted, 2 packets received, +6 duplicates, 0.0% packet loss
round-trip min/avg/max/stddev = 0.079/39.404/303.510/75.738 ms
Then run arp -a command again:
Terminal% arp -a
? (192.168.0.1) at 0:0:ca:1:2:3 on en0 ifscope [ethernet]
? (192.168.0.2) at 68:b8:3d:22:1c:42 on en0 ifscope [ethernet]
? (192.168.0.10) at 22:12:bb:a0:3d:fd on en0 ifscope [ethernet]
? (192.168.0.11) at b4:12:23:5a:d3:6f on en0 ifscope [ethernet]
? (192.168.0.255) at ff:ff:ff:ff:ff:ff on en0 ifscope [ethernet]
Note in this example that 192.168.0.10 is a fresh IP compared to the prior results, as that machine just joined the network.
You can ignore the protocol suggestion at the end of the arp results, in this example despite the devices showing as “ethernet”, they’re actually all on a wireless network with wi-fi on the en0 interface.
Do note that you will not see the Macs own IP address or MAC address in this list. If need be, you can find your own IP address through Terminal, System Preferences, or by using an outside service if you’re looking for the external address.
While arp works well enough for most cases, and it has the advantage of being built into all versions of Mac OS X, it may not be sufficient for everyone. For more advanced users, nmap is an even better option for a network discovery tool, but nmap requires installing either directly, compiling through source, or through something like homebrew.
How do I find IP addresses of all other computers on my network?
The above ping and arp trick will find and list all IP addresses of any devices or computers on the network. This means the IP address of any same network connected Mac computers, Windows PC, Linux machines, iOS devices like iPhone and iPad, Android phones and tablets on the same network, even set-top IP enabled boxes like an Apple TV or Playstation will be found, assuming those devices and computers are connected to the same local network as the computer doing the searching.
Do you know of another helpful way to to find, locate, and list network connected devices and computers on the same network? Share it with us in the comments!
Источник
Mac os arp table
The arp (address resolution protocol) is a simple Windows network command-line utility used to view and manage the arp cache. The arp cache is a collection of IP and MAC addresses of devices on your local network that your computer knows about. This tool is typically used in troubleshooting network issues.
The commands shown here are tested on computer with Windows 8 but most will work in other versions of Windows as well.
Table of Content
- Overview
- How to Launch Command Prompt
- Arp Syntax
- Arp Parameters
- Dynamic versus Static Entries
- Example Usage
- arp /a — Displays the Arp Cache Table of all Interfaces
- arp /d Inetaddr — Delete an Arp Entry
- arp /d — Delete the Entire Arp Cache
- arp /s — Manually Add an Entry to Arp Cache
- Other Usages and Getting Help
- Tips
- Redirect Output to Text File
- Recommended Reading
- Summary
Overview
Arp command (address resolution protocol) is used to view and manage the arp cache. The arp cache contains a dynamic list of IP addresses of the devices (computers, routers) your computer communicated with recently. More importantly, along with the IP address, the MAC address (the 6-byte ‘burned-in’ physical/hardware address) of the device is also stored in the cache.
The purpose for maintaining an arp cache is to improve network performance. When your computer communicates with a device, regardless of whether it is on your local network (e.g., file server) or is external to it (e.g., website, ftp server), your computer needs to know the MAC address of the device to communicate with it. In the case of external devices, your computer needs to communicate with your network router. Within the same network, all hosts communicate with each other by addressing each other by their MAC address.
By maintaining an arp table that maps an IP address to its associated MAC address of the device, your computer does not need to query the network for the MAC address each time it needs to communicate with it. When your computer needs to communicate with a device that is not in its arp cache, it will perform a network query (using arp) to get the MAC address. In essence, it asks «who has 192.168.128.64». The device that has this IP will reply back with its MAC address. This IP and MAC address mapping is then stored on your computer’s arp cache for quick lookup in future communication.
How to Open Command Prompt
To use this utility, you will need to launch the Command Prompt window. The three common ways to launch the Command Prompt window are:
- Search for cmd using the built-in Windows search tool.
- Right-click on the Start icon and select Command Prompt.
Press the keyboard combination WinKey + R , then type cmd at the Run window that appears.
Back to Top
ARP Syntax
ARP Parameters
Parameter | Description |
---|---|
/a [] [/n ] | Displays current arp cache tables for all interfaces. The /n parameter is case-sensitive. |
/g [] [/n ] | Identical to /a. |
/d [Inetaddr] | Deletes an entry with a specific IP address, where Inetaddr is the IP address in dotted decimal notation. |
/s [Inetaddr] [Etheraddr] | Adds a static entry to the arp cache that resolves the IP address Inetaddr to the physical address Etheraddr. |
/? | Displays help information. |
Dynamic versus Static Entries
In an arp cache table, you will typically find two types of entries — dynamic and static. A dynamic entry is an IP to MAC address pair that your computer has learned of itself during recent communication with that device. A static entry on the hand is one that was manually entered (or by the operating system) into the cache. Static entries will remain in the cache indefinitely unless explicitly removed. Dynamic entries will stay in cache unless they have not been used recently and the ARP cache timeout has expired.
Example Usage
There are a variety of switches (sub commands) available with the arp utility that will alter how it will function. At the most basic, the arp is used with teh /a switch to display the arp cache table of a computer.
arp /a — Displays the Arp Cache Table for all Interfaces
To view the arp cable table for all the interfaces (network adapters) on your computer, type the following in the command window then press Enter : arp /a
The screenshot example below is the arp output of a particular computer. The output of your result will differ. In our screenshot example, it shows 9 entries in the table.
The arp cache results are dynamic and displays the IP and MAC address of devices (computers, routers) your computer network communicated (e.g., ping, internal website) with recently that are on your network. The table does not display the IP address of websites, servers and other devices outside of your network. It will however, show the IP and MAC address of your router as it is the device your computer communicate with on your internal network to get to the external server.
arp /d Inetaddr — Delete an Arp Entry
The /d Inetaddr switch is used to delete an entry from the arp cache, where Inetaddr is the IP address.. On newer Windows operating system, this command requires elevated permission. See this article on how to launch command prompt in administrator mode. Although entries in the arp cache will automatically be removed if your computer has not communicated with it recently, being able to manually delete an entry is helpful particularly when you know an entry is incorrect or when performing network troubleshooting.
For example, to delete the entry with IP address of 192.168.1.100 from our above example screenshot, type the following in the command window then press Enter :
arp /d 192.168.1.100
If you display the cache once the delete command is issued, you will see the entry is no longer listed, as illustrated in the screenshot below.
arp /d — Delete the Entire Arp Cache
The /d switch when used without specifying an IP address will delete the entire arp cache. On newer Windows operating system, this command requires elevated permission. See this article on how to launch command prompt in administrator mode. Unless you are troubleshooting a network issue that requires it, deleting the entire arp cache is not typical. For most computers, deleting the entire cache has no adverse effect. Your computer will simply re-perform the arp look-ups find the MAC addresses when the need arises.
To delete the entire arp cache, type the following in the command window then press Enter :
If you display the cache once the delete command is issued, you will see the entire cache is empty (or near empty), as illustrated in the screenshot below. Depending on how soon you are viewing your arp cache after performing the delete command, you may already see your cache being re-populated as your computer continues re-learns them as it communicates with devices on your network.
arp /s — Manually Add an Entry to Arp Cache
The /s switch when used to manually add an entry to the arp cache. To add the IP address 192.168.128.100 to the physical address of 00-11-22-AA-BB-CC, type the following in the command window then press Enter :
arp /s 192.168.128.100 00-11-22-AA-BB-CC
On newer Windows operating system, this command requires elevated permission. See this article on how to launch command prompt in administrator mode.
If you display the cache once the add command is issued, you will see the cache now shows the entry you added, as illustrated in the screenshot below. Additionally, because it is manually added, this entry is flagged as a static entry..
Other Usages and Getting Help
The example usage described in the article shows only some of the functions available with arp. To get a list of the available switches, type the following in the command window then press Enter : arp /?
Redirect Output to Text File
- Instead of displaying the results on the screen, you can have the results saved automatically to a text file on your computer. To do this, simply use the «>» symbol followed by the folder path and file name of your choice. For example, to redirect the output of ipconfig /renew, type the following in the command window then press Enter :
arp /a > c:\temp\arp-results.txt
This will create a file named arp-results.txt in the folder path c:\temp that will have your result. You can then open this file with any text editor, such as Notepad on a Windows computer, as illustrated below.
Recommended Reading
An investment in knowledge always pays the best interest.
Summary
You will likely not find a need to examine an ARP cache for most of your troubleshooting work. However, understanding the purpose and the use of ARP is fundamental for any networking professional as it employs basic TCP/IP communication concepts.
Windows Command Line Administration Instant Reference
by John Paul Mueller
Windows Command-Line Administrator’s Pocket Reference
by William R. Stanek
The Complete Guide to Scripting Microsoft’s Command Shell
MeridianOutpost
We provide small businesses with a single source for Information Technology needs. Our specialty includes PC support, networking, information assurance and custom systems and database application design.
Источник