Export (0) Print
Expand All

Netsh Routing IP Relay Context Commands

Updated: June 3, 2009

Applies To: Windows Server 2008, Windows Server 2008 R2

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

To view the command syntax, click a command:

Add commands

Delete commands

Set commands

Show commands

  • The following entries provide details for each command.

Displays the Dynamic Host Configuration Protocol (DHCP) Relay Agent configuration of a remote access server in script form.

dump

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

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

  • From the command prompt:

    netsh routing ip relay dump > c:\test\relaycfg.dmp

  • From the netsh routing ip relay context prompt:

    set file open c:\test\relaycfg.dmp

    dump

    set file close

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

Adds a DHCPv4 server to the list of DHCP servers whose messages will be forwarded by DHCP Relay Agent.

add dhcpserver

server = ] IPAddress

server = ] IPAddress
Required. Specifies, by IPv4 address, the DHCP server you want to add.

To add a DHCP server with the IPv4 address of 10.0.0.1 to the global list of DHCP servers, type:

add dhcpserver 10.0.0.1

Enables the DHCPv4 Relay Agent on the specified interface.

add interface

name = ] InterfaceName

name = ] InterfaceName
Required. Specifies, by name, the interface on which you want to enable the DHCPv4 Relay Agent. 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").

To enable DHCPv4 Relay Agent on the Local Area Connection interface, type:

add interface "Local Area Connection"

Disables DHCPv4 Relay Agent on the specified interface.

delete interface

name = ] InterfaceName

name = ] InterfaceName
Required. Specifies, by name, the interface on which you want to disable the DHCPv4 Relay Agent. 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").

To disable the DHCPv4 Relay Agent on the Local Area Connection interface, type:

delete interface "Local Area Connection"

Removes a DHCPv4 server from the list of DHCP servers whose messages will be forwarded by DHCP Relay Agent.

delete dhcpserver

server = ] IPAddress

server = ] IPAddress
Required. Specifies, by IPv4 address, the DHCP server to be deleted.

To delete a DHCP server with the IPv4 address of 10.0.0.1 from the global list of DHCP servers, type:

delete dhcpserver 10.0.0.1

Sets global parameters for the DHCPv4 Relay Agent configuration.

set global

loglevel = ] { none | error | warn | info }

loglevel = ] { none | error | warn | info }
Required. Specifies which DHCPv4 Relay Agent events should be logged.

  • none specifies that no events related to DHCP Relay Agent should be logged.

  • error specifies that only errors related to DHCP Relay Agent should be logged.

  • warn specifies that both errors and warnings related to DHCP Relay Agent should be logged.

  • info specifies that all events related to DHCP Relay Agent should be logged.

To configure global parameters for DHCP Relay Agent to not log events, type:

set global loglevel=none

Updates the DHCPv4 Relay Agent configuration on an interface.

set interface

name = ] InterfaceName

relaymode = ] { enable | disable }

[ [ maxhop = ] Integer ]

[ [ minsecs = ] Integer ]

name = ] InterfaceName
Required. Specifies, by name, the interface on which you want to update the configuration of the DHCPv4 Relay Agent. 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").

relaymode = ] { enable | disable }
Required. Specifies whether the DHCPv4 Relay Agent is enabled or disabled.

[ [ maxhop = ] Integer ]
Specifies the number of hops a DHCPv4 packet can make before it is dropped and no longer relayed.

[ [ minsecs = ] Integer ]
Specifies the minimum number of seconds from boot time that must appear in a DHCPv4 packet before it is sent to a DHCP server in the list of servers whose messages will be forwarded by the DHCPv4 Relay Agent.

To update the DHCPv4 Relay Agent configuration on the interface named Local Area Connection with a maximum hop count of 16 and a value of 4 seconds for the minimum seconds from boot time, type:

set interface name="Local Area Connection" enable 16 4

Displays configuration information for the DHCPv4 Relay Agent on the specified interface. Used without parameters, show interface displays DHCP Relay Agent configuration information for all interfaces.

show interface

name = ] InterfaceName

name = ] InterfaceName
Required. 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").

Displays DHCPv4 Relay Agent global configuration.

show global

Displays DHCPv4 Relay Agent configuration information for the specified interface. Used without parameters, show ifconfig displays information once for all interfaces where the DHCPv4 Relay Agent is enabled.

show ifconfig

[ [ index = ] Integer ]

[ [ rr = ] Integer ]

index = ] Integer
Specifies, by index value, the interface for which you want to display information. To determine the interface index number, use the netsh interface ipv4 show interfaces command.

rr = ] Integer
Specifies, in seconds, how often you want the information to be refreshed.

To display the DHCPv4 Relay Agent configuration with a 5-second refresh interval, type:

show ifconfig rr=5

Displays IPv4 address bindings for the specified interface. Used without parameters, show ifbinding displays information once for all interfaces where DHCPv4 relay is enabled for use.

show ifbinding

[ [ index = ] Integer ]

[ [ rr = ] Integer ]

index = ] Integer ]
Specifies, by index value, the interface for which you want to display information. To determine the interface index number, use the netsh interface ipv4 show interfaces command.

rr = ] Integer
Specifies, in seconds, how often you want the information to be refreshed.

To display the IP address bindings for all interfaces, type:

show ifbinding

Displays DHCPv4 Relay Agent statistics for the specified interface. Used without parameters, show ifstats displays information one time for all interfaces where DHCP relay is enabled for use.

show ifstats

[ [ index = ] Integer ]

[ [ rr = ] Integer ]

index = ] Integer
Specifies, by index value, the interface for which you want to display information.

rr = ] Integer
Specifies, in seconds, how often you want the information to be refreshed.

To display DHCPv4 Relay Agent statistics for all interfaces, type:

show ifstats

Installs the DHCPv4 relay agent for use with IPv4.

install

Removes the DHCPv4 relay agent from IPv4.

uninstall

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft