找回密码
 注册
查看: 2401|回复: 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.2 a: D* w+ ~  }8 T* b* B
Request timed out.
# e1 O+ a+ D% V6 ZRequest timed out.3 M* d; O5 Q1 a4 q
Request timed out.
Ping statistics for 10.1.1.2:# j" t4 W1 j0 p9 w, h0 {
    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.
" P: Y- V* Q: S( T" gRequest timed out.
( M; G. f# c0 m8 S, ]Request timed out.3 B; W' I, Y( @7 K% X
Request timed out.
Ping statistics for 192.168.3.2:" [8 u0 _6 X+ ~5 f5 g2 {8 }
    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 4 o' g# O3 Y0 u( ]
Routing Tables: Public
$ Q$ c9 x' L* T9 ]' |  F9 v        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
6 o+ D$ i& R6 J& o10.1.1.1/32         Direct 0    0            127.0.0.1       InLoop0
5 V+ p; X/ c0 G: N  ?' {9 [$ v10.1.1.2/32         Direct 0    0            10.1.1.2        S0/0/0
5 j% m* g$ Y& o0 Q0 v127.0.0.0/8         Direct 0    0            127.0.0.1       InLoop0& R! N7 X7 }4 N9 a2 n* {! y3 m
127.0.0.1/32        Direct 0    0            127.0.0.1       InLoop0
4 W3 K! v/ p" D. x3 u, _192.168.2.0/24      Direct 0    0            192.168.2.1     Eth0/1/0
9 j8 ^# o# H/ @. F* o% Q192.168.2.1/32      Direct 0    0            127.0.0.1       InLoop0; C# f4 U8 Q3 D# g  E1 b5 T" v/ Z
192.168.3.0/24      Static 60   0            10.1.1.2        S0/0/03 V: o/ y. J( y; ~- A! c2 M
[h3c2]disp ip routing-table # X) h: m4 E7 U5 d/ |4 y7 q8 @
Routing Tables: Public
* j" C  G0 E4 W2 X        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
; X" ~; L3 |4 U7 M3 c. t$ C10.1.1.1/32         Direct 0    0            10.1.1.1        S0/0/0: m1 W. K" Y+ d( ]+ l# c( Q
10.1.1.2/32         Direct 0    0            127.0.0.1       InLoop0
, \: V$ v1 ~$ Y: u  J5 J127.0.0.0/8         Direct 0    0            127.0.0.1       InLoop0# y8 ?3 ?7 a9 r. p
127.0.0.1/32        Direct 0    0            127.0.0.1       InLoop00 r3 f* b$ d$ N8 l' V
192.168.2.0/24      Static 60   0            10.1.1.1        S0/0/0
# l# h: K7 E& N0 G192.168.3.2/32      Direct 0    0            127.0.0.1       InLoop0
% ]! x" ]/ }0 H' o' R1 I: A
此时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
; i3 }9 }  v" w- wReply from 192.168.3.2: bytes=32 time=1ms TTL=254- b/ `5 I0 H8 k7 Y) ]" c+ {
Reply from 192.168.3.2: bytes=32 time=3ms TTL=254
# R7 u0 l! U2 jReply from 192.168.3.2: bytes=32 time=1ms TTL=254
Ping statistics for 192.168.3.2:9 C: y& @4 t1 S6 K1 j
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),1 G, R0 o/ M4 E  D% b
Approximate round trip times in milli-seconds:; K- k0 a- K- w9 p
    Minimum = 1ms, Maximum = 3ms, Average = 1ms; x: R, k$ {; H1 c# t
RTA试用扩展PING从源地址ping目标成功。. c* h% Q* e+ ?' Q
[h3c1]ping -a 192.168.2.1 192.168.3.2* p6 X3 ~7 ?9 ^" u7 u
  PING 192.168.3.2: 56  data bytes, press CTRL_C to break
: O# W8 i% I+ W4 O    Reply from 192.168.3.2: bytes=56 Sequence=1 ttl=255 time=5 ms
7 t" L5 S* K0 u2 d5 i* W2 a4 l    Reply from 192.168.3.2: bytes=56 Sequence=2 ttl=255 time=20 ms
5 [$ P5 o5 u& [2 @0 ?  U    Reply from 192.168.3.2: bytes=56 Sequence=3 ttl=255 time=1 ms
9 a( n, [$ A1 R4 n4 r' O8 E    Reply from 192.168.3.2: bytes=56 Sequence=4 ttl=255 time=1 ms
" T: \$ W7 A3 |# c. s: [    Reply from 192.168.3.2: bytes=56 Sequence=5 ttl=255 time=10 ms
  --- 192.168.3.2 ping statistics ---# `  Q( `! e& k' i' P7 Q+ J
    5 packet(s) transmitted
  |% T7 b" i& E6 e0 u. D; A3 n    5 packet(s) received, l6 L7 N+ {6 [- y4 ^
    0.00% packet loss$ c% \5 ?7 _. n- A$ v
    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" [3 o+ b3 R" Y" [  2     1 ms    <1 ms    <1 ms  192.168.3.2
Trace complete.
5 D1 h" d5 j5 a4 X
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

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

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

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