學習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 | 簡單文本傳輸 |
匹配第一條,知道最後一條結束會有隱含的拒絕,默認是除了你容許主機訪問的,其餘主機訪問都要拒絕ssh
PC1:192.168.10.2/24
PC2:192.168.10.3/24
PC3:192.168.20.2/24ide
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