在OSX下使用命令行修改IP与网关

sudeMacBook-Pro-3:~ sujian$ networksetup -listnetworkserviceorder

An asterisk (*) denotes that a network service is disabled.

(1) Thunderbolt Ethernet

(Hardware Port: Thunderbolt Ethernet, Device: en4)


(2) Wi-Fi

(Hardware Port: Wi-Fi, Device: en0)


(3) iPhone USB

(Hardware Port: iPhone USB, Device: en5)


(4) Bluetooth PAN

(Hardware Port: Bluetooth PAN, Device: en3)


(5) Thunderbolt Bridge

(Hardware Port: Thunderbolt Bridge, Device: bridge0)

先使用networksetup -listnetworkserviceorder 找出所有网络端口服务名


再使用

networksetup -setmanual "Thunderbolt Ethernet" 10.1.5.127 255.255.255.0 10.1.5.254

来修改网关与ip,需要键入当前用户口令

你可能感兴趣的:(&,Swift)