HCIP——构建部分网络类型实验
实验要求
基本拓扑
注:实验时,因为我用的是AR1220,内部并没有串行接口,所以先在几个路由器中先拉入2SA接口卡。
PC地址配置DHCP
R1:
[R1]dhcp enable
[R1]ip pool 1
[R1-ip-pool-1]network 192.168.1.0 mask 24
[R1-ip-pool-1]dns-list 8.8.8.8
[R1-ip-pool-1]gateway-list 192.168.1.254
[R1-ip-pool-1]int g 0/0/0
[R1-GigabitEthernet0/0/0]ip address 192.168.1.254 24
[R1-GigabitEthernet0/0/0]dhcp select global
R2:
[R2]dhcp enable
[R2]ip pool 2
[R2-ip-pool-2]network 192.168.2.0 mask 24
[R2-ip-pool-2]dns-list 8.8.8.8
[R2-ip-pool-2]gateway-list 192.168.2.254
[R2-ip-pool-2]int g 0/0/0
[R2-GigabitEthernet0/0/0]ip address 192.168.2.254 24
[R2-GigabitEthernet0/0/0]dhcp select global
R3:
[R3]dhcp enable
[R3]ip pool 3
[R3-ip-pool-3]network 192.168.3.0 mask 24
[R3-ip-pool-3]dns-list 8.8.8.8
[R3-ip-pool-3]gateway-list 192.168.3.254
[R3-ip-pool-3]int g 0/0/0
[R3-GigabitEthernet0/0/0]ip address 192.168.3.254 24
[R3-GigabitEthernet0/0/0]dhcp select global
R4:
[R4]dhcp enable
[R4]ip pool 4
[R4-ip-pool-4]network 192.168.4.0 mask 24
[R4-ip-pool-4]dns-list 8.8.8.8
[R4-ip-pool-4]gateway-list 192.168.4.254
[R4-ip-pool-4]int g 0/0/0
[R4-GigabitEthernet0/0/0]ip address 192.168.4.254 24
[R4-GigabitEthernet0/0/0]dhcp select global
R1与R5之间的PPP协议的PAP认证
主认证方
[R5]interface s1/0/0
[R5-Serial1/0/0]ip address 15.1.1.2 24
[R5-Serial1/0/0]link-protocol ppp
[R5-Serial1/0/0]aaa
[R5-aaa]local-user yuhui password cipher 123
[R5-aaa]local-user yuhui service-type ppp
[R5]interface s1/0/0
[R5-Serial1/0/0]ppp authentication-mode pap
被认证方
[R1]interface s1/0/0
[R1-Serial1/0/0]ip address 15.1.1.1 24
[R1-Serial1/0/0]link-protocol ppp
[R1-Serial1/0/0]ppp pap local-user yuhui password cipher 123
R2与R5之间的PPP协议的CHAP认证
主认证方
[R5]aaa
[R5-aaa]local-user yuhu password cipher 123
[R5-aaa]local-user yuhu service-type ppp
[R5]interface s1/0/1
[R5-Serial1/0/1]ip address 25.1.1.2 24
[R5-Serial1/0/1]link-protocol ppp
[R5-Serial1/0/1]ppp authentication-mode chap
被认证方
[R2]interface s1/0/1
[R2-Serial1/0/1]ip address 25.1.1.1 24
[R2-Serial1/0/1]link-protocol ppp
[R2-Serial1/0/1]ppp chap user yuhu
[R2-Serial1/0/1]ppp chap password cipher 123
R3与R5之间的HDLC封装
[R3]interface s2/0/0
[R3-Serial2/0/0]ip address 35.1.1.1 24
[R3-Serial2/0/0]link-protocol hdlc
[R5]interface s2/0/0
[R5-Serial2/0/0]ip address 35.1.1.2 24
[R5-Serial2/0/0]link-protocol hdlc
R1/2/3构建MGRE
中心站点R1
[R1]interface Tunnel 0/0/0
[R1-Tunnel0/0/0]ip address 10.1.1.1 24
[R1-Tunnel0/0/0]tunnel-protocol gre p2mp
[R1-Tunnel0/0/0]source 35.1.1.1
[R1-Tunnel0/0/0]nhrp entry multicast dynamic
[R1-Tunnel0/0/0]nhrp network-id 100
分支站点R2、R3
[R2]interface t0/0/0
[R2-Tunnel0/0/0]ip address 10.1.1.2 24
[R2-Tunnel0/0/0]tunnel-protocol gre p2mp
[R2-Tunnel0/0/0]source 25.1.1.1
[R2-Tunnel0/0/0]nhrp network-id 100
[R2-Tunnel0/0/0]nhrp entry 10.1.1.1 15.1.1.1 register
[R3]interface t0/0/0
[R3-Tunnel0/0/0]ip address 10.1.1.3 24
[R3-Tunnel0/0/0]tunnel-protocol gre p2mp
[R3-Tunnel0/0/0]source 35.1.1.1
[R3-Tunnel0/0/0]nhrp network-id 100
[R3-Tunnel0/0/0]nhrp entry 10.1.1.1 15.1.1.1 register
R1与R4的GRE
[R1]interface Tunnel0/0/1
[R1-Tunnel0/0/1]ip address 201.1.1.1 24
[R1-Tunnel0/0/1]tunnel-protocol gre
[R1-Tunnel0/0/1]source 15.1.1.1
[R1-Tunnel0/0/1]destination 45.1.1.1
[R4]interface t0/0/1
[R4-Tunnel0/0/1]ip address 201.1.1.2 24
[R4-Tunnel0/0/1]tunnel-protocol gre
[R4-Tunnel0/0/1]source 45.1.1.1
[R4-Tunnel0/0/1]destination 15.1.1.1
R1/2/3/4配置RIP
[R1]rip 100
[R1-rip-100]ver 2
[R1-rip-100]un summary
[R1-rip-100]network 192.168.1.0
[R1-rip-100]network 10.0.0.0
[R2]rip 100
[R2-rip-100]ver 2
[R2-rip-100]un summary
[R2-rip-100]network 192.168.2.0
[R2-rip-100]network 10.0.0.0
[R3]rip 100
[R3-rip-100]ver 2
[R3-rip-100]un summary
[R3-rip-100]network 192.168.3.0
[R3-rip-100]network 10.0.0.0
[R4]rip 100
[R4-rip-100]ver 2
[R4-rip-100]un summary
[R4-rip-100]network 20.0.0.0
[R4-rip-100]network 192.168.4.0
访问R5环回配置
r5环回:
[isp]interface LoopBack 0
[isp-LoopBack0]ip address 5.5.5.5 24
r2配置:
[r1]acl 2000
[r1-acl-basic-2000]rule permit source 192.168.1.0 0.0.0.255
[r1-acl-basic-2000]int s1/0/0
[r1-Serial1/0/0]nat outbound 2000
r2配置:
[r2]acl 2000
[r2-acl-basic-2000]rule permit source 192.168.2.0 0.0.0.255
[r2-acl-basic-2000]int s1/0/1
[r2-Serial1/0/1]nat outbound 2000
r3配置:
[r3]acl 2000
[r3-acl-basic-2000]rule permit source 192.168.3.0 0.0.0.255
[r3-acl-basic-2000]int s 2/0/0
[r3-Serial2/0/1]nat outbound 2000
r4配置:
[r4]acl 2000
[r4-acl-basic-2000]rule 0 per source 192.168.4.0 0.0.0.255
[r4-acl-basic-2000]int s2/0/1
[r4-Serial2/0/1]nat outbound 2000