找回密码
 注册
查看: 2402|回复: 0

H3C设备之静态路由实验

[复制链接]

1

主题

0

回帖

12

积分

管理员

积分
12
QQ
发表于 2021-3-11 21:49:45 | 显示全部楼层 |阅读模式
attach://197.png
C:\Documents and Settings\xiaofei>ping 10.1.1.2
Pinging 10.1.1.2 with 32 bytes of data:
Request timed out.% k- Z* I& C) o+ z3 C
Request timed out.
' ?4 [% P0 t2 d# sRequest timed out.4 D: {% {1 ?: F# i7 D/ a$ K
Request timed out.
Ping statistics for 10.1.1.2:: i: Y' p0 j! x+ L8 K* P% N$ j
    Packets: Sent = 4, Received = 0, Lost = 4 (100% loss),
C:\Documents and Settings\xiaofei>ping 192.168.3.2
Pinging 192.168.3.2 with 32 bytes of data:
Request timed out.5 ~4 J2 R2 J/ p* b$ s! f4 r
Request timed out.
7 R9 L# R" y8 a3 W9 C* n: rRequest timed out.
( z4 ?- ^* z' ^  z  p; _Request timed out.
Ping statistics for 192.168.3.2:, C$ t! N5 B; E
    Packets: Sent = 4, Received = 0, Lost = 4 (100% loss),
C:\Documents and Settings\xiaofei>
PCA处于单独一个网段,想要访问PCB,通过路由转发数据跨网段需要做路由,此时可以使用静态路由来实现。
[RTA]ip route-static 192.168.3.0 255.255.255.0 10.1.1.2  指定目标网段以及下一跳出口
[RTB]ip route-static 192.168.2.0 255.255.255.0 10.1.1.1
此时RTA,B上都有对端网段的路由:
[h3c1]disp ip routing-table ! k  Y! z7 U7 q2 i2 z
Routing Tables: Public
; G8 v! a; O7 w0 }        Destinations : 8        Routes : 8
Destination/Mask    Proto  Pre  Cost         NextHop         Interface
10.1.1.0/24         Direct 0    0            10.1.1.1        S0/0/0/ z& z/ j, f1 C6 e
10.1.1.1/32         Direct 0    0            127.0.0.1       InLoop0: v+ q0 q- n# v! j0 n& w
10.1.1.2/32         Direct 0    0            10.1.1.2        S0/0/0) G: X- V- h7 k* G, t7 }# ^7 Y
127.0.0.0/8         Direct 0    0            127.0.0.1       InLoop0* i* y( D* i' p# @9 e$ M+ y8 |) s
127.0.0.1/32        Direct 0    0            127.0.0.1       InLoop0
" \" t. t; ]  D192.168.2.0/24      Direct 0    0            192.168.2.1     Eth0/1/0
  q1 H* k8 o: H3 ^# s1 L192.168.2.1/32      Direct 0    0            127.0.0.1       InLoop0  G: u) }$ p* [8 S: d- M$ f6 M
192.168.3.0/24      Static 60   0            10.1.1.2        S0/0/0
. I8 p2 m$ T4 V& ~* ]1 L
[h3c2]disp ip routing-table 3 C; E8 ?! }" F7 J
Routing Tables: Public
4 h( |# ~1 p) m0 g% i1 |7 T6 T5 U        Destinations : 7        Routes : 7
Destination/Mask    Proto  Pre  Cost         NextHop         Interface
10.1.1.0/24         Direct 0    0            10.1.1.2        S0/0/0
. z; K0 h' A; |+ T# ]; o2 c10.1.1.1/32         Direct 0    0            10.1.1.1        S0/0/0+ }. y/ m, J( {4 O* Q- n  T
10.1.1.2/32         Direct 0    0            127.0.0.1       InLoop03 O/ R- t, C9 k5 X8 ^# m
127.0.0.0/8         Direct 0    0            127.0.0.1       InLoop08 _7 H/ g) G9 t* X. @; ]9 ?. H: I
127.0.0.1/32        Direct 0    0            127.0.0.1       InLoop0
8 w  K- F' f$ X2 n5 ^192.168.2.0/24      Static 60   0            10.1.1.1        S0/0/0
/ {+ J. H$ A* |+ i' q% E192.168.3.2/32      Direct 0    0            127.0.0.1       InLoop0
0 Y7 ]$ w3 i" t8 @4 v0 G
此时PCAPCB可以相互访问;
C:\Documents and Settings\xiaofei>ping 192.168.3.2
Pinging 192.168.3.2 with 32 bytes of data:
Reply from 192.168.3.2: bytes=32 time=1ms TTL=254
" }+ S1 c2 C7 P, R& f/ mReply from 192.168.3.2: bytes=32 time=1ms TTL=254
/ L  j+ p3 k5 w$ n2 X3 V7 a. mReply from 192.168.3.2: bytes=32 time=3ms TTL=2546 e; l$ n' R+ e! t4 |
Reply from 192.168.3.2: bytes=32 time=1ms TTL=254
Ping statistics for 192.168.3.2:3 }# D& S2 `; Q
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),1 B- Z) W) X1 @, U- o
Approximate round trip times in milli-seconds:
+ O! |# b( W6 ]; s    Minimum = 1ms, Maximum = 3ms, Average = 1ms
! R* P) g4 `# O8 {
RTA试用扩展PING从源地址ping目标成功。
5 W5 ?+ M9 H5 {7 @  D; q+ h, H[h3c1]ping -a 192.168.2.1 192.168.3.2
8 D1 _* h$ ~6 I/ A- U- o  PING 192.168.3.2: 56  data bytes, press CTRL_C to break
* q+ P; L6 p! h8 s8 Y. L1 N    Reply from 192.168.3.2: bytes=56 Sequence=1 ttl=255 time=5 ms) n& e+ c; x8 u4 W; P1 |
    Reply from 192.168.3.2: bytes=56 Sequence=2 ttl=255 time=20 ms* K/ ?2 Y' @9 l( q
    Reply from 192.168.3.2: bytes=56 Sequence=3 ttl=255 time=1 ms
0 u3 o# ^! k1 v- e. p) V' m    Reply from 192.168.3.2: bytes=56 Sequence=4 ttl=255 time=1 ms
/ x# m& ^! j0 r! d    Reply from 192.168.3.2: bytes=56 Sequence=5 ttl=255 time=10 ms
  --- 192.168.3.2 ping statistics ---3 v! O. [% ]$ l7 F
    5 packet(s) transmitted) M. ~& ^& P3 @" i  h* M3 J! R4 {
    5 packet(s) received
2 t+ {0 s4 w' z) P! `" d$ G    0.00% packet loss1 j3 N: f! n$ y) X
    round-trip min/avg/max = 1/7/20 ms
用路由追踪发现经过的路由到达目的网络。
C:\Documents and Settings\xiaofei>tracert 192.168.3.2
Tracing route to 192.168.3.2 over a maximum of 30 hops
  1    <1 ms    <1 ms    <1 ms  192.168.2.15 \; {; j, {/ v" J7 R/ L8 [* Q
  2     1 ms    <1 ms    <1 ms  192.168.3.2
Trace complete.
6 O; w$ J/ v+ ?5 ~- V5 X1 N
您需要登录后才可以回帖 登录 | 注册

本版积分规则

返回首页|Archiver|手机版|小黑屋|易陆发现技术论坛 ( 蜀ICP备2026014127号-1 )

GMT+8, 2026-6-12 03:04 , Processed in 0.029509 second(s), 30 queries .

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

快速回复 返回顶部 返回列表