본문 바로가기

일반

macOS 에서 ip 명령어 사용하기

반응형

리눅스 계열에서도 점점 ifconfig 와 같은 명령어를 사용하지 않고, ip 명령어로 통합이 되어가고 있습니다.

macOS 에서도 ip 명령어를 사용하기 위해서는 아래와 같이 brew 를 통해 패키지 설치를 진행하면 됩니다.

brew 로 iproute2mac 설치

brew install iproute2mac

 

 

이제 mac 에서도 ip 명령어를 사용할 수 있습니다.

$ ip
Usage: ip [ OPTIONS ] OBJECT { COMMAND | help }
where  OBJECT := { link | addr | route | neigh }
       OPTIONS := { -V[ersion] |
                    -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
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 ac:bc:32:a2:39:07
	inet6 fe80::c70:a0ad:d012:fa69/64 secured scopeid 0x4
	inet 192.168.145.124/24 brd 192.168.145.255 en0
awdl0: flags=8943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST> mtu 1484
	ether 8e:fb:68:92:4f:66
	inet6 fe80::8cfb:68ff:fe92:4f66/64 scopeid 0x9
llw0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
	ether 8e:fb:68:92:4f:66
	inet6 fe80::8cfb:68ff:fe92:4f66/64 scopeid 0xa
utun0: flags=8051<UP,POINTOPOINT,RUNNING,MULTICAST> mtu 1380
	inet6 fe80::131:d72b:c122:7999/64 scopeid 0xb
utun1: flags=8051<UP,POINTOPOINT,RUNNING,MULTICAST> mtu 2000
	inet6 fe80::88e7:182b:4116:466e/64 scopeid 0xc
utun2: flags=8051<UP,POINTOPOINT,RUNNING,MULTICAST> mtu 1000
	inet6 fe80::ce81:b1c:bd2c:69e/64 scopeid 0xd

 

반응형