-
实验拓扑
-
实验需求
1.R6为ISP,接口IP地址均为共有地址,只配置IP地址之后不能对其进行任何配置。
2.R1-R5为局域网,私有IP地址192.168.1.0/24合理分配。
3.R1R2R4,各有两个环回,R5R6各有一个环回,均代表用户接入。
4.R3下面两台电脑通过DHCP获取IP;
5.选路最佳,路由表尽量小避免环路
6.R1-R5均可以访问R6的环回;
7.R1上配置telnet服务,使R6能通过R5的共有地址telnet到R1上;
8.R4与R5正常走千兆故障走百兆;
实验思路
1、IP地址合理划分并配置。
2、手写静态路由以及缺省路由确保无误。
3、R5上面配置基本nat使局域网能够访问互联网。
4、在R3上面配置DHCP使电脑能够获取IP地址
5、在R4和R5上面配置路由优先级。
6、在R5上面配置nat服务器使R1的23端口和公网地址的23端口绑定。
实验步骤
1、配置IP地址。
R1:
[r1]int l0
[r1-LoopBack0]ip address 192.168.1.33 28
[r1-LoopBack0]int l1
[r1-LoopBack1]ip address 192.168.1.49 28
[r1-LoopBack1]int g0/0/0
[r1-GigabitEthernet0/0/0]ip address 192.168.1.1 30
[r1-GigabitEthernet0/0/0]int g0/0/1
[r1-GigabitEthernet0/0/1]ip address 192.168.1.5 30
R2:
[r2]int l0
[r2-LoopBack0]ip address 192.168.1.65 28
[r2-LoopBack0]int l1
[r2-LoopBack1]ip address 192.168.1.81 28
[r2-LoopBack1]int g0/0/0
[r2-GigabitEthernet0/0/0]ip address 192.168.1.2 30
[r2-GigabitEthernet0/0/0]int g0/0/1
[r2-GigabitEthernet0/0/1]ip address 192.168.1.9 30
R3:
[r3]int g0/0/0
[r3-GigabitEthernet0/0/0]ip address 192.168.1.6 30
[r3-GigabitEthernet0/0/0]int g0/0/1
[r3-GigabitEthernet0/0/1]ip address 192.168.1.13 30
[r3-GigabitEthernet0/0/1]int g0/0/2
[r3-GigabitEthernet0/0/2]ip address 192.168.1.97 27
R4:
[r4]int g0/0/0
[r4-GigabitEthernet0/0/0]ip address 192.168.1.10 30
[r4-GigabitEthernet0/0/0]int g0/0/1
[r4-GigabitEthernet0/0/1]ip address 192.168.1.14 30
[r4-GigabitEthernet0/0/1]int g0/0/2
[r4-GigabitEthernet0/0/2]ip address 192.168.1.17 30
[r4-GigabitEthernet0/0/2]int g4/0/0
[r4-GigabitEthernet4/0/0]ip address 192.168.1.21 30
[r4-GigabitEthernet4/0/0]int l0
[r4-LoopBack0]ip address 192.168.1.129 28
[r4-LoopBack0]int l1
[r4-LoopBack1]ip address 192.168.1.145 28
R5:
[r5]int l0
[r5-LoopBack0]ip address 192.168.1.161 27
[r5-LoopBack0]int g0/0/0
[r5-GigabitEthernet0/0/0]ip address 192.168.1.18 30
[r5-GigabitEthernet0/0/0]int g0/0/2
[r5-GigabitEthernet0/0/2]ip address 192.168.1.22 30
[r5-GigabitEthernet0/0/2]int g0/0/1
[r5-GigabitEthernet0/0/1]ip address 12.0.0.1 24
R6:
[r6]int g0/0/0
[r6-GigabitEthernet0/0/0]ip address 12.0.0.2 24
[r6-GigabitEthernet0/0/0]int l0
[r6-LoopBack0]ip address 1.0.0.1 24
2、手写静态路由
R1:
[r1]ip route-static 0.0.0.0 0 192.168.1.2
[r1]ip route-static 0.0.0.0 0 192.168.1.6
R2:
[r2]ip route-static 0.0.0.0 0 192.168.1.10
[r2]ip route-static 192.168.1.32 27 192.168.1.1
[r2]ip route-static 192.168.1.4 30 192.168.1.1
[r2]ip route-static 192.168.1.12 30 192.168.1.10
[r2]ip route-static 192.168.1.96 27 192.168.1.1
[r2]ip route-static 192.168.1.96 27 192.168.1.10
R3:
[r3]ip route-static 0.0.0.0 0 192.168.1.14
[r3]ip route-static 192.168.1.32 27 192.168.1.5
[r3]ip route-static 192.168.1.64 27 192.168.1.5
[r3]ip route-static 192.168.1.64 27 192.168.1.14
[r3]ip route-static 192.168.1.0 30 192.168.1.5
[r3]ip route-static 192.168.1.8 30 192.168.1.14
R4:
[r4]ip route-static 0.0.0.0 0 192.168.1.18
[r4]ip route-static 192.168.1.32 27 192.168.1.9
[r4]ip route-static 192.168.1.32 27 192.168.1.13
[r4]ip route-static 192.168.1.64 27 192.168.1.9
[r4]ip route-static 192.168.1.96 27 192.168.1.13
[r4]ip route-static 192.168.1.0 30 192.168.1.9
[r4]ip route-static 192.168.1.4 30 192.168.1.13
R5:
[r5]ip route-static 0.0.0.0 0 12.0.0.2
[r5]ip route-static 192.168.1.32 27 192.168.1.17
[r5]ip route-static 192.168.1.64 27 192.168.1.17
[r5]ip route-static 192.168.1.96 27 192.168.1.17
[r5]ip route-static 192.168.1.128 27 192.168.1.17
[r5]ip route-static 192.168.1.0 30 192.168.1.17
[r5]ip route-static 192.168.1.4 30 192.168.1.17
[r5]ip route-static 192.168.1.8 30 192.168.1.17
[r5]ip route-static 192.168.1.12 30 192.168.1.17
3、在汇总的路由器上配置空接口路由避免路由环路
[r1]ip route-static 192.168.1.32 27 NULL0
[r2]ip route-static 192.168.1.64 27 NULL 0
[r3]ip route-static 192.168.1.96 27 NULL 0
[r4]ip route-static 192.168.1.128 27 NULL 0
4、在R4和R5上面配置路由优先级实现故障备份。
R4:
[r4]ip route-static 0.0.0.0 0 192.168.1.22 preference 61
R5:
[r5]ip route-static 192.168.1.0 30 192.168.1.21 preference 61
[r5]ip route-static 192.168.1.4 30 192.168.1.21 preference 61
[r5]ip route-static 192.168.1.8 30 192.168.1.21 preference 61
[r5]ip route-static 192.168.1.12 30 192.168.1.21 preference 61
[r5]ip route-static 192.168.1.32 27 192.168.1.21 preference 61
[r5]ip route-static 192.168.1.64 27 192.168.1.21 preference 61
[r5]ip route-static 192.168.1.96 27 192.168.1.21 preference 61
[r5]ip route-static 192.168.1.128 27 192.168.1.21 preference 61
5、配置基本nat实现私网上网。
[r5]acl 2000
[r5-acl-basic-2000]rule permit source 192.168.1.0 0.0.0.255
[r5-acl-basic-2000]q
[r5]int g0/0/1
[r5-GigabitEthernet0/0/1]nat outbound 2000
6、在R3上配置DHCP使电脑能自动获取IP
[r3]dhcp enable
[r3]ip pool a
Info: It's successful to create an IP address pool.
[r3-ip-pool-a]network 192.168.1.96 ma 27
[r3-ip-pool-a]gateway-list 192.168.1.97
[r3-ip-pool-a]q
[r3]int g0/0/2
[r3-GigabitEthernet0/0/2]dhcp select global
7、在R1上面开启telnet功能
[r1]aaa
[r1-aaa]local-user xiaomi password cipher 123456
[r1-aaa]local-user xiaomi service-type telnet
[r1-ui-vty0-4]authentication-mode aaa
8、在R5上面配置nat服务器使R6能远程连接R1
[r5-GigabitEthernet0/0/1]nat server protocol tcp global current-interface 23 ins
ide 192.168.1.1 23
Warning:The port 23 is well-known port. If you continue it may cause function fa
ilure.
Are you sure to continue?[Y/N]:y
测试:
telnet:
Pc上网:
全网可达: