C.W.K.
Stream
Lesson 12 of 13 · published

networksetup (macOS)

~12 min · networksetup, macos, static-ip, dns, mtu

Level 0Pinger
0 XP0/101 lessons0/12 achievements
0/150 XP to next level150 XP to go0% complete

System Settings, 터미널에서

networksetup 이 macOS 의 System Settings → Network 패널 커맨드라인 인터페이스. UI 통해 할 수 있는 거 — static IP 설정, DNS 변경, DHCP 전환, jumbo frame 위한 MTU — 다 스크립트 가능. Fleet 자동화, dotfiles bootstrap, 반복 가능한 네트워크 config 원하는 어떤 시나리오에든 필수.

Code

검사·bash
# All hardware ports (Ethernet, Wi-Fi, Thunderbolt, USB-C)
networksetup -listallhardwareports

# Detailed info for a specific port
networksetup -getinfo "Ethernet"
networksetup -getinfo "Wi-Fi"

# Current DNS for a service
networksetup -getdnsservers "Wi-Fi"

# Current MTU
networksetup -getMTU "Ethernet"
설정·bash
# Set a static IP / mask / gateway
sudo networksetup -setmanual "Ethernet" 192.168.1.100 255.255.255.0 192.168.1.1

# Switch back to DHCP
sudo networksetup -setdhcp "Ethernet"

# Set DNS servers
sudo networksetup -setdnsservers "Wi-Fi" 1.1.1.1 8.8.8.8

# Clear custom DNS (revert to DHCP-provided)
sudo networksetup -setdnsservers "Wi-Fi" "Empty"

# Set MTU for jumbo frames on 10GbE (Track 7)
sudo networksetup -setMTU "Ethernet" 9000

External links

Exercise

networksetup -listallhardwareports 돌리고 각 인터페이스 식별. Wi-Fi 골라 — networksetup -getdnsservers "Wi-Fi". 그다음 networksetup -getMTU "Wi-Fi". 이 명령들 read-only — 변경 X. 핵심은 유창함 — System Settings 클릭 안 하고 터미널에서 어떤 네트워크 설정이든 검사 가능해야.

Progress

Progress is local-only — sign in to sync across devices.
이 페이지에서 버그를 발견하셨거나 피드백이 있으세요?문제 신고

댓글 0

🔔 답글 알림 (로그인 필요)
로그인댓글을 남기려면 로그인해 주세요.

아직 댓글이 없어요. 첫 댓글을 남겨보세요.