PowershellでARPテーブルを確認するときはGet-NetNeighborコマンドレットが使える
環境
PS C:\> #OSのVersion PS C:\> "$((get-wmiobject win32_operatingsystem).caption) ($((get-wmiobject win32_operatingsystem).version))" Microsoft Windows 10 Pro (10.0.10586) PS C:\> #Powershellのバージョン PS C:\> $PSVersionTable.PSVersion Major Minor Build Revision ----- ----- ----- -------- 5 0 10586 494
使用例
PS C:\> Get-NetNeighbor ifIndex IPAddress LinkLayerAddress State PolicyStore ------- --------- ---------------- ----- ----------- 4 192.0.2.1 00-00-5E-00-53-01 Permanent ActiveStore
項目の意味
No. | Name | Meaning |
---|---|---|
1 | ifIndex | インターフェースインデックス |
2 | IPAddress | IPアドレス |
3 | LinkLayerAddress | MACアドレス |
4 | State | キャッシュの状態*1 |
5 | PolicyStore | キャッシュの種類。
|
用語
No. | Name | Meaning |
---|---|---|
1 | the neighbor cache | the Address Resolution Protocol (ARP) cacheのこと。 日本語にすると「近隣キャッシュ」らしい。ヘルプでも素直にARPキャッシュと書いてほしい。 |
2 | LinkLayerAddress | データリンク層のアドレス、ということでMACアドレスのことを指す。参考:link-layer address |
参考
また、Powershellのお決まりのコマンド名でARPテーブルの編集も可能。
- New-NetNeighbor⇒新規作成
- Remove-NetNeighbor⇒削除
- Set-NetNeighbor⇒設定変更
その他
日本語でググってもコマンドレットが見つからなかったので以下でヘルプを検索した*2。
PS C:\> Get-Help ARP Name Category Module Synopsis ---- -------- ------ -------- Disable-NetAdapterPowerManagement Function NetAdapter Disables specific power management features on the network adapter. Enable-NetAdapterPowerManagement Function NetAdapter Enables specific power management features on the network adapter. Set-NetAdapterPowerManagement Function NetAdapter Sets the power management properties on the network adapter. Get-NetIPInterface Function NetTCPIP Gets an IP interface. Get-NetNeighbor Function NetTCPIP Gets neighbor cache entries. Get-NetOffloadGlobalSetting Function NetTCPIP Gets the global TCP/IP offload settings. Set-NetIPInterface Function NetTCPIP Modifies an IP interface. Set-NetOffloadGlobalSetting Function NetTCPIP Modifies the global TCP/IP offload settings. New-PSSessionConfigurationFile Cmdlet Microsoft.PowerShell.Core Creates a file that defines a session configuration. Add-Type Cmdlet Microsoft.PowerShell.U... Windows PowerShell セッションに、Microsoft .NET Framework の型 (クラス) を追加します。
追記
2016-09-09 本文中のコマンド名の誤りを修正。
*1:詳細はコマンドのオンラインヘルプに記載ありGet-NetNeighbor
*2:ARPで検索したとき、Get-NetNeighborは表示されるが、New-/Remove-/Set-が表示されないのは正直どうかと思う