The documentation set for this product strives to use bias-free language. For the purposes of this documentation set, bias-free is defined as language that does not imply discrimination based on age, disability, gender, racial identity, ethnic identity, sexual orientation, socioeconomic status, and intersectionality. Exceptions may be present in the documentation due to language that is hardcoded in the user interfaces of the product software, language used based on RFP documentation, or language that is used by a referenced third-party product. Learn more about how Cisco is using Inclusive Language.
This article provides instructions on how to configure IPv4 static routes on the switch through the web-based utility.
Static routing refers to the configuration of the path selection of routers. This type of mechanism takes place in the absence of communication between routers regarding the current topology of the network and thus, manually configuring routes to the routes table on the switch is recommended. Static routes help reduce the overhead on the switch CPU. This feature also allows you to deny access to certain networks.
When routing traffic, the next hop is decided on according to the longest prefix match (LPM) algorithm. A destination IPv4 address may match multiple routes in the IPv4 Static Route Table. The device uses the matched route with the highest subnet mask, that is, the longest prefix match. If more than one default gateway is defined with the same metric value, the lowest IPv4 address from among all the configured default gateways is used.
Note: For instructions on how to configure IPv4 static routes settings on the switch through the CLI, click here.
You cannot configure a static route through a directly‑connected IP subnet where the device gets its IP address from a DHCP server. To configure a static IPv4 interface on the switch, click here for instructions.
Step 1. Log in to the web-based utility of the switch then choose IP Configuration >IPv4 Management and Interfaces > IPv4 Static Routes.
Note: The available menu options may vary depending on the device model. In this example, SG350X-48MP is used.
The following fields are displayed in the IPv4 Static Routes Table:
Note: Defining an IP SLA object tracking ID for a routing entry checks connectivity to a remote network via the specified next hop. If there is no connectivity, the object track status will be set to Down and the router will be removed from the Forwarding table.
Step 2. Click Add to add a new static route.
Step 3. Enter the destination IP address prefix in the Destination IP Prefix field.
Note: In this example, 192.168.1.0 is used.
Step 4. In the Mask area, choose from the following options:
Note: In this example, Prefix Length is chosen and 24 is entered. This translates to the 255.255.255.0 network mask.
Step 5. Click a Route Type from the following options:
Note: In this example, Remote is chosen.
Step 6. (Optional) In the Next Hop Router IP Address field, enter the next hop IP address or the IP alias on the route.
Note: In this example, 192.168.100.1 is entered.
Step 7. (Optional) In the Metric area, click on the radio button to define the administrative distance to the next hop. The options are:
Note: In this example, User Defined is chosen and 2 is used.
Step 8. Click Apply then click Close.
Note: In this example, a static route to 192.168.1.0 network is established through 192.168.100.0. The defined administrative distance is 2. The route goes to a router with IP address 192.168.100.1.
Step 9. Click Save to save the settings to the startup configuration file.
You have now successfully configured the IPv4 static routes settings on your switch.