您的位置:首页 > 其它

Netsh Commands for Interface (IPv4 and IPv6)

2014-04-19 17:47 741 查看
You can use commands in the Netsh Interface context and subcontexts to configure the TCP/IP version 4 protocol (including addresses, default gateways, Domain Name System (DNS) and WINS servers) and to display configuration and statistical information for IPv4.In addition, you can use commands in this context and related subcontexts (6to4, isatap, portproxy, and teredo) to configure Internet Protocol version 6 (IPv6).The netsh interface context contains the following commands:add

delete

reset

set credentials

set interface

show credentials

show interface

To run these commands from the command prompt, you must either enter the netsh interface context or prepend the context to the command. For example, if you are at the command prompt but have not typed netsh and then interface to enter the netsh interface context, you must type:netsh interface commandWhere command is the command that you want to run, including all of the required parameters for the command.The Netsh Interface context also includes several subcontexts.

Subcontexts of Netsh Interface

This context provides the following subcontexts:

Subcontext nameResult
6to4Changes to the netsh interface 6to4 context.
HTTPSTunnelnetsh interface HTTPSTunnel
ipv4Changes to the netsh interface ipv4 context.
ipv6Changes to the netsh interface ipv6 context.
isatapChanges to the netsh interface isatap context.
portproxyChanges to the netsh interface portproxy context.
tcpChanges to the netsh interface tcp context.
teredoChanges to the netsh interface teredo context.

Formatting legend

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

Netsh Interface command reference

Following are the details for the commands in the Netsh Interface context.

add

Adds an interface to the router. For full interfaces, a phone book entry with the same name must already exist on the system.Syntaxadd [name=] Name [[type=]full]ParametersnameRequired. Specifies the name of the interface to be added.typeOptional. Specifies that a demand dial interface is created when full is designated.ExamplesFollowing is an example of the add interface command that creates a demand dial interface.add name="Demand-Dial Interface" type=full

delete

Deletes an interface from the router.Syntaxdelete [ name= ] NameParametersnameRequired. Specifies the name of the interface to be deleted.Examples:The following example command deletes a demand dial interface at the routerdelete name="Demand-Dial Interface"

reset

Deletes all of the interfaces that can be added through this context.Syntaxreset

set credentials

Specifies the credentials that are used to connect to or add an interface.Syntaxset credentials [ name= ] InterfaceName [ user= ]UserName [[ domain= ] Domain [password=] Password ]ParametersInterfaceNameRequired. Specifies the name of the interface that you want to add.UserNameRequired. Specifies the user account name that has the required permissions to add an interface.DomainOptional. Specifies the domain where the user account is located.PasswordOptional. Specifies the password of the user account.ExamplesFollowing are two examples of the set credentials command.set credentials name="Demand-Dial Interface" user=guestset credentials name="Demand-Dial Interface" user=admin domain=mydomain password=mypassword

set interface

Changes the parameters for an existing interface.Syntaxset interface [name = ] IfName [ [admin = ] ENABLED|DISABLED [connect = ] CONNECTED|DISCONNECTED [newname = ] NewName ]ParametersIfNameRequired. Specifies the name of the interface that you want to modify.adminOptional. Specifies whether the interface should be enabled or disabled.connectOptional. Specifies whether or not to enable and connect the interface (non-LAN only).newnameOptional. Specifies a new name for the interface (LAN only).RemarksAt least one option other than the name must be specified.

If you specify that the value for connect equals CONNECTED, then the interface is automatically enabled even if you also specify that the value for adminequals DISABLED.

show credentials

Displays the credentials that are used to connect to an interface.Syntaxshow credentials [name = ] IfNameParametersIfNameRequired. Specifies the name of the interface whose credentials you want to display.

show interface

Displays a list of the configured interfaces, including their current Name, Admin State, State, and Type.Syntaxshow interface [[name=] Name]ParametersNameOptional. Specifies the name of the interface that you want to display. If Name is not specified, all interfaces are displayed.
ExamplesFollowing is an example of the show interface command.show interface name="Local Area Connection"
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: