基于上下文的访问控制
拓扑图
地址表
Device |
Interface |
IP address |
R1 |
F 0/0 |
192.168.65.1 |
S 0/0/0 |
10.1.65.1 |
|
R2 |
S 0/0/0 |
10.1.65.2 |
S 0/0/1 |
10.2.65.2 |
|
R3 |
F 0/0 |
172.16.65.3 |
S 0/0/0 |
10.2.65.3 |
|
PC-A |
NIC |
192.168.65.4 |
Default Gateway |
192.168.65.1 |
|
PC-C |
NIC |
172.16.65.4 |
Default Gateway |
172.16.65.3 |
预配置:
在配置防火墙之前验证设备间连通性,即先配置静态路由
R1(config)#ip route 10.2.65.0 255.255.255.0 10.1.65.2
R1(config)#ip route 172.16.65.0 255.255.255.0 10.1.65.2
R2(config)#ip route 192.168.65.0 255.255.255.0 10.1.65.1
R2(config)#ip route 172.16.65.0 255.255.255.0 10.2.65.3
R3(config)#ip route 10.1.65.0 255.255.255.0 10.2.65.2
R3(config)#ip route 192.168.65.0 255.255.255.0 10.2.65.2
在R3启用密码
R3(config)#enable password lzr123
启用console口密码
R3(config)#line console 0
R3(config-line)#password lzr123
启用vty行接入密码
R3(config)#line vty 0 4
R3(config-line)#password lzr123
把S1、S2所有交换机接口都在Vlan1(S2配置相同)
S1(config)#int f 0/1
S1(config-if)# switchport access vlan 1
S1(config-if)# switchport trunk allowed vlan 1
S1(config)#int f 0/2
S1(config-if)# switchport access vlan 1
S1(config-if)# switchport trunk allowed vlan 1
预配置完成
验证:在PC-C的命令提示符中ping PC-A服务器