互联网计算系列整理主要内容来自软院 2020 级学长 EagleBear2002 的博客,为博主本人阅读后提炼整理的内容。
内容不算全面,仅推荐大家复习时参考。
数据加密标准 DES Data Encryption Standard
数据加密标准 DES 属于常规密钥密码体制,是一种分组密码(对称加密算法)
# ACL
访问控制列表 ACL(Access Control Lists)是指令列表,它告诉路由器允许或拒绝什么类型的数据包。
可以根据以下情况允许或拒绝数据包:
源地址
目的地址
上层的协议,比如 TCP 或 UDP 端口
ACL 末尾有一个隐含的 deny any
语句:如果数据包与 ACL 中的任何语句都不匹配,则将其丢弃。
# Example:ACL 例子
如果我们有如下所述的 ACL 列表:
Permit packets from 192.168.100.1 to pass | |
Permit packets from 192.168.100.2 to pass | |
Deny packets from 192.168.100.3 |
然后:
Packets from 192.168.100.1 will be forwarded
Packets from 192.168.100.3 will be denied
But how does the router process the packets from 192.168.100.4? denied(默认被丢弃掉)
# 出站标准 ACL 流程
收到 packet,确定路由表确认路由表看能够转发
可以转发的话,进入 ACL 确认
如果当前端口没有 ACL 配置,则直接进行转发
如果当前端口有 ACL 配置,开始匹配 source 地址(标准的 ACL,只能对原地址进行判断)
语句满足条件,
deny
premit
语句不满足条件,看下一条,如果没有下一条,则默认 deny
标准 ACL 只能显示声明拒绝规则,而扩展 ACL 可以显式声明拒绝规则和允许规则。因此,标准 ACL 的拒绝规则应当尽量放在出口
在全局配置模式下顺序编写 ACL 语句:
Router(config)#access-list [access-list-number] {permit/deny} {test-conditions} | |
Lab-D(config)#access-list 1 deny 192.5.5.10 0.0.0.0 拒绝来自 192.5.5.10 的报文 | |
Lab-D(config)#access-list 1 deny host 192.5.5.10 与上一行等价 |
在接口配置模式下将 ACL 分组(Group)到一个或多个接口。
Router(config-if)#{protocol} access-group access-list-number {in/out} | |
Lab-D(config-if)#ip access-group 1 out/in |
in:进入流量 out:发出流量
# access-list-number 参数
ACL Type | ACL Number |
---|---|
IP Standard | 1 to 99 |
IP Extended | 100 to 199 |
# 通配符掩码
编写通配符掩码(Wildcard Mask)以告知路由器地址中要匹配的位以及要忽略的位:0 位表示检查该位位置,1 表示忽略该位位置。
# 例子:
检查 192.5.5.0 255.255.255.0 该网络上的所有主机
- Answer: 192.5.5.0 0.0.0.255(和 net mask 是取反的)
检查 192.5.5.32 255.255.255.224 子网中的所有主机
- 192.5.5.32 0.0.0.31
# any 命令
必须编写语句以允许其他人通过。
Lab-A(config)#access-list 1 permit any
== Lab-A(config)#access-list 1 permit 0.0.0.0 255.255.255.255
# 主机名支持
Lab-A(config)#access-list 1 permit host 192.5.5.10(host 专指 192.5.5.10)
# 标准 ACL 的配置
标准 ACL 没有目标参数。因此,将标准 ACL 放置在尽可能靠近目标的位置。
# 扩展 ACL
扩展 ACL 的编号范围为 100-199
扩展功能包括基于过滤流量的功能。
目的地址
ip 协议的部分(更加细分):您可以编写语句以仅拒绝 ICMP 等协议或 RIP 和 IGRP 之类的路由协议
指令语法更加丰富:
Router(config)# access-list access-list-number {permit|deny} {protocol|protocol-keyword}{source source-wildcard} {destination destination-wildcard} [protocol-specific options] [log] | |
Lab-A(config)#access-list 101 deny tcp 192.5.5.0 0.0.0.255 210.93.105.0 0.0.0.255 eq telnet log | |
#举例 | |
Router1(config)#access-list 100 deny ip host 201.201.201.4 host 205.205.205.2 | |
Router1(config)#access-list 100 permit ip any any | |
Router(config-if)#{protocol} access-group | |
access-list-number {in/out} | |
Lab-A(config-if)#ip access-group 101 out |
参数:
access-list-number
:choose from the range 100 to 199{protocol | protocol-number}
:For the CCNA, you only need to know ip and tcp--many more are available,只用考虑 ip 和 tcp{source source-wildcard}
:same as in standard 和标准的相似。可以用 host 而不写 wild{destination destination-wildcard}
:formatted like the standard, but specifies the destination。可以用 host 而不写 wild[protocol-specific options]
:这个参数用于确认协议的过滤部分,可选
如:拒绝网络 221.23.123.0 访问服务器 198.150.13.34
Router-C(config)#access-list 100 deny ip 221.23.123.0 0.0.0.255 198.150.13.34 0.0.0.0 | |
Router-C(config)#access-list 100 permit ip any any | |
Router-C(config)#int e0 | |
Router-C(config-if)#ip access-group 100 in |
# ACL 的校验
show access-lists
查看全部shows all access-lists configured on the router
显示路由器上配置的所有访问列表show access-lists {name | number}
查看某一个端口的