标签:udp协议 summary sum ip route img acl访问控制列表 load 学习 服务端
学习TCP和UDP协议
访问控制列表概述,访问控制列表的工作原理
访问控制列表的类型。
标准访问控制类表的配置
创建ACL
将ACLy应用与接口
标准ACL的配置实例
端口 | 协议 | 说明 |
---|---|---|
20 | FTP | FTP服务器数据连接 |
21 | FTP | FTP服务开放的控制端口 |
22 | ssh | 远程登录 |
23 | TELNET | 用于远程登录,可以远程登录控制管理目标计算机 |
25 | SMTP | smtp服务器开放的端口,用于发送邮件 |
53 | DNS | DNS端口 |
67 | DHCP | DHCP服务端 |
68 | DHCP | DHCP客户端 |
80 | HTTP | 超文本传输 |
110 | POP3 | 用于邮件的接收 |
443 | HTTPS | 简单文本传输 |
匹配第一条,知道最后一条结束会有隐含的拒绝,默认是除了你允许主机访问的,其他主机访问都要拒绝
PC1:192.168.10.2/24
PC2:192.168.10.3/24
PC3:192.168.20.2/24
R1#conf t
Enter configuration commands, one per line. End with CNTL/Z.
R1(config)#no ip routing
R1(config)#int f1/0
R1(config-if)#speed 100
R1(config-if)#dup full
R1(config-if)#
R2#conf t
R2(config)#int f0/0
R2(config-if)#ip add 192.168.10.1 255.255.255.0
R2(config-if)#no shut
R2(config-if)#int f0/
R2(config-if)#int f0/1
R2(config-if)#ip add 192.168.20.1 255.255.255.0
R2(config-if)#no shut
R2(config-if)#do show ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route
Gateway of last resort is not set
C 192.168.10.0/24 is directly connected, FastEthernet0/0
C 192.168.20.0/24 is directly connected, FastEthernet0/1
ip 192.168.10.2 192.168.10.1
ip 192.168.10.3 192.168.10.1
PC3> ip 192.168.20.2 192.168.20.1
Checking for duplicate address...
PC1 : 192.168.20.2 255.255.255.0 gateway 192.168.20.1
PC3> ping 192.168.10.2
192.168.10.2 icmp_seq=1 timeout
84 bytes from 192.168.10.2 icmp_seq=2 ttl=63 time=19.967 ms
84 bytes from 192.168.10.2 icmp_seq=3 ttl=63 time=21.941 ms
84 bytes from 192.168.10.2 icmp_seq=4 ttl=63 time=15.958 ms
84 bytes from 192.168.10.2 icmp_seq=5 ttl=63 time=15.959 ms
PC3> ping 192.168.10.3
192.168.10.3 icmp_seq=1 timeout
84 bytes from 192.168.10.3 icmp_seq=2 ttl=63 time=11.968 ms
84 bytes from 192.168.10.3 icmp_seq=3 ttl=63 time=11.970 ms
84 bytes from 192.168.10.3 icmp_seq=4 ttl=63 time=19.946 ms
84 bytes from 192.168.10.3 icmp_seq=5 ttl=63 time=15.921 ms
R1(config)#access-list 1 deny host 192.168.10.2 //拒绝192.168.10.2主机访问,host代表固定地址,也可以在地址后面写反码。
R1(config)#access-list 1 permit any //允许其他所有主机能够访问,any代表所有地址,也可以在地址后面写反码
R1(config)#int f0/0
R1(config-if)#ip access-group 1 in //给接口配置入的方向
R1(config-if)#do show access-list //查看ACL控制列表
Standard IP access list 1
10 deny 192.168.10.2
20 permit any
PC1> ping 192.168.20.2
*192.168.10.1 icmp_seq=1 ttl=255 time=31.223 ms (ICMP type:3, code:13, Communication administratively prohibited)
*192.168.10.1 icmp_seq=2 ttl=255 time=15.618 ms (ICMP type:3, code:13, Communication administratively prohibited)
*192.168.10.1 icmp_seq=3 ttl=255 time=15.621 ms (ICMP type:3, code:13, Communication administratively prohibited)
*192.168.10.1 icmp_seq=4 ttl=255 time=15.622 ms (ICMP type:3, code:13, Communication administratively prohibited)
*192.168.10.1 icmp_seq=5 ttl=255 time=15.620 ms (ICMP type:3, code:13, Communication administratively prohibited)
PC1> ping 192.168.10.3
84 bytes from 192.168.10.3 icmp_seq=1 ttl=64 time=0.000 ms
84 bytes from 192.168.10.3 icmp_seq=2 ttl=64 time=0.000 ms
84 bytes from 192.168.10.3 icmp_seq=3 ttl=64 time=0.000 ms
84 bytes from 192.168.10.3 icmp_seq=4 ttl=64 time=0.000 ms
84 bytes from 192.168.10.3 icmp_seq=5 ttl=64 time=0.000 ms
标签:udp协议 summary sum ip route img acl访问控制列表 load 学习 服务端
原文地址:https://blog.51cto.com/14449524/2442697