networksetup

文章目录

  • networksetup
  • 方法及使用
    • networkservice
    • hardwareports
    • computername
    • dhcp、route、domain
    • ipv4 & ipv6
    • dns
    • domain
    • 代理 proxy
      • ftp代理
      • 网页代理
      • 安全网页代理
      • 流代理
      • gopher 代理
      • 设置忽略这些主机与域的代理设置
    • 使用被动FTP模式
    • airport
    • preferredwirelessnetworks 首选网络
    • networkserviceenabled
    • MTU
    • media
    • VLAN
    • bond
    • pppoe
    • 802.1X
    • tls
    • systemprofile
    • location
    • profiles
  • manual

命令手册:

$ man networksetup

可以知道 networksetup 命令地址是:/usr/sbin/networksetup


The networksetup command is used to configure network settings typically configured inthe System Preferences application.  The networksetup command requires at least "admin"privileges to run. Most of the set commands require "root" privileges to run.Any flag that takes a password will accept "-" in place of the password to indicate itshould read the password from stdin.

networksetup 命令是用来配置 系统偏好设置中的 网络设置,networksetup 需要至少 admin 权限来运行。部分命令需要 root 权限。


方法及使用

networkservice

[-listnetworkserviceorder]
[-listallnetworkservices]
[-getinfo networkservice]

使用示例:
1

$ networksetup -getinfo "Wi-Fi"
DHCP Configuration
IP address: 10.2.5.1
Subnet mask: 255.255.0.0
Router: 10.24.0.1
Client ID:
IPv6: Automatic
IPv6 IP address: none
IPv6 Router: none
Wi-Fi ID: 88:88:98:cc:22:00

2

$ networksetup -listnetworkserviceorder
An asterisk (*) denotes that a network service is disabled.
(1) iPad USB
(Hardware Port: iPad USB, Device: en5)(2) iPhone USB
(Hardware Port: iPhone USB, Device: en4)(3) Wi-Fi
(Hardware Port: Wi-Fi, Device: en0)(4) Bluetooth PAN
(Hardware Port: Bluetooth PAN, Device: en3)(5) Thunderbolt Bridge
(Hardware Port: Thunderbolt Bridge, Device: bridge0)

3

$ networksetup -listallnetworkservices
An asterisk (*) denotes that a network service is disabled.
iPad USB
iPhone USB
Wi-Fi
Bluetooth PAN
Thunderbolt Bridge

hardwareports

[-listallhardwareports]
[-detectnewhardware]
[-getmacaddress hardwareport]

使用示例:

$ networksetup -listallhardwareportsHardware Port: Wi-Fi
Device: en0
Ethernet Address: 88:88:98:cc:22:00Hardware Port: Bluetooth PAN
Device: en3
Ethernet Address: 88:88:98:cc:22:01Hardware Port: Thunderbolt 1
Device: en1
Ethernet Address: 88:88:98:cc:22:02Hardware Port: Thunderbolt 2
Device: en2
Ethernet Address: 88:88:98:cc:22:03Hardware Port: Thunderbolt Bridge
Device: bridge0
Ethernet Address: 88:88:98:cc:22:04VLAN Configurations
===================

computername

[-getcomputername]
[-setcomputername computername]

dhcp、route、domain

[-setmanual networkservice ip subnet router]
[-setdhcp networkservice [clientid]]
[-setbootp networkservice]
[-setmanualwithdhcprouter networkservice ip]
[-getadditionalroutes networkservice]
[-setadditionalroutes networkservice [dest1 mask1 gate1] [dest2 mask2 gate2] ..
. [destN maskN gateN]]

使用示例:

$ networksetup -setmanual "Built-in Ethernet" 192.168.100.100 255.255.255.0 192.168.100.1

ipv4 & ipv6

[-setv4off networkservice]
[-setv6off networkservice]
[-setv6automatic networkservice]
[-setv6linklocal networkservice]
[-setv6manual networkservice address prefixLength router]
[-getv6additionalroutes networkservice]
[-setv6additionalroutes networkservice [dest1 prefixlength1 gate1] [dest2 prefi
xlength2 gate2] ... [destN prefixlengthN gateN]]

dns

[-getdnsservers networkservice]
[-setdnsservers networkservice dns1 [dns2] [...]]

使用示例:

$ networksetup -setdnsservers "Built-in Ethernet" 192.168.100.100 192.168.100.12$ networksetup -getdnsservers "Wi-Fi"
There aren't any DNS Servers set on Wi-Fi.$ networksetup -getdnsservers en0
en0 is not a recognized network service.
** Error: The parameters were not valid.

domain


[-getsearchdomains networkservice]
[-setsearchdomains networkservice domain1 [domain2] [...]]
[-create6to4service networkservicename]
[-set6to4automatic networkservice]
[-set6to4manual networkservice relayAddress]
networksetup -setsearchdomains "Built-in Ethernet" company.com corp.com

代理 proxy

ftp代理

[-getftpproxy networkservice]
[-setftpproxy networkservice domain portnumber authenticated username password]
[-setftpproxystate networkservice on | off]

网页代理

[-getwebproxy networkservice]
[-setwebproxy networkservice domain portnumber authenticated username password]
[-setwebproxystate networkservice on | off]
$ networksetup -setwebproxy "Built-in Ethernet" proxy.company.com 80$ networksetup -setwebproxy "Built-In Ethernet" proxy.company.com 80 On authusernameauthpassword

安全网页代理

[-getsecurewebproxy networkservice]
[-setsecurewebproxy networkservice domain portnumber authenticated username password]
[-setsecurewebproxystate networkservice on | off]

使用示例:

$ networksetup -getsecurewebproxy Wi-Fi
Enabled: No
Server:
Port: 0
Authenticated Proxy Enabled: 0
$ networksetup -getsecurewebproxy en6
** Error: Unable to find item in network database.

流代理

[-getstreamingproxy networkservice]
[-setstreamingproxy networkservice domain portnumber authenticated username password]
[-setstreamingproxystate networkservice on | off]

gopher 代理

[-getgopherproxy networkservice]
[-setgopherproxy networkservice domain portnumber authenticated username password]
[-setgopherproxystate networkservice on | off]
[-getsocksfirewallproxy networkservice]
[-setsocksfirewallproxy networkservice domain portnumber authenticated username password]
[-setsocksfirewallproxystate networkservice on | off]

使用示例:

[-getsocksfirewallproxy networkservice]
[-setsocksfirewallproxy networkservice domain portnumber authenticated username password]
[-setsocksfirewallproxystate networkservice on | off]

设置忽略这些主机与域的代理设置

[-getproxybypassdomains networkservice]
[-setproxybypassdomains networkservice domain1 [domain2] [...]]
[-getproxyautodiscovery networkservice]
[-setproxyautodiscovery networkservice on | off]

使用被动FTP模式

[-getpassiveftp networkservice]
[-setpassiveftp networkservice on | off]

使用示例:
1

$ networksetup -setwebproxy "Wi-Fi" 10.240.188.10 8080

2


$ sudo networksetup -getproxybypassdomains "Wi-Fi"
$ networksetup -setproxybypassdomains "Wi-Fi"   *.local、169.254/16、10.24

3

$ networksetup -getpassiveftp "Wi-Fi"
Passive FTP: Off

airport

[-getairportnetwork device]
[-setairportnetwork device network [password]]
[-getairportpower device]
[-setairportpower device on | off]

使用示例:
1

$ networksetup -getairportnetwork en0
Current Wi-Fi Network: MS480-5G$ networksetup -getairportnetwork en1
en1 is not a Wi-Fi interface.
** Error: Error obtaining wireless information.$ networksetup -setairportnetwork en0 WIFI_SSID_I_WANT_TO_JOIN WIFI_PASSWORD

preferredwirelessnetworks 首选网络

[-listpreferredwirelessnetworks hardwareport]
[-addpreferredwirelessnetworkatindex hardwareport network index securitytype [password]]
[-removepreferredwirelessnetwork hardwareport network]
[-removeallpreferredwirelessnetworks hardwareport]

使用示例:
列出来的都是什么鬼?。。。

$ networksetup -listpreferredwirelessnetworks en0
Preferred networks on en0:@PHICOMM_48@PHICOMM_480TP-LINK_CED0MITEA久赞311老北京饺子馆xiaocuzi帝曼斯多喜爱面馆欢迎光临NJTYxiaomi00710D2iOS测试机麦客披萨茶博会探鱼TanyuLEGEND FITNESSHoneyMoon_TeaRoomhaoyunqfang滋补皇WUMU

networkserviceenabled

[-getnetworkserviceenabled networkservice]
[-setnetworkserviceenabled networkservice on | off]
[-createnetworkservice networkservicename hardwareport]
[-renamenetworkservice networkservice newnetworkservicename]
[-getdnsservers networkservice newnetworkservicename]
[-removenetworkservice networkservice]
[-ordernetworkservices service1 [service2] [service3] [...]]

使用示例:

$ networksetup -getnetworkserviceenabled "Wi-Fi"
Enabled$ networksetup -getnetworkserviceenabled en0
en0 is not a recognized network service.
** Error: The parameters were not valid.$ networksetup -duplicatenetworkservice "Built-In Ethernet" "Local LAN"

MTU

[-getMTU hardwareport]
[-setMTU hardwarePort value]
[-listvalidMTUrange hardwareport]

使用示例:

$ networksetup -getMTU en0
Active MTU: 1500 (Current Setting: 1500)$ networksetup -getMTU "Wi-Fi"
Active MTU: 1500 (Current Setting: 1500)$ networksetup -setMTU en0 1500

media

[-getmedia hardwareport]
[-setmedia hardwareport subtype [option1] [option2] [...]]
[-listvalidmedia hardwareport]

使用示例:

$ networksetup -getmedia en0
Current: autoselect
Active: autoselect$ networksetup -setMedia en0 autoselect$ networksetup -setMedia en0 100baseTX half-duplex$ networksetup -listvalidmedia en0
autoselect

VLAN

[-createVLAN name parentdevice tag]
[-deleteVLAN name parentdevice tag] [-listVLANs]
[-listdevicesthatsupportVLAN]
[-isBondSupported device]
[-createBond name [device1] [device2] [...]] [-deleteBond bond]
[-addDeviceToBond device bond]
[-removeDeviceFromBond device bond] [-listBonds]
[-showBondStatus bond] 

使用示例:

$ networksetup -createBond MyBond en0 en1$ networksetup -addDeviceToBond en0 bond0

bond

[-isBondSupported device]
[-createBond name[device1][device2][...]]
[-deleteBond bond]
[-addDeviceToBond device bond]
[-removeDeviceFromBond device bond][-listBonds]
[-showBondStatus bond]

pppoe

[-listpppoeservices]
[-showpppoestatus name]
[-createpppoeservice device name account password [pppoeName]]
[-deletepppoeservice service]

使用示例:

$ networksetup -setpppoepassword MyPPPoE - < ~/Desktop/MyPasswordFile.txt

802.1X

[-import8021xProfiles service path]
[-export8021xProfiles service path yes | no][-export8021xUserProfiles path yes | no]
[-export8021xLoginProfiles service path yes | no]
[-export8021xSystemProfile service path yes | no]

使用示例:

$ networksetup -import8021xProfiles Ethernet "/Users/MyHome/Downloads/ExportedCon-figs.networkconnect"

tls


[-settlsidentityonsystemprofile service path passphrase]
[-settlsidentityonuserprofile profile path passphrase]
[-deletesystemprofile service]
[-deleteloginprofile service profile]
[-deleteuserprofile profile][-version][-help]
[-printcommands]

systemprofile

[-enablesystemprofile service on | off]
[-enableloginprofile service profile on | off]
[-enableuserprofile profile on | off]

location

[-getcurrentlocation]
[-createlocation location[populate]]
[-deletelocation location]
[-switchtolocation location]

profiles

[-listalluserprofiles]  //This command is no longer supported.
[-listloginprofiles service]//This command is no longer supported.

manual

-listnetworkserviceorderDisplays a list of network services in the order they are contacted for a connec-tion, along with the corresponding port and device for each. An asterisk (*) next toa service means the service is inactive.-listallnetworkservicesDisplays a list of all the network services on the server's hardware ports. Anasterisk (*) denotes that a network service is disabled.-listallhardwareportsDisplays list of hardware ports with corresponding device name and ethernet address.-detectnewhardwareDetects new network hardware and creates a default network service on the hardware.-getmacaddress hardwareportDisplays ethernet (or Wi-Fi) address for hardwareport or device specified.-getcomputernameDisplays the computer name.-setcomputername computernameSets computer name to <computername>. This name is used by AFP.-getinfo networkserviceDisplays the IP address, subnet mask, router, and hardware address for the <network-service> that you specify.-setmanual networkservice ip subnet routerSet the TCP/IP configuration for <networkservice> to manual with IP address set to<ip>, Subnet Mask set to <subnet>, and Router address set to <router>.-setdhcp networkservice [clientid]Use this command to set the TCP/IP configuration for the specified <networkservice>to use DHCP. The client ID is optional. Specify "Empty" for [clientid] to clear theDHCP client id.-setbootp networkserviceUse this command to set the TCP/IP configuration for the specified <networkservice>to use BOOTP.-setmanualwithdhcprouter networkservice ipUse this command to specify a manual IP address to use for DHCP for the specified<networkservice>.-getadditionalroutes networkserviceUse this command to display the list of additional IPv4 routes configured for theservice.-setadditionalroutes networkservice [dest1 mask1 gate1] [dest2 mask2 gate2] ... [destN maskNgateN]Use this command to set the list of IPv4 additional routes configured for the ser-vice. Each route is specified as a (destination address, subnet mask, gatewayaddress) tuple. Specifying no tuples clears the list of routes.-setv4off networkserviceUse this command to turn IPv4 off on the specified <networkservice>.-setv6off networkserviceUse this command to turn IPv6 off on the specified <networkservice>.-setv6automatic networkserviceUse this command to set IPv6 to get its addresses automatically for <networkser-vice>.-setv6linklocal networkserviceUse this command to set IPv6 to only use link local for <networkservice>.-setv6manual ip prefixlength routerUse this command to set IPv6 to get its addresses manually for <networkservice>.Specify the ip address, the prefix length and the router.-getv6additionalroutes networkserviceUse this command to display the list of additional IPv6 routes configured for theservice.-setv6additionalroutes networkservice [dest1 prefixlength1 gate1] [dest2 prefixlength2gate2] ... [destN prefixlengthN gateN]Use this command to set the list of additional routes configured for the service.Each route is specified as a(destination address, prefix length, gateway address) tuple. Specifying no tuplesclears the list of routes.-getdnsservers networkserviceDisplays DNS info for <networkservice>.-setdnsservers networkservice dns1 [dns2] [...]Use this command to specify the IP addresses of servers you want the specified <net-workservice> to use to resolve domain names. You can list any number of servers(replace dns1, dns2, and so on with the IP addresses of domain name servers). If youwant to clear all DNS entries for the specified network service, type "empty" inplace of the DNS server names.-getsearchdomains networkserviceDisplays Domain Name info for <networkservice>.-setsearchdomains networkservice domain1 [domain2] [...]Use this command to designate the search domain for the specified <networkservice>.You can list any number of search domains (replace domain1, domain2, and so on withthe name of a local domain). If you want to clear all search domain entries for thespecified network service, type aemptya in place of the domain name.-create6to4service -<newnetworkservicename>Use this command to create a new 6 to 4 service with name <newnetworkservicename>.-set6to4automatic -<newnetworkservicename>Use this command to set the 6 to 4 service such that it will get the relay addressautomatically.-set6to4manual -<newnetworkservicename> -<relayaddress>Use this command to set the 6 to 4 service such that it will get the relay addressmanually. Specify the <relayaddress> that you would like to set.-getftpproxy networkserviceDisplays FTP proxy (server, port, enabled value) info for <networkservice>.-setftpproxy networkservice domain portnumber authenticated username passwordSet FTP proxy for <networkservice> with <domain> and <port number>. Turns proxy on.Optionally, specify <on> or <off> for <authenticated> to enable and disable authen-ticated proxy support. Specify <username> and <password> if you turn authenticatedproxy support on.-setftpproxystate networkservice on | offSet FTP proxy on <networkservice> to either <on> or <off>.-getwebproxy networkserviceDisplays Web proxy (server, port, enabled value) info for <networkservice>.-setwebproxy networkservice domain portnumber authenticated username passwordSet Web proxy for <networkservice> with <domain> and <port number>. Turns proxy on.Optionally, specify <on> or <off> for <authenticated> to enable and disable authen-ticated proxy support. Specify <username> and <password> if you turn authenticatedproxy support on.-setwebproxystate networkservice on | offSet Web proxy on <networkservice> to either <on> or <off>.-getsecurewebproxy networkserviceDisplays Secure Web proxy (server, port, enabled value) info for <networkservice>.-setsecurewebproxy networkservice domain portnumber authenticated username passwordSet Secure Web proxy for <networkservice> with <domain> and <port number>. Turnsproxy on. Optionally, specify <on> or <off> for <authenticated> to enable and dis-able authenticated proxy support. Specify <username> and <password> if you turnauthenticated proxy support on.-setsecurewebproxystate networkservice on | offSet SecureWeb proxy on <networkservice> to either <on> or <off>.-setstreamingproxy networkservice domain portnumber authenticated username passwordSet Streaming proxy for <networkservice> with <networkservice>. Turns proxy on.Optionally, specify <on> or <off> for <authenticated> to enable and disable authen-ticated proxy support. Specify <username> and <password> if you turn authenticatedproxy support on.-setstreamingproxystate networkservice on | offSet Streamingproxy on <networkservice> to either <on> or <off>.-getgopherproxy networkserviceDisplays Gopher proxy (server, port, enabled value) info for <networkservice>.-setgopherproxy networkservice domain portnumber authenticated username passwordSet Gopher proxy for <networkservice> with <domain> and <port number>. Turns proxyon. Optionally, specify <on> or <off> for <authenticated> to enable and disableauthenticated proxy support. Specify <username> and <password> if you turn authenti-cated proxy support on.-setgopherproxystate networkservice on | offSet Gopher proxy on <networkservice> to either <on> or <off>.-getsocksfirewallproxy networkserviceDisplays SOCKS Firewall proxy (server, port, enabled value) info for <networkser-vice>.-setsocksfirewallproxy networkservice domain portnumber authenticated username passwordSet SOCKS Firewall proxy for <networkservice> with <domain> and <port number>. Turnsproxy on. Optionally, specify <on> or <off> for <authenticated> to enable and dis-able authenticated proxy support. Specify <username> and <password> if you turnauthenticated proxy support on.-setsocksfirewallproxystate networkservice on | offSet SOCKS Firewall proxy to  either <on> or <off>.-getproxybypassdomains networkserviceDisplays Bypass Domain Names for <networkservice>.-setproxybypassdomains networkservice domain1 [domain2] [...]Set the Bypass Domain Name Servers for <networkservice> to <domain1> [domain2][...]. Any number of Domain Name servers can be specified. Specify "Empty" for<domain1> to clear all Domain Name entries.-getproxyautodiscovery networkserviceDisplays Proxy Auto Discover for <networkservice>.-getpassiveftp networkserviceDisplays whether Passive FTP is on or off for <networkservice>.-setpassiveftp networkservice on | offSet Passive FTP to either <on> or <off>.-setautoproxyurl networkservice urlSet proxy auto-config to url for <networkservice> and enable it.-getautoproxyurl networkserviceDisplays proxy auto-config (url, enabled) info for <networkservice>.-setsocksfirewallproxystate networkservice on | offSet SOCKS Firewall proxy to  either <on> or <off>.-getairportnetwork hardwareportDisplays current Wi-Fi Network.-setairportnetwork hardwareport network [password]Set Wi-Fi Network to <network> using optional [password] if specified.-getairportpower hardwareportDisplays whether Wi-Fi power is on or off.-setairportpower hardwareport on | offSet Wi-Fi power to either <on> or <off>.-listpreferredwirelessnetworks hardwareportList the preferred wireless networks for <hardwareport>-addpreferredwirelessnetworkatindex hardwareport network index securitytype [password]Add wireless network named <network> to preferred list for <hardwareport> at<index>. Store the optional password in the keychain For security type, use OPEN fornone, WPA for WPA Personal, WPA2 for WPA2 Personal, WPA/WPA2 for WPA/WPA2 Personal,WPAE for WPA Enterprise, WPA2E for WPA2 Enterprise, WPAE/WPA2E for WPA/WPA2 Enter-prise, WEP for plain WEP, and 8021XWEP for 802.1X WEP.-removepreferredwirelessnetwork hardwareport networkRemove <network> from the preferred wireless network list for <hardwareport>-removeallpreferredwirelessnetworks hardwareportRemove all networks from the preferred wireless network list for <hardwareport>-getnetworkserviceenabled networkserviceDisplays whether a service is on or off (enabled or disabled).-setnetworkserviceenabled networkservice on | offUse this command to turn the specified network service on or off (enable or dis-able).-createnetworkservice networkservicename hardwareportCreate a service named <networkservice> on port <hardwareport>. The new service willbe enabled by default.-renamenetworkservice networkservice newnetworkservicenameUse this command to rename the specified network service <networkservice> to<newnetworkservicename>.-duplicatenetworkservice networkservice newnetworkservicenameUse this command to duplicate an existing network service <networkservice> andrename it to the specified name <newnetworkservicename>.-removenetworkservice networkserviceUse this command to delete a network service <networkservice>. You cannot use thiscommand to delete the last remaining service for a hardware port. To do so, you usethe -setnetworkserviceenabled command.-ordernetworkservices service1 [service2] [service3] [...]Use this command to designate the order network services are contacted on the speci-fied hardware port. Name the network you want contacted first, then the second, andso on. Use "listnetworkserviceorder" to view current service order. Note: use quotesaround service names which contain spaces (ie. "Built-in Ethernet").-setMTUAndMediaAutomatically hardwarePortSet hardwareport or device specified back to automatically setting the MTU andMedia.-getMTU hardwareportGet the MTU value for hardwareport or device specified.-setMTU hardwarePort valueSet MTU for hardwareport or device specified.-listValidMTURange hardwareportList the valid MTU range for hardwareport or device specified.-getMedia hardwareportShow both the current setting for media and the active media on hardwareport ordevice specified.-setMedia hardwareport subtype [option1] [option2] [...]Set media for hardwareport or device specified to subtype. Specify optional[option1] and additional options depending on subtype. Any number of valid optionscan be specified.-listValidMedia hardwareportList valid media options for hardwareport or device name. Enumerates available sub-types and options per subtype.-createVLAN name parentdevice tagCreate a VLAN with the name <name> over the parent device <parentdevice> and withthe tag <tag>.-deleteVLAN name parentdevice tagDelete the VLAN with the name <name> over the parent device <parentdevice> and withthe tag <tag>.-listVLANsList the VLANs that have been created.-listdevicesthatsupportVLANList the devices that support VLANs.-isBondSupported deviceDisplays YES if the device can be added to a bond. NO if it cannot.-createBond name [device1] [device2] [...]Create a bond with the user-defined-name name and optionally add any listed devicesif they support bonding.-deleteBond bondDelete the bond with the specified device-name.-addDeviceToBond device bondAdd device to bond.-removeDeviceFromBond device bondRemove device from bond.-listBondsList of all bonds.-showBondStatus bondDisplay the status of the specified bond.-listpppoeservicesList all PPPoE services in the current set.-showpppoestatus nameDisplay the status of the PPPoE service with the specified name.-createpppoeservice device name account password [pppoeName]Create a PPPoE service on the specified device with the service name specified.-deletepppoeservice serviceDelete the service.-setpppoeaccountname service accountSet the account name for the service.-setpppoepassword service passwordSet the password for the service.-connectpppoeservice serviceConnect the service.-disconnectpppoeservice serviceDisconnect the service.-listlocationsList all network locations.-getcurrentlocationDisplay the name of the current set.-createlocation location [populate]Create a set with the user-defined-name name and optionally populate it with thedefault services.-deletelocation locationDelete the set.-switchtolocation locationMake the specified set the current set.-listalluserprofilesDisplay the names of all of the user profiles.-listloginprofiles serviceDisplay the names of the loginwindow profiles for the specified service.-enablesystemprofile service on | offEnables or disables the system profile for the specified service.-enableloginprofile service profile on | offEnables or disables the specified loginwindow profile for the specified ser-vice.-enableuserprofile profile on | offEnables or disables the specified user profile.-import8021xProfiles service pathImports the 802.1x profiles for the specified service.-export8021xProfiles service path yes | noExports all of the profiles for the specified service and optionally includes theitems from the keychain.-export8021xUserProfiles path yes | noExports only the user profiles and optionally includes the items from the key-chain.-export8021xLoginProfiles service path yes | noExports only the loginwindow profiles for the specified service  and optionallyincludes the items from the keychain.-export8021xSystemProfile service path yes | noExports only the system profile for the specified service and optionally includesthe items from the keychain.-settlsidentityonsystemprofile service path passphraseSets the TLS identity on the system profile for the specified service. Identity mustbe a pkcs12 file.-settlsidentityonuserprofile profile path passphraseSets the TLS identity on the specified user profile. Identity must be a pkcs12 file.-deletesystemprofile serviceDeletes the system profile for the specified service.-deleteloginprofile service profileDeletes the specified loginwindow profile for the specified service.-deleteuserprofile profileDeletes the specified user profile.  Displays version of networksetup tool.-help   Displays a list of all the commands available in the Network Setup Tool, withexplanatory information.-printcommandsDisplays a list of commands with no detail.
-isBondSupported deviceDisplays YES if the device can be added to a bond. NO if it cannot.-createBond name [device1] [device2] [...]Create a bond with the user-defined-name name and optionally add any listed devicesif they support bonding.-deleteBond bondDelete the bond with the specified device-name.-addDeviceToBond device bondAdd device to bond.-removeDeviceFromBond device bondRemove device from bond.

macOS - networksetup 命令相关推荐

  1. macos终端命令_M-cli为初学者简化了macOS的最佳终端命令

    macos终端命令 You can do a lot with the macOS Terminal, but the commands tend to be obtuse. A free progr ...

  2. macOS 常用命令

    https://www.cnblogs.com/mangosoft/p/6375266.html macOS 常用命令 基本命令 1.列出文件 ls 参数 目录名 例:看看驱动目录下有什么:ls /S ...

  3. 【MacOS】命令行配置zsh以及powerlevel10k主题

    一.概述 前段时间在B站上看到有UP主在Manjaro Linux上使用了zsh并且配置一个超级炫酷的主题powerlevel9k:传送门.看了之后非常跃跃欲试,想在我的iMac上也配置一下,但是网上 ...

  4. macos launchctl命令

    本文以macOS上通过launchctl命令开机自动启动homebrew安装的wireguard服务来说明部分launchctl使用用法. 首先,需要写一个launch文件,后缀为.plist,格式为 ...

  5. macOS date 命令增减时间。

    mac date 命令使用 环境:系统 macOS Catalina 10.15.7 macOS 的 date 命令使用和 Linux 使用有稍许不同. 放上几个小例子做记录. macOS 增减日期命 ...

  6. MacOS 常用命令汇总

    文章目录 设置环境变量 列出所有可以更新的软件包 直接更新所有可以更新的软件包 打包压缩文件 忽略 Mac OS 文件系统中的扩展属性 忽略 Mac OS 专有的隐藏文件 创建 DMG 格式的文件 修 ...

  7. macOS终端命令行配置网络代理

    一.前言:   在下载一些需要vpn下载公司内网的源码或者认证时,必不可少的需要使用代理,与普通的网页及应用代理不同,在mac的终端中并没有开启默认的代理模式,所以需要手动进行设置,设置分为两部分:设 ...

  8. macOS - afconvert 命令(音频格式转换)

    afconvert 命令(音频格式转换) 文章目录 afconvert 命令(音频格式转换) 一.转换示例 1.wav --> acc 2.指定输出名称 3.aac --> caf 4.批 ...

  9. MacOS ping命令 |MacOS测试服务器连接|Mac ping服务器端口

    - MacOS请求服务器IP ping ip - MacOS 请求服务器IP:Port nc -vz -w 2 IP 端口 ## ping不通 root@localhost ~ % nc -vz -w ...

最新文章

  1. php开发之登录注册教程,PHP开发登录注册完整代码之注册PHP页面
  2. range() 和 np.arange()区别
  3. Chapter 02:复合 VS 继承
  4. 利用CSIDL打开特殊文件夹
  5. python全栈开发 * 08知识点汇总 * 180608
  6. vue echarts动态数据定时刷新
  7. linux线程调度与rtos,实时Linux和RTOS的基本特性及技术进行比较
  8. ffmpeg中的时间单位
  9. predict函数 R_R语言 动态贝叶斯网工具箱 dbnR学习笔记
  10. FreeRTOS 教程指南 学习笔记 第二章 内存管理
  11. Matlab求方差,均值
  12. 深入linux网络编程(四):使用asio搭建商用服务器
  13. 双击div变成可编辑区的简单实现
  14. [nRF52832] 外设篇 | 实验一 LED 灯 及 BUTTON 按键
  15. 计算机键盘锁不了怎么办,电脑键盘不能打字_电脑键盘锁住不能打字
  16. Android图形图像处理:马赛克(Mosaic)效果【直接可用】
  17. 删除 linux的ln文件夹,linux下添加链接与删除链接(ln命令的用法)
  18. 「Python开发者」公号招内容编辑
  19. 【Flutter】【path_provider】path_provider文件系统
  20. 013 gtsam/examples/ISAM2Example_SmartFactor.cpp

热门文章

  1. 阿里云镜像服务海外构建
  2. 离散数学-函数-复合函数+反函数-14
  3. 马克·安德森:创造互联网未来的人
  4. Python.习题四 循环结构
  5. JS 和 vue 时间倒计时(天、时、分、秒)
  6. Windows7 GHOST Ultimate x86 V2.0万能预装版
  7. FreeeBSD磁盘分区格式
  8. 写给身为程序员的一些话(非鸡汤,只是一些发自内心的话)
  9. linux-traps.c
  10. SCAU 8646 基数排序