The following commands are specific to the routing demanddial context within the Netsh environment.

The commands in the routing demanddial context are all supported by both Windows Server 2008 and Windows Server 2008 R2.

To view the command syntax, click a command:

Add commands

Delete commands

Set commands

Show commands

Netsh commands for routing demanddial

The following entries provide details for each command.

dump

Displays the demand-dial configuration of a remote access server in script form.

Syntax

dump

Remarks

  • You can dump the contents of the current configuration to a file that can be used to restore altered configuration settings.

Example

The following commands save the current configuration as a script in the c:\test\routingdemanddialcfg.dmp file.

  • From the command prompt:

    netsh routing demanddial dump > c:\test\routingddcfg.dmp

  • From the netsh routing demanddial context prompt:

    set file open c:\test\routingddcfg.dmp

    dump

    set file close

You can use the netsh exec command to run the script created by the netsh dump command.

add interface

Adds a new demand-dial interface.

Syntax

add interface

name = ] InterfaceName

type = ] { vpn | dialup }

host = ] HostName

device = ] DeviceName

user = ] UserName

password = ] Password

Parameters

name = ] InterfaceName

Required. Specifies the name of the demand-dial interface.
type = ] { vpn | dialup }

Required. Specifies the type of demand-dial connection: VPN or dial-up.
host = ] HostName

Required. For a connection using a VPN device, specifies the DNS host name or IP address of the remote computer. For a connection using a physical device, such as a modem, specifies a comma-separated list of phone numbers (primary, alternate1, alternate2, and so on).
device = ] DeviceName

Required.
  • For a connection using a VPN device, specifies the type of VPN connection, either auto, l2tp, or pptp.

  • For a connection using a physical device, such as a modem, specifies the name of the dial-up device.

user = ] UserName

Required. Specifies the user name used to access the remote server, in the format domain\username.
password = ] Password

Required. Specifies the password used to access the remote server.

Remarks

By default, the following parameters are set for the new demand-dial connection. To change any of them, use the set interface command.

idletime = 5

Idle time, in minutes, before hanging up
redialatt = 0

The number of redial attempts before the connection is dropped.
redialinterval = 1

Interval, in seconds, between redial attempts.
lcp = enabled, swc = enabled

PPP settings: enable Link Control Protocol (LCP) extensions, enable software compression (swc)
encryption = req

Require data encryption
mschapv2 = enabled

MS-CHAP v2 enabled for logon security
restrictions = none

No restriction on dial-out hours

Example

In the following example, a VPN demand-dial interface named VPN1 is added with a connection to host 10.0.0.200. The remote host has a user account with name Dialin1 and password P@ssword.

add interface name=VPN1 type=vpn host=10.0.0.200 device=auto user=Dialin1 password=P@ssword

delete interface

Deletes a demand-dial interface.

Syntax

delete interface

name = ] InterfaceName

Parameters

name = ] InterfaceName

Required. Specifies the name of the demand-dial interface.

Example

The following is an example of removing the VPN1 demand-dial interface.

delete interface VPN1

set interface

Configure the options for a demand-dial interface.

Syntax

set interface

name = ] InterfaceName

[ [ host = ] HostName  ]

[ [ device = ] DeviceName  ]

[ [ conntype = ] { dd | persistent } ]

[ [ idletime = ] Time ]

[ [ redialatt = ] Number ]

[  [ redialinterval = ] Interval ]

[ [ callback = ] { enabled | disabled } ]

[ [ restrictions = ] Times ]

[ [ admin = ] { enabled | disabled } ]

[ [ connstate = ] { connect | disconnect } ]

Parameters

name = ] InterfaceName

Required. Specifies the name of the demand-dial interface that you want to configure. The interface must already exist.
host = ] HostName

For a connection using a VPN device, specifies the DNS host name or IP of the remote computer. For a connection using a physical device, such as a modem, specifies a comma-separated list of phone numbers (primary, alternate1, alternate2, and so on).
device = ] DeviceName

  • For a connection using a VPN device, specifies the type of VPN connection, either auto, l2tp, or pptp.

  • For a connection using a physical device, such as a modem, specifies the name of the dial-up device.

conntype = ] { dd | persistent }

Specifies the connection type: Demand-dial or Persistent.
idletime = ] Time

Specifies the time, in minutes, that the connection is allowed to be idle before the server hangs up. Allowed values, in minutes: 0 (Never), 1, 5, 20, 30, 60 (1 hour), 120 (2 hours), 240 (4 hours), 480 (8 hours), 720 (12 hours).
redialatt = ] Number

Specifies the number of redial attempts. The specified value must be between 1 and 99.
redialinterval = ] Interval

Specifies the interval, in seconds, between redial attempts. Allowed values, in seconds: 1, 3, 5, 10, 30, 60 (1 minute), 120 (2 minutes), 300 (5 minutes), 600 (10 minutes).
callback = ] { enabled | disabled }

Specifies whether dial-up callback is enabled or disabled. Callback can help reduce phone charges and helps to increase security. The default is disabled.
restrictions = ] “Times

Specifies the times during which dial-out is restricted. Format is a comma-separated string where day of the week is specified by a number (Sunday = 0, Monday = 1 … Saturday = 6). Restricted time is specified as follows: <day1> <time range> <time range>
Important
Do not use the keyword “restrictions=” when setting this option. If you want to set time restrictions, set the time string as the last parameter with no keyword. See the example below.
admin = ] { enabled | disabled }

Specifies whether the demand-dial interface is enabled or disabled.
Note
This option is available on RRAS servers that are running Windows Server 2008 R2 only.
connstate = ] { connect | disconnect }

Changes the connection state of the interface.
  • connect causes the demand-dial interface to connect if it is not already connected.

  • disconnect causes the demand-dial interface to disconnect if it is connected.

Note
This option is available on RRAS servers that are running Windows Server 2008 R2 only.

Example

In the following example, a demand-dial interface named VPN1 is added with a connection to host 10.0.0.201, a demand-dial connection type, an idle time of 5 minutes, 3 redial attempts, a redial interval of 10 minutes, and callback disabled. Dial-out is restricted all Saturday and Sunday from midnight to noon and 3:00 P.M. to midnight.

set interface name=VPN1 host=10.0.0.201 device=auto conntype=dd idletime=5 redialatt=3 redialinterval=10 callback=disabled “6 00:00-24:00, 0 00:00-12:00 15:00-24:00”

show interface

Shows the settings for the specified demand-dial interface. Used without parameters, show interface displays basic information for all interfaces.

Syntax

show interface

[ [ name = ] InterfaceName ]

Parameters

name = ] InterfaceName

Specifies, by name, the interface for which you want to display 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"). If you do not specify an interface, then netsh displays a list of all of the currently configured demand-dial interfaces and their current connection state.

set callbackdevice

Sets the callback number of the callback device for the specified demand-dial interface.

Syntax

set callbackdevice

name = ] CallbackDevice

number = ] Number

Parameters

name = ] CallbackDevice

Required. Specifies the device used to initiate the callback.
number = ] Number

Required. Specifies the callback phone number.

Example

The following sets the callback number of device Standard 56000 bps Modem to (425) 555-0110.

set callbackdevice name="standard 56000 bps modem (com1)" number=4255550110

show callbackdevice

Shows the callback number of the callback device for the specified demand-dial interface.

Syntax

show callbackdevice

[ [ name = ] CallbackDevice ]

Parameters

[ [ name = ] CallbackDevice ]

Specifies the callback device. If you do not specify a device, all the callback devices are listed.

set credentials

Sets the credentials for the specified demand-dial interface used to authenticate to the remote server.

Syntax

set credentials

name = ] InterfaceName

user = ] UserName

password = ] Password

Parameters

name = ] InterfaceName

Required. Specifies the name of the demand-dial interface.
user = ] UserName

Required. Specifies the user name in the format domain\username.
password = ] Password

Required. Specifies the password.

Example

The following sets the credentials for the VPN1 demand-dial interface to: user name Dialin1 and password P@ssword.

set credentials name=vpn1 user=Dialin1 password=P@ssword

set ppp

Sets the PPP options for the specified demand-dial interface.

Syntax

set ppp

name = ] InterfaceName

lcp = ] { enabled | disabled }

swc = ] { enabled | disabled }

multi = ] { enabled | disabled }

Parameters

name = ] InterfaceName

Required. Specifies the name of the demand-dial interface.
lcp = ] { enabled | disabled }

Required. Specifies whether LCP extensions are enabled or disabled. The default is enabled.
swc = ] { enabled | disabled }

Required. Specifies whether software compression is enabled or disabled. The default is enabled.
multi = ] { enabled | disabled }

Required. Specifies whether Multilink negotiation is enabled for a single link connection. The default is disabled.

Example

The following sets the PPP settings for VPN1 demand-dial interface.

set ppp name=vpn1 lcp=disabled swc=enabled multi=disabled

show ppp

Shows the PPP settings for the specified demand-dial interface.

Syntax

show ppp

name = ] InterfaceName

Parameters

name = ] InterfaceName

Required. Specifies the demand-dial interface.

Example

The following shows the PPP settings for VPN1 demand-dial interface.

show ppp name=vpn1

set security

Sets the security options for the specified demand-dial interface.

Syntax

set security

name = ] InterfaceName

[ [ encryption = ] { none | opt | req | max } ]

[ [ pap = ] { enabled | disabled } ]

[ [ chap = ] { enabled | disabled } ]

[ [ mschapv2 = ] { enabled | disabled } ]

[ [ psk = ] { enabled | disabled } ]

[ [ secret = ] SharedSecret ]

Parameters

name = ] InterfaceName

Required. Specifies the name of the demand-dial interface.
encryption = ] { none | opt | req | max }

Specifies the data encryption level to be enforced.
  • None: no encryption allowed. Disconnect if server requests encryption.

  • Opt: encryption is optional. Connect whether or not there is encryption.

  • Req: encryption is required. Disconnect if server does not support encryption. This is the default setting.

  • Max: maximum strength encryption required. Disconnect if server does not support maximum strength encryption.

pap = ] { enabled | disabled }

Specifies Password Authentication Protocol (PAP) authentication is supported. Enable only with encryption=none. Default is disabled.
chap = ] { enabled | disabled }

Specifies MS Challenge Password Authentication Protocol (CHAP) authentication is supported. Enable only with encryption=none. Default is disabled.
mschapv2 = ] { enabled | disabled }

Specifies MS Challenge Password Authentication Protocol version 2 (MS-CHAP v2) authentication is supported. Default is enabled.
psk = ] { enabled | disabled }

Specifies preshared key authentication is supported for Internet Key Exchange (IKE). For use with L2TP IPsec VPN VPN type. Default is disabled.
secret = ] SharedSecret

Specifies the preshared key. Use when psk authentication is enabled.

Example

The following sets the security settings for VPN1 demand-dial interface.

set security name=vpn1 encryption=opt pap=disabled chap=disabled mschapv2=enabled psk=disabled

show security

Shows the security settings for the specified demand-dial interface.

Syntax

show security

name = ] InterfaceName

Parameters

name = ] InterfaceName

Required. Specifies the demand-dial interface.

Example

Following shows the security settings for VPN1 demand-dial interface.

show security name=vpn1