คุณสามารถใช้ในการติดตั้งbrew iproute2macจริงๆแล้วมันเป็น Piper wrapper ที่ให้ API ที่คล้ายกันมากซึ่งคุณอาจจะคุ้นเคยกับipเครื่องมือที่มาพร้อมกับiproute2Linux
การติดตั้ง
$ brew install iproute2mac
==> Installing iproute2mac from brona/homebrew-iproute2mac
==> Downloading https://github.com/brona/iproute2mac/archive/v1.0.3.zip
######################################################################## 100.0%
🍺 /usr/local/Cellar/iproute2mac/1.0.3: 4 files, 24K, built in 2 seconds
การใช้
เมื่อติดตั้งแล้วคุณจะได้รับเครื่องมือบรรทัดคำสั่งเพื่อจุดประสงค์ทั้งหมดเลียนแบบipคำสั่งบน Linux
$ ip
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 บนอินเทอร์เฟซ en0
$ ip addr show en0
en0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
ether 54:46:12:fc:45:12
inet6 fe80::3636:3bff:fecf:1294/64 scopeid 0x4
inet 192.168.1.5/24 brd 192.168.1.255 en0
แสดงรายละเอียดเกี่ยวกับลิงค์ en1
$ ip link show en1
en1: flags=8963<UP,BROADCAST,SMART,RUNNING,PROMISC,SIMPLEX,MULTICAST> mtu 1500
options=60<TSO4,TSO6>
ether 72:00:08:81:d2:10
media: autoselect <full-duplex>
status: inactive
อ้างอิง