admin 发表于 2021-3-11 21:49:45

H3C设备之静态路由实验

attach://197.pngC:\Documents and Settings\xiaofei>ping 10.1.1.2Pinging 10.1.1.2 with 32 bytes of data:Request timed out.
Request timed out.
Request timed out.
Request timed out.Ping statistics for 10.1.1.2:
    Packets: Sent = 4, Received = 0, Lost = 4 (100% loss),C:\Documents and Settings\xiaofei>ping 192.168.3.2Pinging 192.168.3.2 with 32 bytes of data:Request timed out.
Request timed out.
Request timed out.
Request timed out.Ping statistics for 192.168.3.2:
    Packets: Sent = 4, Received = 0, Lost = 4 (100% loss),C:\Documents and Settings\xiaofei>PCA处于单独一个网段,想要访问PCB,通过路由转发数据跨网段需要做路由,此时可以使用静态路由来实现。ip route-static 192.168.3.0 255.255.255.0 10.1.1.2指定目标网段以及下一跳出口ip route-static 192.168.2.0 255.255.255.0 10.1.1.1此时RTA,B上都有对端网段的路由:disp ip routing-table
Routing Tables: Public
      Destinations : 8      Routes : 8Destination/Mask    ProtoPreCost         NextHop         Interface10.1.1.0/24         Direct 0    0            10.1.1.1      S0/0/0
10.1.1.1/32         Direct 0    0            127.0.0.1       InLoop0
10.1.1.2/32         Direct 0    0            10.1.1.2      S0/0/0
127.0.0.0/8         Direct 0    0            127.0.0.1       InLoop0
127.0.0.1/32      Direct 0    0            127.0.0.1       InLoop0
192.168.2.0/24      Direct 0    0            192.168.2.1   Eth0/1/0
192.168.2.1/32      Direct 0    0            127.0.0.1       InLoop0
192.168.3.0/24      Static 60   0            10.1.1.2      S0/0/0
disp ip routing-table
Routing Tables: Public
      Destinations : 7      Routes : 7Destination/Mask    ProtoPreCost         NextHop         Interface10.1.1.0/24         Direct 0    0            10.1.1.2      S0/0/0
10.1.1.1/32         Direct 0    0            10.1.1.1      S0/0/0
10.1.1.2/32         Direct 0    0            127.0.0.1       InLoop0
127.0.0.0/8         Direct 0    0            127.0.0.1       InLoop0
127.0.0.1/32      Direct 0    0            127.0.0.1       InLoop0
192.168.2.0/24      Static 60   0            10.1.1.1      S0/0/0
192.168.3.2/32      Direct 0    0            127.0.0.1       InLoop0
此时PCAPCB可以相互访问;C:\Documents and Settings\xiaofei>ping 192.168.3.2Pinging 192.168.3.2 with 32 bytes of data:Reply from 192.168.3.2: bytes=32 time=1ms TTL=254
Reply from 192.168.3.2: bytes=32 time=1ms TTL=254
Reply from 192.168.3.2: bytes=32 time=3ms TTL=254
Reply from 192.168.3.2: bytes=32 time=1ms TTL=254Ping statistics for 192.168.3.2:
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 1ms, Maximum = 3ms, Average = 1ms
RTA试用扩展PING从源地址ping目标成功。
ping -a 192.168.2.1 192.168.3.2
PING 192.168.3.2: 56data bytes, press CTRL_C to break
    Reply from 192.168.3.2: bytes=56 Sequence=1 ttl=255 time=5 ms
    Reply from 192.168.3.2: bytes=56 Sequence=2 ttl=255 time=20 ms
    Reply from 192.168.3.2: bytes=56 Sequence=3 ttl=255 time=1 ms
    Reply from 192.168.3.2: bytes=56 Sequence=4 ttl=255 time=1 ms
    Reply from 192.168.3.2: bytes=56 Sequence=5 ttl=255 time=10 ms--- 192.168.3.2 ping statistics ---
    5 packet(s) transmitted
    5 packet(s) received
    0.00% packet loss
    round-trip min/avg/max = 1/7/20 ms用路由追踪发现经过的路由到达目的网络。C:\Documents and Settings\xiaofei>tracert 192.168.3.2Tracing route to 192.168.3.2 over a maximum of 30 hops1    <1 ms    <1 ms    <1 ms192.168.2.1
2   1 ms    <1 ms    <1 ms192.168.3.2Trace complete.
页: [1]
查看完整版本: H3C设备之静态路由实验