network-cfg (cfg is short for config) is a tool provided for setting network parameters, for example, setting a proxy for Wi-Fi.
network-cfg is supported since API version 20.
| Command | Description |
|---|---|
| help | Displays the commands supported by the tool. |
| set | Sets network parameters. |
network-cfg set -h
network-cfg set http_proxy [ip:port]
Example:
# Set a proxy for the current Wi-Fi. The host name is localhost, and the port number is 8080. network-cfg set http_proxy 127.0.0.1:8080 # Set a proxy for the current Wi-Fi. The host name is ip6-localhost, and the port number is 8080. network-cfg set http_proxy [::1] # Cancel the current Wi-Fi proxy. network-cfg set http_proxy 0