目录
一.实验要求
二 .分析实验
1.R6 只配 IP地址,为了全网可通,需要在R5上开通NAPT–网络地址端口转换操作
2.R1-R5需要合理划分 192.168.1.0/24 网段
3.R3 要开启DHCP协议
4.为实现路由表尽量小,可以配置一条缺省路由,而且需要配置空接口以防路由黑洞的产生
5.R1开通Telnet,R5需做端口映射
6.R4和R5之间配置一条浮动静态路由以达到不同情况选用不同路径的需求
三.实验过程
1.划分IP
(1)划分192.168.1.0/24
192.168.1.0/27(骨干链路) | 192.168.1.32/27 (R1两个环回) | 192.168.1.64/27 (R2两个环回) | 192.168.1.96/27 (R3的IP池) |
192.168.1.128/27 (R4两个环回) | 192.168.1.160/27 (R5环回) | 192.168.1.192/27(保留IP) | 192.168.1.224/27 (保留IP) |
(2)划分骨干链路192.168.1.0/27
192.168.1.0/30(R1-R2) | 192.168.1.4/30 (R1-R3) |
192.168.1.8/30 (R2-R4) | 192.168.1.12/30 (R3-R4) |
192.168.1.16/30 (R4-R5 1000M) | 192.168.1.20/30 (R4-R5 100M) |
192.168.1.24/30(保留IP) | 192.168.1.28/30(保留IP) |
2.配置所有接口的IP
[R1]int g0/0/0
[R1-GigabitEthernet0/0/0]ip address 192.168.1.1 30
[R1-GigabitEthernet0/0/0]int g 0/0/1
[R1-GigabitEthernet0/0/1]ip address 192.168.1.5 30
[R2]int g 0/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]int g 0/0/0
[R3-GigabitEthernet0/0/0]ip address 192.168.1.6 30
[R3-GigabitEthernet0/0/0]int g 0/0/1
[R3-GigabitEthernet0/0/1]ip add 192.168.1.13 30
[R4]int g 0/0/0
[R4-GigabitEthernet0/0/0]ip address 192.168.1.10 30
[R4-GigabitEthernet0/0/0]int g 0/0/1
[R4-GigabitEthernet0/0/1]ip address 192.168.1.14 30
[R4-GigabitEthernet0/0/1]int g 0/0/2
[R4-GigabitEthernet0/0/2]ip address 192.168.1.21 30
[R4-GigabitEthernet0/0/2]int g 4/0/0
[R4-GigabitEthernet4/0/0]ip address 192.168.1.17 30
[R5]int g 0/0/0
[R5-GigabitEthernet0/0/0]ip address 192.168.1.18 30
[R5-GigabitEthernet0/0/0]int g 0/0/1
[R5-GigabitEthernet0/0/1]ip address 192.168.1.22 30
[R5-GigabitEthernet0/0/1]int g 0/0/2
[R5-GigabitEthernet0/0/2]ip address 12.0.0.1 24
[R6]int g 0/0/0
[R6-GigabitEthernet0/0/0]ip add 12.0.0.2 24
3.配置环回接口的IP
192.168.1.32/27(R1两个环回) | 192.168.1.32/28 192.168.1.14/28 | 192.168.1.64/27(R2两个环回) | 192.168.1.64/28 192.168.1.80/28 |
192.168.1.128/27(R4两个环回) | 192.168.1.128/28 192.168.1.144/28 | 192.168.1.160/27(R5环回) | 192.168.1.160/27 |
[R1]interface LoopBack 0
[R1-LoopBack0]ip add 192.168.1.33 28
[R1]int l 1
[R1-LoopBack1]ip add 192.168.1.49 28
[R2]int LoopBack 0
[R2-LoopBack0]ip add 192.168.1.65 28
[R2-LoopBack0]int l 1
[R2-LoopBack1]ip add 192.168.1.81 28
[R4]int LoopBack 0
[R4-LoopBack0]ip add 192.168.1.129 28
[R4-LoopBack0]int l 1
[R4-LoopBack1]ip add 192.168.1.145 28
[R5]int LoopBack 0
[R5-LoopBack0]ip add 192.168.1.161 27
[R6]int LoopBack 0
[R6-LoopBack0]ip add 1.1.1.1 24
4.R3使用DHCP协议
[R3]dhcp enable
[R3]ip pool R3
[R3-ip-pool-R3]network 192.168.1.96 mask 27
[R3-ip-pool-R3]gateway-list 192.168.1.126
[R3-ip-pool-R3]dns-list 114.114.114.114
[R3-ip-pool-R3]int g 0/0/2
[R3-GigabitEthernet0/0/2]dhcp select global
5.配置缺省路由
[R1]ip route-static 0.0.0.0 0 192.168.1.2
[R1]ip route-static 192.168.1.96 27 192.168.1.6
[R1]ip route-static 192.168.1.12 30 192.168.1.6
[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
[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.0 30 192.168.1.5
[R4]ip route-static 0.0.0.0 0 192.168.1.18
[R4]ip route-static 0.0.0.0 0 192.168.1.22 preference 61
[R4]ip route-static 192.168.1.0 30 192.168.1.9
[R4]ip route-static 192.168.1.64 27 192.168.1.9
[R4]ip route-static 192.168.1.4 30 192.168.1.13
[R4]ip route-static 192.168.1.32 27 192.168.1.13
[R4]ip route-static 192.168.1.96 27 192.168.1.13
[R5]ip route-static 192.168.1.0 24 192.168.1.17
[R5]ip route-static 192.168.1.0 24 192.168.1.21 preference 60
[R5]ip route-static 0.0.0.0 0 12.0.0.2
6.配置空接口以防路由黑洞产生
[R1]ip route-static 192.168.1.32 27 NULL 0
[R2]ip route-static 192.168.1.64 27 NULL 0
[R4]ip route-static 192.168.1.128 27 NULL 0
7.在R5上配置NAPT
8.在R1上开启Telnet服务,并在R5配置端口映射
R1上的配置
[R1]aaa
[R1-aaa]local-user admin privilege level 15 password cipher 123456
[R1-aaa]local-user admin service-type telnet
[R1]user-interface vty 0 4
[R1-ui-vty0-4]authentication-mode aaa
R5上的配置
[R5-GigabitEthernet0/0/2]nat server protocol tcp global current-interface 23 inside 192.168.1.1 telnet
测试: