要求:
思路:
1.设计拓扑
2.分配IP地址
3.路由
4.策略
5.测试、排错
具体过程:
1.拓扑
2. R1-R6IP地址配置
配置环回:
命令例如:
[R1]interface LoopBack 0
[R1-LoopBack0]ip address 192.168.1.33 28
配置IP
命令例如:
[R1]int GigabitEthernet0/0/0
[R1-GigabitEthernet0/0/0]ip address 192.168.1.5 30
IP配置如下:
R1:
R2:
R3:
R4:
R5:
R6:
配置完成后,先测试一下
3.用户自动获取IP
再R3上操作如下:
[R3]dhcp enable
Info: The operation may take a few seconds. Please wait for a moment.done.
[R3]ip pool j
Info: It's successful to create an IP address pool.
[R3-ip-pool-j]network 192.168.1.96 mask 27 //所在网段
[R3-ip-pool-j]gateway-list 192.168.1.97 //配置网关
[R3-ip-pool-j]dns-list 114.114.114.114 8.8.8.8 //配置dns
[R3-ip-pool-j]q
[R3-ip-pool-j]int g0/0/2
[R3-GigabitEthernet0/0/2]dhcp select global //dhcp服务
然后双击PC
查看是否获取到IP
4.配置路由:
4.1R1-R5缺省路由配置:
[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]ip route-static 0.0.0.0 0 192.168.1.10
[R3]ip route-static 0.0.0.0 0 192.168.1.14
[R4]ip route-static 0.0.0.0 0 192.168.1.18
[R5]ip route-static 0.0.0.0 0 56.1.1.2
4.2静态路由配置:
R1:命令
[R1]ip route-static 192.168.1.64 27 192.168.1.2
[R1]ip route-static 192.168.1.8 30 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
查看R1 静态路由
R2:命令
[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.96 27 192.168.1.1
[R2]ip route-static 192.168.1.96 27 192.168.1.10
R3:命令
[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
[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
R4:命令
[R4]ip route-static 192.168.1.64 27 192.168.1.9
[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
[R4]ip route-static 192.168.1.96 27 192.168.1.13
[R4]ip route-static 192.168.1.32 27 192.168.1.13
[R4]ip route-static 192.168.1.32 27 192.168.1.9
R5:命令
[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
5.备份链路配置
[R4]ip route-static 0.0.0.0 0 192.168.1.22 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
[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
测试:
[R4]int GigabitEthernet 4/0/0
[R4-GigabitEthernet4/0/0]shutdown
R5上:
6.R1-R5可访问R6环回
[R5]acl 2000
[R5-acl-basic-2000]rule permit source 192.168.1.0 0.0.0.255
[R5]int g0/0/1
[R5-GigabitEthernet0/0/1]nat outbound 2000
7.NULL 0
[R2]ip route-static 192.168.1.64 27 NULL 0
[R4]ip route-static 192.168.1.128 27 NULL 0