Configuring Static Routing
IPv4 Static Routing Configuration
Configuration Guide
393
2.2 Using the CLI
Follow these steps to create an IPv4 static route.
Step 1
configure
Enter global configuration mode.
Step 2
ip route {
dest-address
} {
mask
} {
next-hop-address
} [
distance
]
Add an IPv4 static route.
dest-address:
Specify the destination IPv4 address of the packets.
mask:
Specify the subnet mask of the destination IPv4 address.
next-hop-address:
Specify the IPv4 gateway address to which the packet should be sent
next.
distance:
Specify the administrative distance, which is a rating of the trustworthiness of the
routing information. A higher value means a lower trust rating. When more than one routing
protocols have routes to the same destination, only the route that has the shortest distance
will be recorded in the IP routing table. The valid values are from 1 to 255 and the default
value is 1.
Step 3
show ip route [
static | connected
]
Verify the IPv4 route entries of the specified type.
Step 4
end
Return to privileged EXEC mode.
Step 5
copy running-config startup-config
Save the settings in the configuration file.
The following example shows how to create an IPv4 static route with the destination IP
address as 192.168.2.0, the subnet mask as 255.255.255.0 and the next-hop address as
192.168.0.2:
Switch#configure
Switch(config)#ip route
192.168.2.0
255.255.255.0 192.168.0.2
Switch(config)#show ip route
Codes: C - connected, S - static
* - candidate default
C 192.168.0.0/24 is directly connected, Vlan1
S 192.168.2.0/24 [1/0] via 192.168.0.2, Vlan1
Switch(config)#end
Switch#copy running-config startup-config
Содержание TL-SG2424
Страница 26: ...Part 1 Accessing the Switch CHAPTERS 1 Overview 2 Web Interface Access 3 Command Line Interface Access...
Страница 130: ...Part 4 Configuring LAG CHAPTERS 1 LAG 2 LAG Configuration 3 Configuration Example 4 Appendix Default Parameters...
Страница 147: ...Part 5 Monitoring Traffic CHAPTERS 1 Traffic Monitor 2 Appendix Default Parameters...
Страница 449: ...Part 15 Configuring ARP CHAPTERS 1 Overview 2 ARP Configurations...
Страница 508: ...Configuring Voice VLAN Configuration Guide 485...
Страница 768: ...Configuring SNMP RMON Appendix Default Parameters Configuration Guide 745 Parameter Default Setting Status Disable...