共用方式為


Netsh commands for Interface Internet Protocol version 4 (IPv4)

Applies To: Windows Server 2008

Netsh commands for Interface IPv4

You can use commands in the Netsh Interface IP context to configure the TCP/IP protocol (including addresses, default gateways, DNS servers, and WINS servers) and to display configuration and statistical information.

You can run these commands at the command prompt for the netsh interface ip context. For these commands to work at the command prompt, you must type netsh interface ip before typing commands and parameters as they appear in the syntax below.

For more information on Netsh, see Netsh Overviewand Enter a Netsh Context.

To view the command syntax, click a command:

  • add address

  • add dnsserver

  • add neighbors

  • add route

  • add winsserver

  • delete address

  • delete arpcache

  • delete destinationcache

  • delete dnsserver

  • delete neighbors

  • delete route

  • delete winsserver

  • dump

  • install

  • reset

  • set address

  • set compartment

  • set dnsserver

  • set dynamicportrange

  • set global

  • set interface

  • set neighbors

  • set route

  • set subinterface

  • set winsserver

  • show address

  • show compartments

  • show config

  • show destinationcache

  • show dnsservers

  • show dynamicportrange

  • show global

  • show icmpstats

  • show interfaces

  • show ipaddresses

  • show ipnettomedia

  • show ipstats

  • show joins

  • show neighbors

  • show offload

  • show route

  • show subinterfaces

  • show tcpconnections

  • show tcpstats

  • show udpconnections

  • show udpstats

  • show winsservers

add address

Adds an IP address and a default gateway on a specified interface configured with a static IP address.

Syntax

add address [name=]InterfaceName [addr=]IPAddress [mask=]SubnetMask[[gateway=] DefaultGateway [gwmetric=]GatewayMetric]

Parameters

  • [name=] InterfaceName
    Required. Specifies the name of the interface for which you want to add address and gateway information. The InterfaceName parameter must match the name of the interface as specified in Network Connections. If InterfaceName contains spaces, use quotation marks around the text (for example, "Interface Name").
  • [ addr=] IPAddress[ mask=] SubnetMask
    Required. Specifies the IP address to add and the subnet mask for that IP address.
  • [ gateway=] DefaultGateway[ gwmetric=] GatewayMetric
    Specifies the IP address of the default gateway to add and the metric for that default gateway.
  • /?
    Displays help at the command prompt.

add dnsserver

Adds a DNS server to a list of DNS servers for a specified interface.

Syntax

add dnsserver [name=]InterfaceName [addr=] DNSAddress [[index=]DNSIndex]

Parameters

  • [name=] InterfaceName
    Required. Specifies the name of the interface for which you want to add DNS information. The InterfaceName parameter must match the name of the interface as specified in Network Connections. If InterfaceName contains spaces, use quotation marks around the text (for example, "Interface Name").
  • [addr=] DNSAddress
    Required. Specifies the IP address of the DNS server to add.
  • [index=] DNSIndex
    Specifies the position of the added DNS server in the list of DNS servers for the interface.
  • /?
    Displays help at the command prompt.

Remarks

  • A lower number for the DNSIndex parameter corresponds to a higher preference. If no index is specified, then the server is added with the lowest preference.

add neighbors

Specifies an entry in the neighbor cache.

Syntax

add neighbors [interface=]<string>[address=]<IPv4Address> [neighbor=]<string> [subinterface=]<string>[[store=]active|persistent]

Parameters

  • [interface=]<string>
    Specifies an interface name or index.
  • [address=]<IPv4Address>
    Specifies the address of the neighbor.
  • [neighbor=]<string>
    Specifies the link layer address of the neighbor.
  • [subinterface=]<string>
    Specifies the LUID of the subinterface. This is only needed on interfaces with multiple subinterfaces.
  • [[store=]active|persistent]
    One of the following values:

    • active: Address will disappear on next boot.

    • Persistent (default): Address will be persistent.

Examples

This example command adds an entry to the neighbor cache on the interface named "Private."

add neighbors "Private" "10.1.1.1" "12-34-56-78-9a-bc"

add route

Adds a route for a specified prefix. Time values can be expressed in days (d), hours (h), minutes (m), and seconds (s). For example, 2d represents two days.

Syntax

add route [prefix=]IP4Address**/**Integer [[interface=]String] [[nexthop=]IPv4Address] [[siteprefixlength=]Integer] [[metric=]Integer] [[validlifetime=]{Integer | infinite}] [[preferredlifetime=]{Integer | infinite}] [[store=]{active | persistent}]

Parameters

  • [ prefix=] IPv6Address/Integer
    Required. Specifies the prefix for which to add a route. Integer specifies the prefix length.
  • [[ interface=] String]
    Specifies an interface name or index.
  • [[ nexthop=] IPv6Address]
    Specifies the gateway address, if the prefix is not on-link.
  • [[ siteprefixlength=] Integer]
    Specifies the prefix length for the entire site, if the prefix is not on-link.
  • [[ metric=] Integer]
    Specifies the route metric.
  • [[ validlifetime=]{ Integer| infinite}]
    Specifies the lifetime over which the route is valid. The default value is infinite.
  • [[ preferredlifetime=]{ Integer| infinite}]
    Specifies the lifetime over which the route is preferred. The default value is infinite.
  • [[ store=]{ active| persistent}]
    Specifies whether the change lasts only until the next boot (active) or is persistent (persistent). The default selection is persistent.

Examples

This example command adds a route on the interface named "Internet".

add route 10.2.0.0/16 "Internet" 10.0.0.1

add winsserver

Adds a WINS server to a list of WINS servers for a specified interface.

Syntax

add winsserver [name=]InterfaceName [addr=] WINSAddress [[index=]WINSIndex]

Parameters

  • [ name=] InterfaceName
    Required. Specifies the name of the interface for which you want to add WINS information. The InterfaceName parameter must match the name of the interface as specified in Network Connections. If InterfaceName contains spaces, use quotation marks around the text (for example, "Interface Name").
  • [ addr=] WINSAddress
    Required. Specifies the IP address of the WINS server to add.
  • [ index=] WINSIndex
    Specifies the position of the added WINS server in the WINS server list for that interface.
  • /?
    Displays help at the command prompt.

Remarks

  • A lower number for the WINSIndex parameter corresponds to a higher preference. If no index is specified, then the server is added with the lowest preference.

delete address

Deletes an IP address or a default gateway on a statically configured interface.

Syntax

delete address [name=]InterfaceName [addr=] IPAddress [[gateway=]{DefaultGateway | all}]

Parameters

  • [ name=] InterfaceName
    Required. Specifies the name of the interface for which you want to delete address and gateway information. The InterfaceName parameter must match the name of the interface as specified in Network Connections. If InterfaceName contains spaces, use quotation marks around the text (for example, "Interface Name").
  • [ addr=] IPAddress
    Required. Specifies the IP address to delete.
  • [ gateway=]{ DefaultGateway| all}
    Specifies whether to delete one default gateway or all default gateways. If only one default gateway should be deleted, DefaultGateway specifies the IP address of the default gateway to be deleted.
  • /?
    Displays help at the command prompt.

Remarks

  • This command will not delete the last IP address on the interface.

delete arpcache

Removes the entries in the Address Resolution Protocol (ARP) cache for a specified interface. Used without parameters, delete arpcache removes the entries in the ARP caches of all interfaces.

Syntax

delete arpcache [name=]<InterfaceName>

Parameters

  • [name=]<InterfaceName>
    Specifies the name of the interface for which you want to remove the ARP cache entries. The InterfaceName parameter must match the name of the interface as specified in Network Connections. If InterfaceName contains spaces, use quotation marks around the text (for example, "Interface Name").
  • /?
    Displays help at the command prompt.

delete destinationcache

Clears the destination cache. If an interface is specified, clears the cache only on that interface. If an address is also specified, deletes only that destination cache entry.

Syntax

delete destinationcache [[interface=]String] [[address=]IPv4Address]

Parameters

  • [[ interface=] String]
    Specifies an interface name or index.
  • [[ address=] IPv4Address]
    Specifies the address of the destination.

Remarks

When no parameters are specified, all entries in the destination caches for all interfaces are deleted.

Examples

This example command deletes the destination cache for the interface named "Private."

delete destinationcache "Private"

delete dnsserver

Deletes a DNS server or all DNS servers from a list of DNS servers for a specified interface or for all interfaces.

Syntax

delete dnsserver [name=]InterfaceName [addr=]{DNSAddress | all}

Parameters

  • [ name=] InterfaceName
    Required. Specifies the name of the interface for which you want to delete DNS information. The InterfaceName parameter must match the name of the interface as specified in Network Connections. If InterfaceName contains spaces, use quotation marks around the text (for example, "Interface Name").
  • [ addr=]{ DNSAddress| all}
    Required. Specifies whether to delete the address of one DNS server or all servers for all interfaces. If only one DNS server should be deleted, DNSAddress specifies the IP address of the DNS server to delete.
  • /?
    Displays help at the command prompt.

delete neighbors

Specifies that all entries in the neighbor cache are deleted. If an interface is specified, clears the cache only on that interface. If an address is also specified, deletes only that neighbor cache entry.

Syntax

delete neighbors [[interface=]String] [[address=]IPv4Address]

Parameters

  • [[ interface=] String]
    Specifies an interface name or index.
  • [[ address=] IPv4Address]
    Specifies the address of the neighbor.

Examples

This example command removes all entries from the neighbor cache on the interface named "Private."

delete neighbors "Private"

delete route

Deletes an IPv4 route.

Syntax

delete route [prefix=]IPv4Address**/**Integer [[interface=]String] [[nexthop=]IPv4Address] [[store=]{active | persistent}]

Parameters

  • [ prefix=] IPv4Address/Integer
    Required. Specifies the prefix of the route to delete.
  • [[ interface=] String]
    Specifies an interface name or index.
  • [[ nexthop=] IPv4Address]
    Specifies the gateway address, if the prefix is not on-link.
  • [[ store=]{ active| persistent}]
    Specifies whether the deletion lasts only until the next boot (active) or is persistent (persistent). The default selection is persistent.

Examples

This example command deletes a route from the interface named "Internet."

delete route 10.2/16 "Internet" 10.0.0.1

delete winsserver

Deletes a WINS server or servers from a list of WINS servers for a specified interface or all interfaces.

Syntax

delete winsserver [name=]InterfaceName [addr=]{WINSAddress | all}

Parameters

  • [ name=] InterfaceName
    Required. Specifies the name of the interface for which you want to delete a WINS server or servers. The InterfaceName parameter must match the name of the interface as specified in Network Connections. If InterfaceName contains spaces, use quotation marks around the text (for example, "Interface Name").
  • [ addr=]{ WINSAddress| all}
    Required. Specifies whether to delete only one server for an interface or all servers for all interfaces. If only one server should be deleted, WINSAddress specifies the IP address of the WINS server to delete.
  • /?
    Displays help at the command prompt.

dump

Displays the current configuration as a series of Netsh Interface IP commands.

Syntax

dump

Parameters

none

Remarks

  • To create a configuration script file, redirect the output of this command to a file.

install

Installs the IPv4 protocol. A reboot is required for the installation to take effect.

Syntax

install

reset

Resets the IPv4 configuration state. A reboot is required for changes to take effect.

Syntax

reset

set address

Configures an IP address and a default gateway on a specified interface.

Syntax

set address [name=]InterfaceName [source=]{dhcp | static [addr=]IPAddress[mask=]SubnetMask [gateway=]{none | DefaultGateway [[gwmetric=]GatewayMetric]}}

Parameters

  • [ name =] InterfaceName
    Required. Specifies the name of the interface for which you want to configure address and gateway information. The InterfaceName parameter must match the name of the interface as specified in Network Connections. If InterfaceName contains spaces, use quotation marks around the text (for example, "Interface Name").
  • [ source=]{ dhcp| static[ addr=] IPAddress[ mask=] SubnetMask[ gateway=]{ none| DefaultGateway[[ gwmetric=] GatewayMetric]}}
    Required. Specifies whether the IP address to configure originates from a Dynamic Host Configuration Protocol (DHCP) server or is static. If the address is static, IPAddress specifies the address to configure, and SubnetMask specifies the subnet mask for the IP address being configured. If the address is static, you must also specify whether you want to leave the current default gateway (if any) in place or configure one for the address. If you configure a default gateway, DefaultGateway specifies the IP address of the default gateway to be configured, and GatewayMetric specifies the metric for the default gateway to be configured.
  • /?
    Displays help at the command prompt.

Remarks

  • You can use this command to switch an interface between DHCP configuration and static configuration. If the interface is configured statically, the Domain Name System (DNS) and WINS server addresses for this interface must also be statically configured.

  • Omitting the DefaultGateway parameter does not clear gateway configuration but preserves whatever was previously configured.

set compartment

Modifies compartment configuration parameters.

Syntax

set compartment [compartment=]<integer> [defaultcurhoplimit=]<integer>[store=]active|persistent

Parameters

  • [compartment=]<integer>
    Specifies an interface name or index.
  • [defaultcurhoplimit=]<integer>[
    Specifies the address of the neighbor.
  • [[store=]active|persistent]
    One of the following values:

    • active: Address will disappear on next boot.

    • Persistent (default): Address will be persistent.

Example

set compartment compartment=1 defaultcurhoplimit=255 store=active

set dnsserver

Configures a DNS server address for a specified interface.

Syntax

set dnsserver [name=]InterfaceName [source=]{dhcp | static }[addr=]{IP Address | none} [register=]{none | primary | both}

Parameters

  • [ name=] InterfaceName
    Required. Specifies the name of the interface for which you want to set DNS information. The InterfaceName parameter must match the name of the interface as specified in Network Connections. If InterfaceName contains spaces, use quotation marks around the text (for example, "Interface Name").
  • [ source=]{ dhcp| static }
    Required. Specifies whether the IP address of the DNS server is configured by DHCP or is static.
  • [ addr=]{ IP Address| none }
    If the IP address is static, IP Address specifies the IP address of the DNS server to configure, and none specifies that the DNS configuration should be removed.
  • [ register=]{ none| primary| both }
    None specifies whether to disable dynamic update. Primary registers the computer name under the primary DNS suffix only. Both register the computer name under both the primary DNS suffix as well as under the connection-specific suffix.
  • /?
    Displays help at the command prompt.

Remarks

  • If the interface is already statically configured, the static parameter replaces the existing list of DNS server addresses with the one specified in the command.

  • Only if the [source] is static is the [addr] option available for configuring a static list of DNS server IP addresses for the specified interface.

Examples

set dnsserver name="Local Area Connection" source=dhcp

set dnsserver "Local Area Connection" static 10.0.0.1 primary

set dynamicportrange

Modifies the range of ports used for dynamic port assignment. Dynamic port assignment is also known as wildcard port assignment.

Syntax

set dynamicportrange [[protocol=]tcp|udp][startport=]<integer> [numberofports=]<integer>[[store=]active|persistent]

Parameters

  • [[protocol=[tcp|udp]
    One of the following values:

    • TCP: Display the dynamic port range for TCP.

    UDP: Display the dynamic port range for UDP.

  • [startport=]<integer>
    Specifies the starting port for dynamic port assignment.
  • [numberofports=]<integer>

    • Specifies the number of ports available for dynamic port assignment.
  • [[store=]active|persistent]
    One of the following values:

    • Active: Address will disappear on next boot.

Example

set dynamicportrange protocol=tcp startport=10000 numberofports=20000

set global

Modifies global configuration parameters.

Syntax

set global [[defaultcurhoplimit=]Integer] [[neighborcachelimit=]Integer][[routecachelimit=]Integer] [[reassemblylimit=]Integer] [[store=]{active | persistent}]

Parameters

  • [[defaultcurhoplimit=] Integer]
    Specifies the default hop limit of packets sent.
  • [[neighborcachelimit=] Integer
    Required. Specifies the maximum number of neighbor cache entries.
  • [[routecachelimit=] Integer]
    Specifies the maximum number of route cache entries.
  • [[reassemblylimit=] Integer]
    Specifies the maximum size of the reassembly buffer.
  • [[store=]active|persistent]
    Specifies whether the change lasts only until the next boot (active) or is persistent (persistent). The default selection is persistent.

Examples

This example command sets global parameters for all IPv6-enabled interfaces on the computer. The default hop limit is set to 32, the maximum number of neighbor cache entries is set to 100, and the maximum number of route cache entries is 100,000.

set global 32 100 100000

set interface

Modifies interface configuration parameters.

Syntax

set interface [[interface=]String] [[forwarding=]{enabled | disabled}] [[advertise=]{enabled | disabled}] [[mtu=]Integer] [[siteid=]Integer] [[metric=]Integer] [[firewall=]{enabled | disabled}] [[siteprefixlength=]Integer] [[store=]{active | persistent}]

Parameters

  • [[ interface=] String]
    Specifies an interface name or index.
  • [[ forwarding=]{ enabled| disabled}]
    Specifies whether packets arriving on this interface can be forwarded to other interfaces. The default selection is disabled.
  • [[ advertise=]{ enabled| disabled}]
    Specifies whether Router Advertisements are sent on this interface. The default selection is disabled.
  • [[ mtu=] Integer]
    Specifies the Maximum Transfer Unit (MTU) of this interface. The default MTU is the natural MTU of the link.
  • [[ siteid=] Integer]
    Specifies the site scope zone identifier.
  • [[ metric=] Integer]
    Specifies the interface metric, which is added to route metrics for all routes over the interface.
  • [[ firewall=]{ enabled| disabled}]
    Specifies whether to operate in firewall mode.
  • [[ siteprefixlength=] Integer]
    Specifies the default length of the global prefix for the entire site.
  • [[ store=]{ active| persistent}]
    Specifies whether the change lasts only until the next boot (active) or is persistent (persistent). The default selection is persistent.

Examples

This example command sets the interface with the name "Private," with a siteid of two and a metric of two. All other parameter values are left at the default values.

set interface "Private" siteid=2 metric=2

set neighbors

Sets an entry in the neighbor cache.

Syntax

set neighbors [[interface=]String] [[address=]IPv4Address] [neighbor=]<string> [[subinterface=]<string>][[store=]active*|*persistent]

Parameters

  • [[ interface=] String]
    Specifies an interface name or index.
  • [[ address=] IPv4Address]
    Specifies the address of the neighbor.
  • [neighbor=]<string>
    Specifies the link layer address of the neighbor.
  • [[subinterface=]<string>]
    Specifies the LUID of the subinterface. This is only needed on interfaces with multiple subinterfaces.
  • [[store=]active|persistent]
    One of the following values:

    • active: Address will disappear on next boot.

    • Persistent (default): Address will be persistent.

Examples

This example command sets an entry to the neighbor cache on the interface named "Private."

set neighbors "Private" "10.1.1.1" "12-34-56-78-9a-bc"

set route

Modifies route parameters. Time values can be expressed in days (d), hours (h), minutes (m), and seconds (s). For example, 2d represents two days.

Syntax

set route [prefix=]IPv4Address**/**Integer [[interface=]String] [[nexthop=]IPv4Address] [[siteprefixlength=]Integer] [[metric=]Integer] [publish=]{no | yes | immortal}] [[validlifetime=]{Integer | infinite}] [[preferredlifetime=]{Integer | infinite}] [[store=]{active | persistent}]

Parameters

  • [ prefix=] IPv6Address/Integer
    Required. Specifies the prefix (IPv6Address) and prefix length (Integer) of the route to modify.
  • [[ interface=] String]
    Specifies an interface name or index.
  • [[ nexthop=] IPv6Address]
    Specifies the gateway address, if the prefix is not on-link.
  • [[ siteprefixlength=] Integer]
    Specifies the prefix length for the entire site, if the prefix is not on-link.
  • [[ metric=] Integer]
    Specifies the route metric.
  • [[ publish=]{ no| yes| immortal}]
    Specifies whether routes are advertised (yes), advertised with an infinite lifetime (immortal), or not advertised (no) in Route Advertisements. The default selection is no.
  • [[ validlifetime=]{ Integer| infinite}]
    Specifies the lifetime over which the route is valid. The default value is infinite.
  • [[ preferredlifetime=]{ Integer| infinite}]
    Specifies the lifetime over which the route is preferred. The default value is infinite.
  • [[ store=]{ active| persistent}]
    Specifies whether the change lasts only until the next boot (active) or is persistent (persistent). The default selection is persistent.

Examples

This example command sets a route on the interface named "Internet."

set route 10.2.0.0/16 "Internet" 10.0.0.1 0 2 yes 5000 5000 store=active

set subinterface

Modifies subinterface configuration parameters.

Syntax

set subinterface [interface=]<string> [[mtu=]<integer>] [[subinterface=]<string>] [[store=]active|persistent]

  • [[ interface=] String]
    Specifies an interface name or index.
  • [[mtu=]<integer>]
    Specifies the MTU of this subinterface. The default is the natural MTU of the link.
  • [[subinterface=]<string>]
    Specifies the subinterface LUID. This is only required on interfaces with multiple subinterfaces.
  • [[ store=][active|persistent]
    Specifies whether active (active) or persistent (persistent) addresses are displayed. The default selection is active.

Example

set subinterface "1" mtu=1500 store=active

set winsserver

Sets WINS server configuration to either DHCP or static mode for a specified interface.

Syntax

set winsserver [name=]InterfaceName [source=]{dhcp | static [addr=]{WINSAddress | none }}

Parameters

  • [ name=] InterfaceName
    Required. Specifies the name of the interface for which you want to set WINS information. The InterfaceName parameter must match the name of the interface as specified in Network Connections. If InterfaceName contains spaces, use quotation marks around the text (for example, "Interface Name").
  • [ source=]{ dhcp| static[ addr=]{ WINSAddress| none}}
    Required. Specifies whether the IP address of the WINS server to configure should be assigned by DHCP or is static. If the IP address is static, WINSAddress specifies the IP address of the WINS server to configure, and none specifies that the WINS configuration should be removed.
  • /?
    Displays help at the command prompt.

Remarks

  • If the interface is already statically configured, the static parameter replaces the existing WINS server address list with the one specified in the set winsserver command.

show address

Displays information about static IP addresses and default gateways on a specified interface. Used without parameters, show address displays address information for all interfaces.

Syntax

show address [[name=]InterfaceName]

Parameters

  • [ name=] InterfaceName
    Specifies the name of the interface for which you want to display address information. The InterfaceName must match the name of the interface as specified in Network Connections. If InterfaceName contains spaces, use quotation marks around the text (for example, "Interface Name").
  • /?
    Displays help at the command prompt.

Remarks

  • For interfaces configured using DHCP, use the ipconfig command to display the assigned IP addresses, lease parameters, and other DHCP information.

show compartments

Displays information about all compartments, or about a given compartment if one is specified.

Syntax

show compartments [compartment=]<integer> [[level=]normal*|*verbose] [store=]active|persistent

Parameters

  • [compartment=]<integer>
    Specifies an interface name or index.
  • [[level=]normal|verbose]
    One of the following values:

    • normal: Display one line per compartment (default when no compartment is specified).

    • verbose: Display extra information about each compartment( default when a compartment is specified).

  • [[store=]active|persistent]
    One of the following values:

    • active: Address will disappear on next boot.

    • Persistent (default): Address will be persistent.

Example

show compartments

show config

Displays IP address and other configuration information for a specified interface. Used without parameters, show config displays configuration information for all interfaces.

Syntax

show config [[name=]InterfaceName]

Parameters

  • [ name=] InterfaceName
    Specifies the name of the interface for which you want to display configuration information. The InterfaceName parameter must match the name of the interface as specified in Network Connections. If InterfaceName contains spaces, use quotation marks around the text (for example, "Interface Name").
  • /?
    Displays help at the command prompt.

show destinationcache

Displays destination cache entries. If an interface is specified, displays the cache only on that interface. If an address is also specified, displays only that destination cache entry.

Syntax

show destinationcache [[interface=]String] [[address=]IPv4Address]

Parameters

  • [[ interface=] String]
    Specifies an interface name or index.
  • [[ address=] IPv4Address]
    Specifies the address of the destination.

show dnsservers

Displays the DNS configuration of a specified interface. Used without parameters, show dnsservers displays the DNS configurations of all interfaces.

Syntax

show dnsservers [[name=]InterfaceName]

Parameters

  • [ name=] InterfaceName
    Specifies the name of the interface whose DNS configuration you want to display. The InterfaceName parameter must match the name of the interface as specified in Network Connections. If InterfaceName contains spaces, use quotation marks around the text (for example, "Interface Name").
  • /?
    Displays help at the command prompt.

show dynamicportrange

Displays dynamic port range configuration parameters.

Syntax

show dynamicportrange [[protocol=]tcp|udp] [[store=]active|persistent]

Parameters

  • [[protocol=[tcp|udp]
    One of the following values:

    • TCP: Show the dynamic port range for TCP.

    • UDP: Show the dynamic port range for UDP.

  • [[store=]active|persistent]
    One of the following values:

    • Active: Address will disappear on next boot.

    • Persistent (default): Address will be persistent.

Example

show dynamicportrange

show global

Displays global configuration parameters.

Syntax

show global [[store=]{active | persistent}]

Parameters

  • [[ store=]{ active| persistent}]
    Specifies whether active (active) or persistent (persistent) information is displayed. The default selection is active.

show icmpstats

Displays ICMP statistics. Used without parameters, show icmp displays the statistics only once.

Syntax

show icmpstats [[rr=]RefreshRate]

Parameters

  • [ rr=] RefreshRate
    Specifies the refresh rate (the number of seconds between refreshing the display of the statistics).
  • /?
    Displays help at the command prompt.

show interfaces

Displays statistics for a specified interface. Used without parameters, show interfaces displays statistics for all interfaces only once.

Syntax

show interfaces [[index=]InterfaceIndex] [[rr=]RefreshRate]

Parameters

  • [ index=] InterfaceIndex
    Specifies the interface index, an integer that identifies the interface.
  • [ rr=] RefreshRate
    Specifies the refresh rate (the number of seconds between refreshing the display of the statistics).
  • /?
    Displays help at the command prompt.

Remarks

  • To obtain the interface index for an interface, review the output of the show interfaces command used without parameters.

show ipaddresses

Displays information for a specified IP address. Used without parameters, show ipaddresses displays information for all IP addresses on all interfaces once.

Syntax

show ipaddresses [[index=]IPAddress] [[rr=]RefreshRate]

Parameters

  • [ index=] IPAddress
    Specifies an IP address of an interface.
  • [ rr=] RefreshRate
    Specifies the refresh rate (the number of seconds between refreshing the display of the statistics).
  • /?
    Displays help at the command prompt.

Remarks

  • To obtain the IP addresses of all interfaces, review the display of the show ipaddresses command used without parameters.

show ipnettomedia

Displays the contents of the Address Resolution Protocol (ARP) cache, which contains the hardware addresses of resolved next-hop IP addresses. Used without parameters, show ipnettomedia displays the information once.

Syntax

show ipnettomedia [[rr=]RefreshRate]

Parameters

  • [ rr=] RefreshRate
    Specifies the refresh rate (the number of seconds between refreshing the display of the statistics).
  • /?
    Displays help at the command prompt.

show ipstats

Displays IP statistics. Used without parameters, show ipstats displays the statistics once.

Syntax

show ipstats [[rr=]RefreshRate]

Parameters

  • [ rr=] RefreshRate
    Specifies the refresh rate (the number of seconds between refreshing the display of the statistics).
  • /?
    Displays help at the command prompt.

show joins

Displays IP multicast groups that have been joined for the specified IP address. Used without parameters, show joins displays information for all IP addresses.

Syntax

show joins [[index=]IPAddress]

Parameters

  • [ index=] IPAddress
    Specifies an IP address of an interface.
  • /?
    Displays help at the command prompt.

Remarks

  • To obtain the IP addresses for all interfaces, review the display of the show ipaddress command used without parameters.

show neighbors

Displays neighbor cache entries. If an interface is specified, the command displays the cache only on that interface. If a subinterface is also specified, the command shows only the cache for that subinterface. If an address is specified as well, the command displays only that specific neighbor cache entry.

Syntax

show neighbors [[interface=]String] [[address=]IPv4Address] [neighbor=]<string> [[subinterface=]<string>][[store=]active*|persistent] [[level=]normal|*verbose]

Parameters

  • [[ interface=] String]
    Specifies an interface name or index.
  • [[ address=] IP4Address]
    Specifies the address of the neighbor.
  • [[subinterface=]<string>]
    Specifies the LUID of the subinterface. This is only needed on interfaces with multiple subinterfaces.
  • [[store=]active|persistent]
    One of the following values:

    • active: Address will disappear on next boot.

    • Persistent (default): Address will be persistent.

  • [[level=]normal|verbose]
    One of the following values:

    • normal: Display one line per subinterface (default when no subinterface is specified).

    • verbose: Display extra information on each subinterface. (default when a subinterface is specified).

Example

show neighbors

show offload

Displays the tasks that can be performed by the network adapter for the specified interface corresponding to installed network hardware. Used without parameters, show offload displays offload information for all interfaces corresponding to installed network hardware.

Syntax

show offload [[name=]InterfaceName ]

Parameters

  • [ name=] InterfaceName
    Specifies the name of the interface for which you want to display offload information. The InterfaceName parameter must match the name of the interface as specified in Network Connections. If InterfaceName contains spaces, use quotation marks around the text (for example, "Interface Name").
  • /?
    Displays help at the command prompt.

show route

Displays route table entries.

Syntax

show route [[level=]normal | verbose] [[store=]active | persistent]

Parameters

  • [[ level=] normal| verbose]
    Specifies whether only normal routes (normal) or routes used for loopback (verbose) are displayed. The default selection is normal.
  • [[ store=]active| persistent]
    Specifies whether active (active) or persistent (persistent) routes are displayed. The default selection is active.

show subinterfaces

Displays information about all subinterfaces, or about all subinterfaces on a given interface if one is specified.

Syntax

show subinterfaces [interface=]<string> [[ level=]normal| verbose] [[subinterface=]<string>] [[store=]active|persistent]

  • [[ interface=] String]
    Specifies an interface name or index.
  • [[ level=]normal|verbose]
    Specifies whether only normal routes (normal) or routes used for loopback (verbose) are displayed. The default selection is normal.
  • [[subinterface=]<string>]
    Specifies the subinterface LUID. This is only required on interfaces with multiple subinterfaces.
  • [[ store=][active|persistent]
    Specifies whether active (active) or persistent (persistent) addresses are displayed. The default selection is active.

Example

show subinterfaces

show tcpconnections

Displays information on a specified TCP connection. Used without parameters, show tcpconnections displays information for all TCP connections once.

Syntax

show tcpconnections [[index=]{LocalIPAddress | LocalPort | RemoteIPAddress | RemotePort}] [[rr=]RefreshRate]

Parameters

  • [ index=]{ LocalIPAddress| LocalPort| RemoteIPAddress| RemotePort}
    Specifies the connection about which to display information. The LocalIPAddress parameter specifies an IP address of an interface. The LocalPort parameter specifies a TCP port for a local process. The RemoteIPAddress parameter specifies an IP address of a remote host. The RemotePort parameter specifies a TCP port for a remote process.
  • [ rr=] RefreshRate
    Specifies the refresh rate (the number of seconds between refreshing the display of the information).
  • /?
    Displays help at the command prompt.

show tcpstats

Displays TCP statistics. Used without parameters, show tcpstats displays the statistics once.

Syntax

show tcpstats [[rr=]RefreshRate]

Parameters

  • [ rr=] RefreshRate
    Specifies the refresh rate (the number of seconds between refreshing the display of the statistics).
  • /?
    Displays help at the command prompt.

show udpconnections

Displays information about the (User Datagram Protocol) UDP ports used for each IP address. Used without parameters, show udpconnections displays UDP port information for all IP addresses once.

Syntax

show udpconnections [[index=]{LocalIPAddress | LocalPort}] [[rr=]RefreshRate]

Parameters

  • [ index=]{ LocalIPAddress| LocalPort}
    Specifies the connection about which to display information. The LocalIPAddress parameter specifies an IP address of an interface. The LocalPort parameter specifies a UDP port for a local process.
  • [ rr=] RefreshRate
    Specifies the refresh rate (the number of seconds between refreshing the display of the statistics).
  • /?
    Displays help at the command prompt.

show udpstats

Displays UDP statistics. Used without parameters, show udpstats displays the statistics once.

Syntax

show udpstats [[rr=]RefreshRate]

Parameters

  • [ rr=] RefreshRate
    Specifies the refresh rate (the number of seconds between refreshing the display of the statistics).
  • /?
    Displays help at the command prompt.

show winsservers

Displays the WINS configuration for a specified interface. Used without parameters, show winsservers displays the WINS configuration for all interfaces.

Syntax

show winsservers [[name=]InterfaceName]

Parameters

  • [ name=] InterfaceName
    Specifies the name of the interface whose WINS information you want to display. The InterfaceName parameter must match the name of the interface as specified in Network Connections. If InterfaceName contains spaces, use quotation marks around the text (for example, "Interface Name").
  • /?
    Displays help at the command prompt.

Netsh Interface IP example

The following command configures the interface named Local Area Connection with the static IP address 10.0.5.99, the subnet mask of 255.255.255.0, and a default gateway of 10.0.5.1:

set address name="Local Area Connection" source=static addr=10.0.5.99 mask=255.255.255.0 gateway=10.0.5.1 gwmetric=1

For information on how to interpret netsh command syntax, see Formatting Legend.