静态路由实验

实验拓扑

image-20240115143007562

实验需求

  1. 按照图示搭建拓扑并配置IP地址,LoopBack地址

  2. 在RTA上配置静态路由

  3. 在RTB上配置静态路由

  4. 在RTC上配置静态路由

  5. 测试:在RTA上ping RTC的IP地址

实验解析

1、配置IP地址,LoopBack地址

步骤1:配置RTA的IP地址,loopback地址

[RTA]int LoopBack 0
[RTA-LoopBack0]ip address 1.1.1.1 32
[RTA-LoopBack0]int g0/0
[RTA-GigabitEthernet0/0]ip address 192.168.10.1 24

步骤2:配置RTB的IP地址,loopback地址

[RTB]int loopback 0
[RTB-LoopBack0]ip address 2.2.2.2 32
[RTB-LoopBack0]int g0/0
[RTB-GigabitEthernet0/0]ip address 192.168.10.2 24
[RTB-GigabitEthernet0/0]int g0/1
[RTB-GigabitEthernet0/1]ip address 192.168.20.1 24

步骤3:配置RTC的IP地址,loopback地址

[RTC]int loopback 0
[RTC-LoopBack0]ip address 3.3.3.3 32
[RTC-LoopBack0]int g0/0
[RTC-GigabitEthernet0/0]ip address 192.168.20.2 24

2、在RTA上配置静态路由

[RTA]ip route-static 3.3.3.3 32 192.168.10.2 
[RTA]ip route-static 192.168.20.2 24 192.168.10.2

3、在RTB上配置静态路由

[RTB]ip route-static 1.1.1.1 32 192.168.10.1
[RTB]ip route-static 3.3.3.3 32 192.168.20.2

4、在RTC上配置静态路由

[RTC]ip route-static 1.1.1.1 32 192.168.20.1
[RTC]ip route-static 192.168.10.1 24 192.168.20.1

测试:在RTA上ping RTC的IP地址,loopback地址

[RTA]ping 192.168.20.2
Ping 192.168.20.2 (192.168.20.2): 56 data bytes, press CTRL+C to break
56 bytes from 192.168.20.2: icmp_seq=0 ttl=254 time=0.903 ms
56 bytes from 192.168.20.2: icmp_seq=1 ttl=254 time=0.903 ms
56 bytes from 192.168.20.2: icmp_seq=2 ttl=254 time=0.599 ms
56 bytes from 192.168.20.2: icmp_seq=3 ttl=254 time=0.811 ms
56 bytes from 192.168.20.2: icmp_seq=4 ttl=254 time=0.483 ms

[RTA]ping 3.3.3.3
Ping 3.3.3.3 (3.3.3.3): 56 data bytes, press CTRL+C to break
56 bytes from 3.3.3.3: icmp_seq=0 ttl=254 time=1.147 ms
56 bytes from 3.3.3.3: icmp_seq=1 ttl=254 time=0.796 ms
56 bytes from 3.3.3.3: icmp_seq=2 ttl=254 time=0.697 ms
56 bytes from 3.3.3.3: icmp_seq=3 ttl=254 time=0.878 ms
56 bytes from 3.3.3.3: icmp_seq=4 ttl=254 time=0.841 ms