Inscrivez-vous ou connectez-vous pour rejoindre votre communauté professionnelle.
You can configure a static route on the router.
1. configure terminal
2. ip route {ip-prefix | ip-addr ip-mask} {[next-hop | nh-prefix] | [interface next-hop | nh-prefix]} [tagtag-value [pref]]
3. (Optional) show ip static-route
4. (Optional) copy running-config startup-config
Command Purpose
Step 1
configure terminal
Example:
switch# configure terminal
switch(config)#
Enters configuration mode.
Step 2
ip route {ip-prefix | ip-addrip-mask} {[next-hop | nh-prefix] | [interface next-hop | nh-prefix]} [tag tag-value[pref]
Example:
switch(config)# ip route.0.2.0/8 ethernet1/.0.2.4
Configures a static route and the interface for this static route. You can optionally configure the next-hop address. The preference value sets the administrative distance. The range is from1 to. The default is1.
Step 3
show ip static-route
Example:
switch(config)# show ip static-route
(Optional) Displays information about static routes.
Step 4
copy running-config startup-config
Example:
switch(config)# copy running-config startup-config
(Optional) Saves this configuration change.
This example shows how to configure a static route:
switch# configure terminal switch(config)# ip route.0.2.0/.0.2. switch(config)# copy running-config startup-configUse the no ip static-route command to remove the static route.
You can configure a static route on the router.
1. configure terminal
2. ip route {ip-prefix | ip-addr ip-mask} {[next-hop | nh-prefix] | [interface next-hop | nh-prefix]} [tagtag-value [pref]]
3. (Optional) show ip static-route
4. (Optional) copy running-config startup-config
Command Purpose
Step 1
configure terminal
Example:
switch# configure terminal
switch(config)#
Enters configuration mode.
Step 2
ip route {ip-prefix | ip-addrip-mask} {[next-hop | nh-prefix] | [interface next-hop | nh-prefix]} [tag tag-value[pref]
Example:
switch(config)# ip route 192.0.2.0/8 ethernet 1/2192.0.2.4
Configures a static route and the interface for this static route. You can optionally configure the next-hop address. The preference value sets the administrative distance. The range is from 1 to 255. The default is 1.
Step 3
show ip static-route
Example:
switch(config)# show ip static-route
(Optional) Displays information about static routes.
Step 4
copy running-config startup-config
Example:
switch(config)# copy running-config startup-config
(Optional) Saves this configuration change.
This example shows how to configure a static route:
switch# configure terminal switch(config)# ip route 192.0.2.0/8192.0.2.10 switch(config)# copy running-config startup-configUse the no ip static-route command to remove the static route.