标准ip访问控制列表配置

技术原理:

        ACLs的全称为接入控制列表(AccessControl  Lists),也称访问控制列表(AccessLists),俗称防火墙。在有的文档中还称包过滤。ACLs通过一些规则对网络设备接口上的数据包文进行控制;允许通过或丢弃,从而提高网络可管理型和安全性;

        IPACL分为两种:标准IP访问控制列表和扩展IP访问控制列表,编号的范围1-991300-1999100-1992000-2699

标准IP访问控制列表可以根据数据包的源IP地址定义规则,进行包的过滤;

扩展IP访问控制列表可以根据数据包的源IP、目的IP、原端口、目的端口、协议来定义规则,进行数据包的过滤;

IPACL基于接口进行规则的应用,分为:入栈应用和出栈应用;

实验步骤:

建立拓扑图:

1.路由器之间通过V.35电缆通过串口连接,DCE端连接在R1上,配置其时钟64000;主机于路由器之间通过交叉线连接

2.配置路由器接口IP

3.在路由器上配置静态路由协议,让三台PC能够互相Ping通,因为只有在互通的前提下才涉及访问控制列表。

4.R1上编号的IP标准访问控制

5.将标准IP访问控制应用在端口上

6.验证主机之间的互通性

实验设备:

Pc3台:Router-PT2台;交叉线、DCE串口线

174558784.png

R0配置:

Router>en

Router#config t

Enter configuration commands, one perline.  End with CNTL/Z.

Router(config)#host R0

R0(config)#int fa0/0

R0(config-if)#ip address 172.16.1.1255.255.255.0

R0(config-if)#no shut

%LINK-5-CHANGED: Interface FastEthernet0/0,changed state to up

%LINEPROTO-5-UPDOWN: Line protocol onInterface FastEthernet0/0, changed state to up

R0(config-if)#exit

R0(config)#int fa1/0

R0(config-if)#ip address 172.16.2.1255.255.255.0

R0(config-if)#no shut

%LINK-5-CHANGED: Interface FastEthernet1/0,changed state to up

%LINEPROTO-5-UPDOWN: Line protocol onInterface FastEthernet1/0, changed state to up

R0(config-if)#exit

R0(config)#int se2/0

R0(config-if)#ip address 172.16.3.1255.255.255.0

R0(config-if)#clock rate 64000

R0(config-if)#no shut

%LINK-5-CHANGED: Interface Serial2/0,changed state to down

R0(config-if)#exit

R0(config)#


R1配置:

Router>en

Router#config t

Enter configuration commands, one perline.  End with CNTL/Z.

Router(config)#host R1

R1(config)#int se2/0

R1(config-if)#ip address 172.16.3.2255.255.255.0

% Invalid input detected at '^' marker.

R1(config-if)#no shut

R1(config-if)#

%LINK-5-CHANGED: Interface Serial2/0,changed state to up

R1(config-if)#exit

R1(config)#int fa0/0

%LINEPROTO-5-UPDOWN: Line protocol onInterface Serial2/0, changed state to up

R1(config-if)#ip address 172.16.4.1255.255.255.0

R1(config-if)#no shut

%LINK-5-CHANGED: Interface FastEthernet0/0,changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on InterfaceFastEthernet0/0, changed state to up

R1(config-if)#exit

R1(config)#


R0上配置静态路由:

R0(config)#ip route 172.16.4.0255.255.255.0 172.16.3.2

R1上配置静态路由:

R1(config)#ip route 0.0.0.0 0.0.0.0172.16.3.1

R0上配置控制列表:

R0(config)#ip access-list standard 5ijsj

R0(config-std-nacl)#permit 172.16.1.00.0.0.255

R0(config-std-nacl)#deny 172.16.2.00.0.0.255

R0(config-std-nacl)#exit

R0(config)#int se2/0

R0(config-if)#ip access-group 5ijsj out

R0(config-if)#exit


结果:

Pinging 172.16.4.2 with 32 bytes of data:


Reply from 172.16.2.1: Destination hostunreachable.

Reply from 172.16.2.1: Destination hostunreachable.

Reply from 172.16.2.1: Destination hostunreachable.

Reply from 172.16.2.1: Destination hostunreachable.