Windows Route Routing Table command finishing _ routers, switches

Source: Internet
Author: User
Tags switches
Windows Route Routing Table command
Displays and modifies entries in the local IP routing table.

Grammar
Route [F] [P] [Command [Destination] [mask Netmask] [Gateway] [metric metric]] [if Interface]]

Parameters
-F
Clears all routes that are not the primary route (the netmask is 255.255.255.255), loopback network routes (destinations 127.0.0.0, network mask is 255.255.255.0) or multicast routing (destination 224.0.0.0, net mask is 240.0.0.0) routing table for the entry of the If it is used in conjunction with one of the commands (such as add, change, or delete), the table is cleared before the command is run.
-P
When used in conjunction with the Add command, the specified route is added to the registry and the IP routing table is initialized when the TCP/IP protocol is started. By default, added routes are not saved when the TCP/IP protocol is started. When used with the Print command, a list of persistent routes is displayed. This parameter is ignored for all other commands. The location where the permanent route is stored in the registry is hkey_local_machine\system\currentcontrolset\services\tcpip\parameters\persistentroutes.

Command
Specifies the command to run. The following table lists the valid commands. Command purpose
Add route
Change changes existing routes
Delete Remove route
Print Printing routing destination
Specifies the network destination address for the route. The destination address can be an IP network address (where the host address of the network address is set to 0), the host route is an IP address, and the default route is 0.0.0.0.

Mask SubnetMask
Specifies the netmask (also called the subnet mask) associated with the network destination address. The subnet mask can be an appropriate subnet mask for the IP network address, is 255.255.255.255 for host routing, and 0.0.0.0 for the default route. If omitted, the subnet mask is used to 255.255.255.255. When you define a route, the destination address cannot be more detailed than its corresponding subnet mask because of the relationship between the destination address and the subnet mask. In other words, if one of the subnet masks is 0, the corresponding bits in the destination address cannot be set to 1.

Gateway
Specifies the previous or next hop IP address that exceeds the set of attainable addresses defined by the network destination and subnet mask. For a subnet by local connection, the gateway address is the IP address assigned to the connection subnet interface. For remote routes that are available through one or more routers, the gateway address is an IP address that is assigned to a neighboring router that can be reached directly.

Metric metric
Specifies the integer value (range 1 ~ 9999) of the desired metric for the route, which is used to select the route that most closely matches the destination address in the forwarding package in multiple routes in the routing table. The selected route has a minimum number of hops. The metric can reflect the number of hops, the speed of the path, path reliability, path throughput, and administrative properties.
If Interface
Specifies the interface index of the interface to which the destination can reach. Use the route Print command to display a list of interfaces and their corresponding interface indexes. You can use decimal or hexadecimal values for an interface index. For hexadecimal values, precede the hexadecimal number with 0x. When the If parameter is omitted, the interface is determined by the gateway address.
/?
Display Help at the command prompt.
Comments
The value of the metric column in the routing table is large because TCP/IP is allowed to automatically determine the number of hops in the routing table based on the IP address, subnet mask, and default gateway configuration of each LAN interface. The Automatically determined interface metric for the default startup determines the speed of each interface, adjusts the routing metric for each interface, so the route created by the fastest interface has the lowest metric. To remove a large metric, disable the automatic determination of the interface metric in the advanced properties of the TCP/IP protocol for each LAN connection.

If an appropriate entry exists in the local network file in the systemroot\System32\Drivers\Etc folder, the name can be used for destination. As long as the name can be decomposed into IP addresses through standard hostname resolution techniques such as Domain Name System (DNS) queries, it can be used for GATEWAY,DNS queries using local host files stored under the systemroot\System32\Drivers\Etc folder and NetBIOS name resolution.

If it is a print or delete command, you can ignore the gateway parameter and use wildcard characters to represent the target and gateway. Destination values can be wildcard characters specified by an asterisk (*). If the specified target contains an asterisk (*) or a question mark (?), it is considered a wildcard character, and only the matching destination route is printed or deleted. An asterisk represents any sequence of characters, and a question mark represents any character. For example, 10.*.1, 192.168.*, 127.*, and *224* are all valid uses of the asterisk wildcard character.

Using a combination of invalid destination and subnet mask (netmask) values, the Route:bad gateway address netmask error message is displayed. This error occurs when the target has one or more digits set to 1, and its corresponding bit in the subnet mask is set to 0. You can check this by representing the target and subnet masks in binary notation. A binary subnet mask consists of a series of 1 representing the destination network address portion and a series of 2 parts representing the destination host address portion. View the target to determine whether the host address portion of the target (as defined by the subnet mask) is set to 1.

Only the Windows NT 4.0, Windows 2000, Windows Millennium Edition, and Windows XP route commands support the-p parameter. The route command for Windows 95 or Windows 98 does not support this parameter.


This command is available only if the Internet Protocol (TCP/IP) protocol is installed as a component of network adapter properties in a network connection.

Example
To display the full contents of the IP routing table, type:

Route print

To display the IP routing table in 10. The route you started, type:

Route print 10.*

To add a default route with a default gateway address of 192.168.12.1, type:

Route add 0.0.0.0 Mask 0.0.0.0 192.168.12.1

To add a target of 10.41.0.0, the subnet mask is 255.255.0.0, and the next hop address is a 10.27.0.1 route, type:

Route add 10.41.0.0 Mask 255.255.0.0 10.27.0.1

To add a target of 10.41.0.0 with a subnet mask of 255.255.0.0 and a permanent route with the next hop address 10.27.0.1, type:

Route-p Add 10.41.0.0 mask 255.255.0.0 10.27.0.1

To add a destination of 10.41.0.0, the subnet mask is 255.255.0.0, and the next hop address is 10.27.0.1, and the route with a hop count of 7, type:

Route add 10.41.0.0 Mask 255.255.0.0 10.27.0.1 metric 7

To add a target of 10.41.0.0, the subnet mask is 255.255.0.0, and the next hop address is 10.27.0.1, and the interface is indexed to 0x3 routes, type:

Route add 10.41.0.0 Mask 255.255.0.0 10.27.0.1 if 0x3

To delete a route with a target of 10.41.0.0 with a subnet mask of 255.255.0.0, type:

Route Delete 10.41.0.0 Mask 255.255.0.0

To delete the IP routing table in 10. All the routes that started, please type:

Route Delete 10.*

To target a 10.41.0.0, the next hop address for a route with a subnet mask of 255.255.0.0 changed from 10.27.0.1 to 10.27.0.25, type:

Route change 10.41.0.0 Mask 255.255.0.0 10.27.0.25

Route's orders.
routing ip add/delete/set/show interface adds, deletes, configures, or displays general IP routing settings on the specified interface.
routing ip add/delete/set/show filter adds, deletes, configures, or displays IP packet filters on the specified interface.
routing ip add/delete/show boundary adds, deletes, or displays multicast boundary settings on the specified interface.
routing ip add/set ipiptunnel Add or configure IP interfaces in IP.
routing ip add/delete/set/show rtmroute Add, configure, or display an unsustainable route table manager route.
routing ip add/delete/set/show persistentroute Add, remove, configure, or display persistent routes.
routing ip add/delete/set/show preferenceforprotocol Add, remove, configure, or display the priority of the routing protocol.
routing ip add/delete/set/show scope to add, remove, or display multicast scopes.
routing ip set/show loglevel Configure or display the global IP record level.
routing ip Show helper displays all Netsh utility child environments for IP.
routing ip Show protocol displays all the running IP routing protocols.
routing ip show MFE displays multicast forwarding entries.
routing ip Show mfestats displays multicast forwarding entry statistics.
routing ip Show boundarystats displays IP multicast boundaries.
routing ip Show rtmdestinations displays the destinations in the routing Table Manager routing table.
routing ip Show rtmroutes shows the routes in the routing Table Manager routing table.
Routing the IP NAT set/show global configuration or displays global network address translation (NAT) settings.
routing ip Nat add/delete/set/show interface Add, remove, configure, or display NAT settings for the specified interface.
routing ip Nat add/delete Addressrange adds or deletes an address range in the NAT interface public address pool.
routing ip Nat add/delete addressmapping Add or remove NAT address mappings.
routing ip Nat add/delete portmapping Add or remove NAT port mappings.
routing ip autodhcp set/show global configures or displays the Globals DHCP allocator parameters.
routing ip autodhcp Set/show interface configures or displays the DHCP allocator settings for the specified interface.
routing ip autodhcp add/delete exclusion Add or remove an exclusion range from the DHCP allocator address range.
The routing ip dnsproxy set/show global configures or displays the globally DNS proxy parameters.
routing ip dnsproxy Set/show interface configures or displays the DNS proxy parameters for the specified interface.
routing ip IGMP set/show global configuration or display IGMP globals.
routing ip IGMP Add/delete/set/show interface adds, deletes, configures, or displays IGMP on the specified interface.
routing ip IGMP add/delete staticgroup Add or remove static multicast groups for the specified interface.
routing ip IGMP show grouptable displays the IGMP Host group table.
routing ip IGMP show ifstats displays IGMP statistics for each interface.
routing ip IGMP show iftable displays the IGMP host group for each interface.
routing ip IGMP show proxygrouptable displays IGMP group tables for the IGMP proxy interface.
routing ip IGMP show rasgrouptable displays the group table for the Internet interface used by the remote access server.
routing ip OSPF set/show global configures or displays the globally OSPF settings.
routing ip OSPF add/delete/set/show interface adds, deletes, configures, or displays OSPF on the specified interface.
routing ip OSPF add/delete/set/show area to add, remove, configure, or display OSPF areas.
The routing ip OSPF add/delete/show range adds, deletes, configures, or displays a range on the specified OSPF area.
routing ip OSPF add/delete/set/show virtif Add, remove, configure, or display OSPF virtual interfaces.
routing ip OSPF add/delete/show neighbor Add, remove, configure, or display OSPF neighbors.
routing ip OSPF add/delete/show protofilter to add, remove, configure, or display routing information sources for OSPF external routes.
routing ip OSPF add/delete/show routefilter to add, remove, configure, or display route filtering for OSPF external routes.
routing ip OSPF show areastats shows OSPF area statistics.
routing ip OSPF show LSDB displays the OSPF link state database.
routing ip OSPF show virtifstats shows OSPF virtual link statistics.
The routing IP relay set global configures the DHCP relay agent globally.
routing IP Relay Add/delete/set interface Add, remove, or configure the DHCP Relay Agent settings on the specified interface.
routing ip relay add/delete dhcpserver Add or remove the IP address of the DHCP server in the list of DHCP server addresses.
routing IP relay show ifbinding the IP address bindings for the display interface.
routing ip relay show ifconfig displays the DHCP Relay Agent configuration for each interface.
routing ip relay show ifstats displays DHCP statistics for each interface.
routing ip RIP set/show global configures the rip-globally settings for IP.
routing ip RIP add/delete/set/show interface Add or configure RIP settings for IP on the specified interface.
routing ip RIP add/delete peerfilter Add or remove RIP peer filters.
routing ip RIP add/delete acceptfilter Add or remove RIP route filters from the list of accepted routes.
routing ip RIP add/delete announcefilter Add or remove RIP route filters in the published routing list.
routing ip RIP add/delete/show neighbor Add or remove RIP neighbors.
routing ip RIP set/show flags configures IP RIP advanced settings on the specified interface.
routing ip RIP show globalstats displays global RIP parameters.
routing ip RIP show ifbinding the IP address bindings for the display interface.
routing ip rip show ifstats shows RIP statistics for each interface.

IPX netsh routing command
Routing IPX Add/set staticroute adds or configures a static IPX route in the IPX routing table.
Routing IPX add/set staticservice Add or configure static SAP services in the SAP service table.
Routing IPX Add/set filter adds or configures an IPX packet filter on the specified interface.
Routing IPX Add/set interface enable IPX routing on the demand-dial interface, or configure IPX settings on the specified interface.
Routing IPX set global configures global IPX routing settings.
Routing IPX RIP add/set filter to add and configure RIP route filters.
Routing IPX RIP set global configures RIP settings for global IPX.
Routing IPX RIP set interface configures IPX RIP settings on the specified interface.
Routing IPX SAP Add/set filter to add or configure SAP service filters.
The routing IPX SAP set global configures SAP settings for global IPX.
Routing IPX SAP set interface configures the SAP settings for IPX on the specified interface.
Routing IPX NetBIOS add nbname adds a static NetBIOS name to the IPX NetBIOS name table.
Routing IPX NetBIOS set interface configures IPX based NetBIOS settings on the specified interface.

Route English Description Help

Manipulates network routing tables.

ROUTE [-f] [-p] [command [destination]
[MASK netmask] [Gateway] [METRIC METRIC] [IF Interface]

-F Clears the routing tables of all gateway entries. If this is
Used in conjunction with one of the commands, the tables are
Cleared prior to running the command.
-p when used with the ADD command, makes a route persistent across
Boots of the system. By default, routes are not preserved
When the system is restarted. Ignored for all other commands,
Which always affect the appropriate persistent routes. This
option is isn't supported in Windows 95.
Command one of these:
PRINT Prints a route
ADD Adds a route
DELETE Deletes a route
Change modifies an existing route
destination Specifies the host.
MASK specifies that's next parameter is the ' netmask ' value.
netmask Specifies a subnet mask value for this route entry.
If not specified, it defaults to 255.255.255.255.
Gateway specifies Gateway.
Interface the interface number for the specified route.
METRIC Specifies the METRIC, ie. Cost for the destination.

All symbolic names used for destination are looked up in the network database
File NETWORKS. The symbolic names for Gateway are looked up in the host name
Database file HOSTS.

If the command is PRINT or DELETE. Destination or gateway can be a wildcard,
(wildcard is specified as a star ' * "), or the gateway argument may was omitted.

If Dest contains a * or?, it is treated as a shell pattern, and only
Matching destination routes are printed. The ' * ' matches any string,
And '? ' matches any one char. examples:157.*.1, 157.*, 127.*, *224*.

The PRINT command would show both IPV4 and IPv6 routes, but the ADD, DELETE,
and change commands work the only for IPV4 routes. For IPV6 routes, use
The ' interface ipv6 ' context in Netsh.exe.

Diagnostic Notes:
Invalid MASK generates an error, which is when (DEST & MASK)!= DEST.
Example> Route ADD 157.0.0.0 MASK 155.0.0.0 157.55.80.1 IF 1
The route addition failed:the specified mask is parameter.
(Destination & Mask)!= destination.

Examples:

> Route PRINT
> Route ADD 157.0.0.0 MASK 255.0.0.0 157.55.80.1 METRIC 3 IF 2
destination^ ^mask ^gateway metric^ ^
interface^
If if isn't given, it tries to find the best interface for a given
Gateway.
> Route PRINT
> Route PRINT 157* .... Only prints those matching 157*
> Route change 157.0.0.0 MASK 255.0.0.0 157.55.80.5 METRIC 2 IF 2

Change are used to modify gateway and/or metric only.
> Route PRINT
> Route DELETE 157.0.0.0
> Route PRINT
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.