static
This command configures the Static Routes table, which lets you define static IP routing rules.
Syntax
(config-network)# static <Index> (static-<Index>)#
Command |
Description |
---|---|
Index |
Defines the table row index. |
description |
Configures a name for the rule. |
destination |
Defines the IP address of the destination host/network. |
device-name |
Associates an IP network interface through which the static route's Gateway is reached. The association is done by assigning the parameter the same Ethernet Device that is assigned to the IP network interface in the IP Interfaces table. |
gateway |
Defines the IP address of the Gateway (next hop) used for traffic destined to the subnet/host defined in 'destination' / 'prefix-length'. |
prefix-length |
Defines the Classless Inter-Domain Routing (CIDR)-style representation of a dotted-decimal subnet notation of the destination host/network. |
Command Mode
Privileged User
Example
This example configures a static routing rule to specify the gateway (10.15.7.22) in order to reach 10.1.1.10:
(config-network)# static 0 (static-0)# destination 10.1.1.0 (static-0)# prefix-length 24 (static-0)# device-name vlan1 (static-0)# gateway 10.15.7.22