易陆发现互联网技术论坛

 找回密码
 开始注册
查看: 2393|回复: 0
收起左侧

H3C设备之静态路由实验

[复制链接]
发表于 2021-3-11 21:49:45 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?开始注册

x
https://www.bbs168x.cn/forum.php?mod=attachment&aid=MTk3fDU3NTIzMTNlfDE3NzU2NTUwOTl8MHw%3D
C:\Documents and Settings\xiaofei>ping 10.1.1.2
Pinging 10.1.1.2 with 32 bytes of data:
Request timed out.$ g9 f2 E8 e) {  _4 S
Request timed out.
6 n, ~# s( b) a7 P3 W6 o6 q5 h5 rRequest timed out.
- o( e! x7 o8 R- d' `Request timed out.
Ping statistics for 10.1.1.2:- C* f6 l  T1 ~7 C
    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.
1 w/ s  m% C+ F' n. W/ MRequest timed out.
5 g( v9 o" ^3 iRequest timed out.6 t  Z( x; B9 N
Request timed out.
Ping statistics for 192.168.3.2:% a5 C/ X4 O% m1 Q# q1 D7 h
    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# @" k& {  RRouting Tables: Public
! A3 c! b6 Y9 a2 {0 t        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/07 v2 S3 [3 V* k  m6 I3 p
10.1.1.1/32         Direct 0    0            127.0.0.1       InLoop0
: J* j0 i& Q) w* S! P$ X$ \10.1.1.2/32         Direct 0    0            10.1.1.2        S0/0/0
. w% y" n/ W6 m7 {127.0.0.0/8         Direct 0    0            127.0.0.1       InLoop04 f' j& H7 j" x1 H
127.0.0.1/32        Direct 0    0            127.0.0.1       InLoop0
) A# T' Y7 y% {5 p+ v, ^9 `4 L9 u192.168.2.0/24      Direct 0    0            192.168.2.1     Eth0/1/0
9 M" \5 i* i: W- d192.168.2.1/32      Direct 0    0            127.0.0.1       InLoop0* g. v! L0 @9 W5 O! \
192.168.3.0/24      Static 60   0            10.1.1.2        S0/0/0( X" ^' F5 q' a& B1 H
[h3c2]disp ip routing-table $ n, d, c6 O. p" H
Routing Tables: Public+ \  L0 V. U( u* y  F
        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/ V' W7 @- J# m" k
10.1.1.1/32         Direct 0    0            10.1.1.1        S0/0/0& a7 z8 @0 ^0 ?. f
10.1.1.2/32         Direct 0    0            127.0.0.1       InLoop0
$ K% i) f  u3 m127.0.0.0/8         Direct 0    0            127.0.0.1       InLoop0
/ X* n! X" W: R! P$ t7 {127.0.0.1/32        Direct 0    0            127.0.0.1       InLoop0
4 r  [1 H% L' M4 [* F& P& }4 G192.168.2.0/24      Static 60   0            10.1.1.1        S0/0/0
6 @0 U3 D& a8 k3 |2 V$ y# N192.168.3.2/32      Direct 0    0            127.0.0.1       InLoop0! d) _& K5 K+ S. d: T
此时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=2544 V0 l* T8 `1 a+ ~3 v
Reply from 192.168.3.2: bytes=32 time=1ms TTL=254/ z- t4 N( Z1 f/ Y, @
Reply from 192.168.3.2: bytes=32 time=3ms TTL=254
/ F9 ]& `8 a$ S/ Y8 T, S7 }Reply from 192.168.3.2: bytes=32 time=1ms TTL=254
Ping statistics for 192.168.3.2:
" o5 x' `1 V/ N+ b/ ]6 O3 N    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),. x" Y. l" I5 h  U1 j' N4 u
Approximate round trip times in milli-seconds:
) y: [" U0 J4 @/ }+ |  H* [9 f    Minimum = 1ms, Maximum = 3ms, Average = 1ms
& D: L+ \$ I7 q  |7 l9 W
RTA试用扩展PING从源地址ping目标成功。
2 `7 B, o: {* J- p+ v4 }/ R) s[h3c1]ping -a 192.168.2.1 192.168.3.2: e  a/ B5 N& c! V
  PING 192.168.3.2: 56  data bytes, press CTRL_C to break5 O3 P/ c9 k7 ^* X2 w1 X7 q
    Reply from 192.168.3.2: bytes=56 Sequence=1 ttl=255 time=5 ms# n% C5 f/ B4 A3 [
    Reply from 192.168.3.2: bytes=56 Sequence=2 ttl=255 time=20 ms+ A; ?$ n' E! F
    Reply from 192.168.3.2: bytes=56 Sequence=3 ttl=255 time=1 ms7 P9 v: ?: h7 e2 Y+ ^: [& K) F
    Reply from 192.168.3.2: bytes=56 Sequence=4 ttl=255 time=1 ms
+ H3 ~* F7 Y" d2 ~# L    Reply from 192.168.3.2: bytes=56 Sequence=5 ttl=255 time=10 ms
  --- 192.168.3.2 ping statistics ---
" E) e9 n6 X% r- j! g    5 packet(s) transmitted
' B- @: I% ^& P+ S) M, u: a    5 packet(s) received% ?1 r2 x/ E; e
    0.00% packet loss
) D6 Q! }& U8 U( K    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.1
9 D- y( X/ t! I$ b* g) V2 N  2     1 ms    <1 ms    <1 ms  192.168.3.2
Trace complete.
; W" X! x0 ^, @
实验图.png
您需要登录后才可以回帖 登录 | 开始注册

本版积分规则

关闭

站长推荐上一条 /4 下一条

北京云银创陇科技有限公司以云计算运维,代码开发

QQ|返回首页|Archiver|小黑屋|易陆发现技术论坛 ( 蜀ICP备2026014127号-1 )点击这里给我发消息

GMT+8, 2026-4-8 21:31 , Processed in 0.052905 second(s), 28 queries .

Powered by Discuz! X3.4 Licensed

© 2012-2025 Discuz! Team.

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