覚えたら書く

IT関係のデベロッパとして日々覚えたことを書き残したいです。twitter: @yyoshikaw

macOS - ipコマンドを使えるようにする

素の状態だとmacOSで ip コマンド使えないんですね。

Homebrewで iproute2mac をインストールして使えるようにしましょう。


とりあえず、念のためにHomebrewで iproute2mac を検索します。(以下コマンドを実行)

brew search iproute2mac


実際に実行した結果が以下。ちゃんと存在するようです。

yukiMacBook-Pro:~ yuki$ brew search iproute2mac
==> Formulae
iproute2mac


以下コマンドを実行してインストールします。

brew install iproute2mac


実際に実行した結果が以下。インストールが完了しました。

yukiMacBook-Pro:~ yuki$ brew install iproute2mac
==> Downloading https://github.com/brona/iproute2mac/releases/download/v1.2.3/iproute2mac-1.2.3.tar.gz
==> Downloading from https://github-production-release-asset-2e65be.s3.amazonaws.com/24814763/b7be4f00-ec67-11e9-8e0e-de
######################################################################## 100.0%
🍺  /usr/local/Cellar/iproute2mac/1.2.3: 6 files, 22.5KB, built in 5 seconds


これで、 ip コマンドが使えるようになりました。

というわけで念のために実行。

yukiMacBook-Pro:~ yuki$ ip help
Usage: ip [ OPTIONS ] OBJECT { COMMAND | help }
       ip -V
where  OBJECT := { link | addr | route | neigh }
       OPTIONS := { -4 | -6 }

iproute2mac
Homepage: https://github.com/brona/iproute2mac
This is CLI wrapper for basic network utilities on Mac OS X inspired with iproute2 on Linux systems.
Provided functionality is limited and command output is not fully compatible with iproute2.
For advanced usage use netstat, ifconfig, ndp, arp, route and networksetup directly.


ip addr show の実行も問題なしです

yukiMacBook-Pro:~ yuki$ ip addr show
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 16384
    inet 127.0.0.1/8 lo0
    inet6 ::1/128
    inet6 fe80::1/64 scopeid 0x1
en0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
    ether 8c:86:90:08:e4:52
    inet6 fe80::18d3:99ad:79e9:c77f/64 secured scopeid 0x6
    inet6 240b:12:4e60:9800:101e:b5ab:84f2:9c38/64 autoconf secured
    inet6 240b:12:4e60:9800:9518:71c8:b3f:74f6/64 autoconf temporary
    inet 192.168.10.8/24 brd 192.168.10.255 en0
awdl0: flags=8943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST> mtu 1484
    ether 5a:61:5d:87:05:90
    inet6 fe80::5870:5cff:fe78:590/64 scopeid 0x8
utun0: flags=8051<UP,POINTOPOINT,RUNNING,MULTICAST> mtu 2000
    inet6 fe80::2b9e:f27c:48de:6a0c/64 scopeid 0xc
utun1: flags=8051<UP,POINTOPOINT,RUNNING,MULTICAST> mtu 1380
    inet6 fe80::4a46:be16:5cd1:2038/64 scopeid 0xd



関連エントリ