静态路由改写直接路由中的某个ip的路由(1、如果静态路由的目的地址与下一跳地址在同一网段,则不生效。 2、静态路由也可以优于直连路由。)
静态路由改写直接路由中的某个ip的路由(1、如果静态路由的目的地址与下一跳地址在同一网段,则不生效。 2、静态路由也可以优于直连路由。)
问题:sw1可以ping通sw4不,如何做?答:可以,在sw1上配置一个明细路由往sw2方向即可。
(1)配置
sw1:
interface GE1/0/0
undo portswitch
undo shutdown
ip address 192.168.1.1 255.255.255.0
#
ip route-static 192.168.1.100 255.255.255.255 192.168.1.254
sw2:
interface GE1/0/0
undo portswitch
undo shutdown
ip address 192.168.2.254 255.255.255.0
#
interface GE1/0/1
undo portswitch
undo shutdown
ip address 192.168.1.254 255.255.255.0
ip route-static 192.168.1.100 255.255.255.255 192.168.2.1
sw3:
interface GE1/0/1
undo portswitch
undo shutdown
ip address 192.168.1.254 255.255.255.0
#
interface GE1/0/2
undo portswitch
undo shutdown
ip address 192.168.2.1 255.255.255.0
ip route-static 0.0.0.0 0.0.0.0 192.168.2.254
sw4:
interface GE1/0/0
undo portswitch
undo shutdown
ip address 192.168.1.100 255.255.255.0
ip route-static 0.0.0.0 0.0.0.0 192.168.1.254
测试:sw1ping不通,但是sw2可以ping通sw4
[sw1]ping 192.168.1.100
PING 192.168.1.100: 56 data bytes, press CTRL_C to break
Request time out
Request time out
Request time out
Request time out
Request time out
--- 192.168.1.100 ping statistics ---
5 packet(s) transmitted
0 packet(s) received
100.00% packet loss
[sw1]
sw2>ping 192.168.1.100
PING 192.168.1.100: 56 data bytes, press CTRL_C to break
Reply from 192.168.1.100: bytes=56 Sequence=1 ttl=254 time=92 ms
Reply from 192.168.1.100: bytes=56 Sequence=2 ttl=254 time=6 ms
Reply from 192.168.1.100: bytes=56 Sequence=3 ttl=254 time=5 ms
Reply from 192.168.1.100: bytes=56 Sequence=4 ttl=254 time=9 ms
Reply from 192.168.1.100: bytes=56 Sequence=5 ttl=254 time=5 ms
--- 192.168.1.100 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 5/23/92 ms
<sw2>tracert 192.168.1.100
traceroute to 192.168.1.100(192.168.1.100), max hops: 30, packet length: 40, press CTRL_C to break
1 192.168.2.1 51 ms 4 ms 3 ms
2 192.168.1.100 10 ms 5 ms 4 ms
<sw2>
<sw2>
结论:
1、如果静态路由的目的地址与下一跳地址在同一网段,则不生效。
2、静态路由也可以优于直连路由。
路由(列表、list、全)路由list、routelist、静态list、staticlist
http://www.zh-cjh.com/wenzhangguilei/2297.htm
文章归类、所有文章列表、LISTLIST
http://www.zh-cjh.com/wangzhangonggao/2195.html
2、本资源基本为原创,部分来源其他付费资源平台或互联网收集,如有侵权请联系及时处理。
3、本站大部分文章的截图来源实验测试环境,请不要在生产环境中随意模仿,以免带来灾难性后果。
转载请保留出处: www.zh-cjh.com珠海陈坚浩博客 » 静态路由改写直接路由中的某个ip的路由(1、如果静态路由的目的地址与下一跳地址在同一网段,则不生效。 2、静态路由也可以优于直连路由。)
作者: cjh
手机扫一扫,手机上查看此文章: |
一切源于价值!
其他 模板文件不存在: ./template/plugins/comment/pc/index.htm