CLI wrapper for basic network utilites on Mac OS X inspired with iproute2 on Linux systems - ip command.
Python
1,062
190 commits
updated Oct 6, 2026
CLI wrapper for basic network utilities on macOS, inspired by iproute2 on Linux systems – ip, bridge and ss commands
Provided functionality is limited and command output is not fully compatible with iproute2.
Goal of this project is to make basic network configuration/debug tasks on macOS easy for admins who already use Linux systems.
For advanced usage use netstat, ifconfig, ndp, arp, route and networksetup directly.
If you are interested in contributing, please see our Contribution Guidelines.
A) [Preferred] Using Homebrew (Maintained by @brona):
# [Optional] Install Homebrew first, see http://brew.sh for options
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
# Install iproute2mac
brew install iproute2mac
See https://formulae.brew.sh/formula/iproute2mac and iproute2mac.rb for mode details.
B) Manual installation from HEAD:
sudo mkdir /usr/local/iproute2mac
sudo chown -R $(whoami):admin /usr/local/iproute2mac
cd /usr/local/
git clone https://github.com/brona/iproute2mac.git
ln -s iproute2mac/src/ip.py /usr/local/bin/ip
ln -s iproute2mac/src/bridge.py /usr/local/bin/bridge
ln -s iproute2mac/src/ss.py /usr/local/bin/ss
C) Using MacPorts (Maintained by @i0ntempest):
See https://ports.macports.org/port/iproute2mac/ and Portfile
D) Using NixOS (Maintained by @jiegec):
See https://search.nixos.org/packages?show=iproute2mac&type=packages&query=iproute2mac and package.nix
Goal of this utility is to provide compatible CLI with iproute2, supporting same command shortcuts and user experience.
ip helpip link helpip addr helpip route helpip neigh helpbridge helpbridge link helpss helpip linkip -br linkip link show en0ip link set dev en0 downip link set dev en0 upip link set dev en0 address 00:12:34:45:78:90ip link set en0 address randomip link set en0 address factoryip link set dev en0 mtu 9000ip neighip -4 neighip -6 neighip -4 neigh show dev en0ip -4 neigh show 192.0.2.0/24ip neigh flush dev en0ip -4 neigh flush dev en0ip addrip -br addrip -4 addrip -6 addrip addr add 10.0.0.5/24 dev en0ip addr del 10.0.0.5 dev en0ip routeip -6 routeip route flush cacheip route flush table mainip route show defaultip route get 8.8.8.8ip route add 192.168.0.0/16 nexthop 10.0.0.1ip route add default nexthop 10.0.0.1ip route replace 192.0.2.0/24 dev utun1ip route del 192.168.0.0/16bridge linkbridge link show dev en2ssss -lss -tss -uss -4ss -6ss -sss -aip -j link showip -j addr showip -j neigh showip -j route showbridge -j -p link showss -jip -color link showip -color=always link showip -color=auto link showip -color=never link showbridge and ss commandsss -l now shows only LISTENING sockets.subprocess.run()ss -H is now supported (--no-header)ip command parsing for degenerate cases.ss now correctly parses getopt style arguments (e.g. ss -nat).ip -4 addr shows only interfaces that have ipv4 address assigned (thanks @pluharok)-- and - parsing (https://github.com/brona/iproute2mac/pull/74, thanks @rrotter)ip route crashing with IndexError: pop from empty list bug introduced in v1.7.1ip addr and ip link returns results in ifindex order (https://github.com/brona/iproute2mac/issues/72)ip addr and ip link support up filter (https://github.com/brona/iproute2mac/issues/71)ip route list [[exact] PREFIX] selector (https://github.com/brona/iproute2mac/issues/66)ss command (https://github.com/brona/iproute2mac/issues/20 ,https://github.com/brona/iproute2mac/pull/70, thanks @luoling8192)-brief option for link and address modules (https://github.com/brona/iproute2mac/issues/42 ,https://github.com/brona/iproute2mac/pull/69 thanks @xraystyle)-oneline option for link and addr modules (https://github.com/brona/iproute2mac/issues/17 ,https://github.com/brona/iproute2mac/pull/62 thanks @waketzheng)--color with auto, always and never modes for show commands (https://github.com/brona/iproute2mac/issues/21 and https://github.com/brona/iproute2mac/issues/42, PR https://github.com/brona/iproute2mac/pull/63)ip neigh show not displaying lladdr in the outputip neigh show json output not matching iproute2 (state and router fields)--color option parsing-json option
(https://github.com/brona/iproute2mac/issues/49)bridge commandip ... show functions-color option is now being ignored
(https://github.com/brona/iproute2mac/issues/47, thanks @lexhuismans)--color as well as -colorip route add now ignores 2 additional arguments,ip r a 1.1.1.1 via 2.2.2.2 dev utun5 is interpreted as ip r a 1.1.1.1 via 2.2.2.2 (https://github.com/brona/iproute2mac/issues/45)ip neigh show dev en0
(https://github.com/brona/iproute2mac/issues/43, thanks @SimonTate)ip route add blackhole 192.0.2.0/24
(thanks @mhio)ip route flush cache no longer flushes anythingip route flush table main flushes all routesip neigh show 192.0.2.0/24 filters neighbours-help and -Versionip -4
(thanks @bsholdice)ip help
(thanks @KireinaHoro)ip neigh flush now requires specific device
(consistent behaviour with iproute2)ip route get now correctly shows src for IPv6 addresses (thanks @codeaholics)dev option to ip route add command (thanks @ThangCZ)ip route get commandip -6 neigh failing for N status flags shortcuts to show commands (thanks @vmoutoussamy)ip neigh flush (thanks @ThangCZ)dev option to ip neigh show and ip neigh flushifconfig: dev: bad value in ip addr delip addr inet rowsSee AUTHORS.
Used software/code:
1,724 followers · starred Jun 2018
194 followers · starred Mar 2026
471 followers · starred Feb 2025
99 followers · starred Nov 2017
CLI wrapper for basic network utilites on Mac OS X inspired with iproute2 on Linux systems - ip command.
Python
1,062
190 commits
updated Oct 6, 2026
CLI wrapper for basic network utilities on macOS, inspired by iproute2 on Linux systems – ip, bridge and ss commands
Provided functionality is limited and command output is not fully compatible with iproute2.
Goal of this project is to make basic network configuration/debug tasks on macOS easy for admins who already use Linux systems.
For advanced usage use netstat, ifconfig, ndp, arp, route and networksetup directly.
If you are interested in contributing, please see our Contribution Guidelines.
A) [Preferred] Using Homebrew (Maintained by @brona):
# [Optional] Install Homebrew first, see http://brew.sh for options
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
# Install iproute2mac
brew install iproute2mac
See https://formulae.brew.sh/formula/iproute2mac and iproute2mac.rb for mode details.
B) Manual installation from HEAD:
sudo mkdir /usr/local/iproute2mac
sudo chown -R $(whoami):admin /usr/local/iproute2mac
cd /usr/local/
git clone https://github.com/brona/iproute2mac.git
ln -s iproute2mac/src/ip.py /usr/local/bin/ip
ln -s iproute2mac/src/bridge.py /usr/local/bin/bridge
ln -s iproute2mac/src/ss.py /usr/local/bin/ss
C) Using MacPorts (Maintained by @i0ntempest):
See https://ports.macports.org/port/iproute2mac/ and Portfile
D) Using NixOS (Maintained by @jiegec):
See https://search.nixos.org/packages?show=iproute2mac&type=packages&query=iproute2mac and package.nix
Goal of this utility is to provide compatible CLI with iproute2, supporting same command shortcuts and user experience.
ip helpip link helpip addr helpip route helpip neigh helpbridge helpbridge link helpss helpip linkip -br linkip link show en0ip link set dev en0 downip link set dev en0 upip link set dev en0 address 00:12:34:45:78:90ip link set en0 address randomip link set en0 address factoryip link set dev en0 mtu 9000ip neighip -4 neighip -6 neighip -4 neigh show dev en0ip -4 neigh show 192.0.2.0/24ip neigh flush dev en0ip -4 neigh flush dev en0ip addrip -br addrip -4 addrip -6 addrip addr add 10.0.0.5/24 dev en0ip addr del 10.0.0.5 dev en0ip routeip -6 routeip route flush cacheip route flush table mainip route show defaultip route get 8.8.8.8ip route add 192.168.0.0/16 nexthop 10.0.0.1ip route add default nexthop 10.0.0.1ip route replace 192.0.2.0/24 dev utun1ip route del 192.168.0.0/16bridge linkbridge link show dev en2ssss -lss -tss -uss -4ss -6ss -sss -aip -j link showip -j addr showip -j neigh showip -j route showbridge -j -p link showss -jip -color link showip -color=always link showip -color=auto link showip -color=never link showbridge and ss commandsss -l now shows only LISTENING sockets.subprocess.run()ss -H is now supported (--no-header)ip command parsing for degenerate cases.ss now correctly parses getopt style arguments (e.g. ss -nat).ip -4 addr shows only interfaces that have ipv4 address assigned (thanks @pluharok)-- and - parsing (https://github.com/brona/iproute2mac/pull/74, thanks @rrotter)ip route crashing with IndexError: pop from empty list bug introduced in v1.7.1ip addr and ip link returns results in ifindex order (https://github.com/brona/iproute2mac/issues/72)ip addr and ip link support up filter (https://github.com/brona/iproute2mac/issues/71)ip route list [[exact] PREFIX] selector (https://github.com/brona/iproute2mac/issues/66)ss command (https://github.com/brona/iproute2mac/issues/20 ,https://github.com/brona/iproute2mac/pull/70, thanks @luoling8192)-brief option for link and address modules (https://github.com/brona/iproute2mac/issues/42 ,https://github.com/brona/iproute2mac/pull/69 thanks @xraystyle)-oneline option for link and addr modules (https://github.com/brona/iproute2mac/issues/17 ,https://github.com/brona/iproute2mac/pull/62 thanks @waketzheng)--color with auto, always and never modes for show commands (https://github.com/brona/iproute2mac/issues/21 and https://github.com/brona/iproute2mac/issues/42, PR https://github.com/brona/iproute2mac/pull/63)ip neigh show not displaying lladdr in the outputip neigh show json output not matching iproute2 (state and router fields)--color option parsing-json option
(https://github.com/brona/iproute2mac/issues/49)bridge commandip ... show functions-color option is now being ignored
(https://github.com/brona/iproute2mac/issues/47, thanks @lexhuismans)--color as well as -colorip route add now ignores 2 additional arguments,ip r a 1.1.1.1 via 2.2.2.2 dev utun5 is interpreted as ip r a 1.1.1.1 via 2.2.2.2 (https://github.com/brona/iproute2mac/issues/45)ip neigh show dev en0
(https://github.com/brona/iproute2mac/issues/43, thanks @SimonTate)ip route add blackhole 192.0.2.0/24
(thanks @mhio)ip route flush cache no longer flushes anythingip route flush table main flushes all routesip neigh show 192.0.2.0/24 filters neighbours-help and -Versionip -4
(thanks @bsholdice)ip help
(thanks @KireinaHoro)ip neigh flush now requires specific device
(consistent behaviour with iproute2)ip route get now correctly shows src for IPv6 addresses (thanks @codeaholics)dev option to ip route add command (thanks @ThangCZ)ip route get commandip -6 neigh failing for N status flags shortcuts to show commands (thanks @vmoutoussamy)ip neigh flush (thanks @ThangCZ)dev option to ip neigh show and ip neigh flushifconfig: dev: bad value in ip addr delip addr inet rowsSee AUTHORS.
Used software/code:
1,724 followers · starred Jun 2018
194 followers · starred Mar 2026
471 followers · starred Feb 2025
99 followers · starred Nov 2017