目标需求:
网络拓扑:
网络拓扑图,相关网段的划分,路由器上的环回网段
实现步骤:
r9两个端口IP的配置:
[r9-GigabitEthernet0/0/0]ip address 192.168.1.1 30
[r9-GigabitEthernet0/0/1]ip address 192.168.1.5 30
r9两个环回的配置:
[r9]int l0
[r9-LoopBack0]ip add 192.168.1.33 28
[r9-LoopBack0]int l1
[r9-LoopBack1]ip add 192.168.1.49 28
r2两个端口的配置:
[r2-GigabitEthernet0/0/0]ip address 192.168.1.2 30
[r2-GigabitEthernet0/0/1]ip address 192.168.1.9 30
r2两个环回的配置:
[r2]int l0
[r2-LoopBack0]ip add 192.168.1.65 28
[r2-LoopBack0]int l1
[r2-LoopBack1]ip address 192.168.1.81 28
r3两个端口的配置:
[r3-GigabitEthernet0/0/0]ip address 192.168.1.6 30
[r3-GigabitEthernet0/0/1]ip address 192.168.1.13 30
r3网关配置
[r3-GigabitEthernet0/0/2]ip address 192.168.1.97 27
r4四个端口的IP配置
[r4-GigabitEthernet0/0/1]ip address 192.168.1.14 30
[r4-GigabitEthernet0/0/0]ip address 192.168.1.10 30
[r4-GigabitEthernet0/0/2]ip address 192.168.1.21 30
[r4-GigabitEthernet4/0/0]ip address 192.168.1.17 30
r4的环回配置
[r4-LoopBack0]ip address 192.168.1.129 28
[r4-LoopBack1]ip address 192.168.1.145 28
r5的三个IP地址的配置
[r5-GigabitEthernet0/0/0]ip address 192.168.1.22 30
[r5-GigabitEthernet0/0/2]ip address 192.168.1.18 30
[r5-GigabitEthernet0/0/1]ip address 12.0.0.5 24
r5的一个环回的配置
[r5-LoopBack0]ip address 192.168.1.161 27
r6的端口IP配置
[r6-GigabitEthernet0/0/0]ip address 12.0.0.6 24
r6的环回配置
[r6-LoopBack0]ip address 1.0.0.6 24
r3配置使得PC1和PC1能过通过DHCP自动获得IP地址
[r3]dhcp en
[r3]ip pool LX
[r3-ip-pool-LX]network 192.168.1.96 mask 27 //前面配置过掩码就不一定要再次配置
[r3-ip-pool-LX]gateway-list 192.168.1.97
[r3-ip-pool-LX]dns-list 8.8.8.8 114.114.114.114
[r3]int g0/0/2 和用户相连接的口
[r3-GigabitEthernet0/0/2]dhcp select global
r1上配置详细的路由信息
[r9]ip route-static 192.168.1.64 27 192.168.1.2
[r9]ip route-static 192.168.1.8 30 192.168.1.2
[r9]ip route-static 192.168.1.128 27 192.168.1.2
[r9]ip route-static 192.168.1.128 27 192.168.1.6
[r9]ip route-static 192.168.1.16 30 192.168.1.2
[r9]ip route-static 192.168.1.16 30 192.168.1.6
[r9]ip route-static 192.168.1.20 30 192.168.1.6
[r9]ip route-static 192.168.1.20 30 192.168.1.2
[r9]ip route-static 192.168.1.12 30 192.168.1.6
[r9]ip route-static 192.168.1.96 27 192.168.1.6
[r9]ip route-static 0.0.0.0 0 192.168.1.2
[r9]ip route-static 0.0.0.0 0 192.168.1.6
r2上配置详细的路由信息
[r2]ip route-static 192.168.1.128 27 192.168.1.10
[r2]ip route-static 192.168.1.16 30 192.168.1.10
[r2]ip route-static 192.168.1.20 30 192.168.1.10
[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.10
[r2]ip route-static 192.168.1.96 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.32 27 192.168.1.1
[r2]ip route-static 0.0.0.0 0 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
[r3]ip route-static 192.168.1.8 30 192.168.1.14
[r3]ip route-static 192.168.1.128 27 192.168.1.14
[r3]ip route-static 192.168.1.16 30 192.168.1.14
[r3]ip route-static 192.168.1.20 30 192.168.1.14
[r3]ip route-static 0.0.0.0 0 192.168.1.14
r4上配置详细的路由信息
[r4]ip route-static 192.168.1.96 27 192.168.1.13
[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.32 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.64 27 192.168.1.9
[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
r5上配置详细的路由信息
[r5]ip route-static 192.168.1.128 27 192.168.1.17
[r5]ip route-static 192.168.1.12 30 192.168.1.17
[r5]ip route-static 192.168.1.96 27 192.168.1.17
[r5]ip route-static 192.168.1.4 30 192.168.1.17
[r5]ip route-static 192.168.1.32 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.64 27 192.168.1.17
[r5]ip route-static 192.168.1.8 30 192.168.1.17
[r5]ip route-static 192.168.1.8 30 192.168.1.21
[r5]ip route-static 192.168.1.64 27 192.168.1.21
[r5]ip route-static 192.168.1.0 30 192.168.1.21
[r5]ip route-static 192.168.1.32 27 192.168.1.21
[r5]ip route-static 192.168.1.4 30 192.168.1.21
[r5]ip route-static 192.168.1.96 27 192.168.1.21
[r5]ip route-static 192.168.1.12 30 192.168.1.21
[r5]ip route-static 192.168.1.128 27 192.168.1.21
[r5]ip route-static 0.0.0.0 0 12.0.0.6
测试:r1 ping通r5
防止环路:
[r9]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
net转换(边界设备不通)
[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
[r9]aaa
[r9-aaa]local-user xll password cipher taolichao level 15
[r9-aaa]local-user xll service-type telnet
[r9]user-interface vty 0 4
[r9-ui-vty0-4]authentication-mode aaa
[r5-GigabitEthernet0/0/1]nat server protocol tcp global current-interface 23 in
side 192.168.1.5 23
<r6>telnet 12.0.0.5
telent服务
修改优先级
[r4]ip route-static 0.0.0.0 0 192.168.1.18 preference 61
[r5]ip route-static 192.168.1.8 30 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.0 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.4 30 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.12 30 192.168.1.21 preference 61
[r5]ip route-static 192.168.1.128 27 192.168.1.21 preference 61