Denna konfiguration syftar till att tillämpa ett antal extended access control lists (ACLs) i en nätverkstopologi med tre routrar, två LAN (LAN 10 och LAN 20), samt två servrar (Web Server och DB Server). ACL:erna används för att filtrera trafik baserat på källor, destinationer, protokoll och portar enligt givna säkerhets- och åtkomstpolicyer.
Topologi
ACL att konfigurera
- Neka FTP från PC2 (192.168.10.11) till DB Server (192.168.40.10)
– PC1 (192.168.10.10) ska fortfarande ha FTP-åtkomst. - Tillåt endast PC1 att SSH-ansluta till R1
– Alla andra enheter nekas SSH till R1. - Tillåt endast PC3 att Telnet-ansluta till R2
– Alla andra enheter nekas Telnet till R2. - Tillåt endast PC1 att SSH-ansluta till R3
– Alla andra enheter nekas SSH till R3. - Blockera ICMP (ping) mellan LAN 10 och LAN 20
– Undantag: PC1 får pinga LAN 20. - Tillåt endast LAN 10 att nå Web Server (192.168.30.10) via HTTP (port 80)
– LAN 20 ska nekas HTTP-åtkomst till Web Servern.
Observera: För att inte blockera övriga tjänster (DNS, EIGRP, webbtrafik, intern hantering, etc) lägg ACE permit ip any any.
Konfigurationer
R1 konfigurationer
- Router> enable
- Router# configure terminal
- Router(config)# hostname R1
- R1(config)# no ip domain-lookup
- !
- R1(config)# interface G0/0
- R1(config-if)# description Connected to LAN 10
- R1(config-if)# ip address 192.168.10.1 255.255.255.0
- R1(config-if)# no shutdown
- R1(config-if)# exit
- !
- R1(config)# interface G0/1
- R1(config-if)# description Connected to R2
- R1(config-if)# ip address 10.0.0.1 255.255.255.252
- R1(config-if)# no shutdown
- R1(config-if)# exit
- !
- R1(config)# router ospf 10
- R1(config-router)# router-id 1.1.1.1
- R1(config-router)# network 192.168.10.0 0.0.0.255 area 0
- R1(config-router)# network 10.0.0.0 0.0.0.3 area 0
- R1(config-router)# passive-interface G0/0
- R1(config-router)# end
- R1#
R2 konfigurationer
- Router> enable
- Router# configure terminal
- Router(config)# hostname R2
- R2(config)# no ip domain-lookup
- !
- R2(config)# interface G0/0
- R2(config-if)# description Connected to LAN 20
- R2(config-if)# ip address 192.168.20.1 255.255.255.0
- R2(config-if)# no shutdown
- R2(config-if)# exit
- !
- R2(config)# interface G0/1
- R2(config-if)# description Connected to R1
- R2(config-if)# ip address 10.0.0.2 255.255.255.252
- R2(config-if)# (config-if)# ip ospf 10 network point-to-point
- R2(config-if)# no shutdown
- R2(config-if)# exit
- !
- R2(config)# interface G0/2
- R2(config-if)# description Connected to R3
- R2(config-if)# ip address 10.0.0.5 255.255.255.252
- R2(config-if)# ip ospf 10 network point-to-point
- R2(config-if)# no shutdown
- R2(config-if)# exit
- !
- R2(config)# router ospf 10
- R2(config-router)# router-id 2.2.2.2
- R2(config-router)# network 192.168.20.0 0.0.0.255 area 0
- R2(config-router)# network 10.0.0.0 0.0.0.3 area 0
- R2(config-router)# network 10.0.0.4 0.0.0.3 area 0
- R2(config-router)# passive-interface G0/0
- R2(config-router)# end
- R2#
R3 konfigurationer
- Router> enable
- Router# configure terminal
- Router(config)# hostname R3
- R3(config)# no ip domain-lookup
- !
- R3(config)# interface G0/0
- R3(config-if)# description Connected to LAN 30
- R3(config-if)# ip address 192.168.30.1 255.255.255.0
- R3(config-if)# no shutdown
- R3(config-if)# exit
- !
- R3(config)# interface G0/1
- R3(config-if)# description Connected LAN 40
- R3(config-if)# ip address 192.168.40.1 255.255.255.0
- R3(config-if)# no shutdown
- R3(config-if)# exit
- !
- R3(config)# interface G0/2
- R3(config-if)# description Connected R2
- R3(config-if)# ip address 10.0.0.6 255.255.255.252
- R3(config-if)# ip ospf 10 network point-to-point
- R3(config-if)# no shutdown
- R3(config-if)# exit
- !
- R3(config)# router ospf 10
- R3(config-router)# router-id 3.3.3.3
- R3(config-router)# network 192.168.30.0 0.0.0.255 area 0
- R3(config-router)# network 192.168.40.0 0.0.0.255 area 0
- R3(config-router)# network 10.0.0.4 0.0.0.3 area 0
- R3(config-router)# passive-interface G0/0
- R3(config-router)# passive-interface G0/1
- R3(config-router)# end
- R3#
1) PC2 nekas FTP till DB Server – men inte PC1
-
- Placeras på R3 och tillämpas på interface G0/1 out
- R3(config)#ip access-list extended FTP-FILTER-DB
- R3(config-ext-nacl)#deny tcp host 192.168.10.11 host 192.168.40.10 eq 21
- R3(config-ext-nacl)#permit ip any any
- R3(config-ext-nacl)#exit
- R3(config)#interface G0/1
- R3(config-if)#ip access-group FTP-FILTER-DB out
- R3(config-if)#exit
- R3(config)#
2) Endast PC1 får SSH till R1
- Aktivera SSH
- R1(config)#ip domain-name diginto.se
- R1(config)#username admin privilege 15 secret cisco
- R1(config)#crypto key generate rsa general-keys modulus 1024
- R1(config)#ip ssh version 2
- R1(config)#line vty 0 4
- R1(config-line)#login local
- R1(config-line)#transport input ssh
- R1(config-line)#exit
- Skapa en Extended ACL
- R1(config)# ip access-list extended SSH-R1-ACCESS
- R1(config-ext-nacl)# permit tcp host 192.168.10.10 any eq 22
- R1(config-ext-nacl)# deny tcp any any eq 22
- R1(config-ext-nacl)# permit ip any any
- R1(config-ext-nacl)# exit
- Tillämpa SSH-R1-ACCESS
- R1(config)# line vty 0 4
- R1(config-line)# access-class SSH-R1-ACCESS in
- R1(config-line)# end
- R1#
3) Tillåt endast PC3 att Telnet-ansluta till R2
- R2(config)#ip domain-name diginto.se
- R2(config)#username admin privilege 15 secret cisco
- R2(config)#line vty 0 4
- R2(config-line)#login local
- R2(config-line)#transport input all
- R2(config-line)#exit
- Skapa en Extended ACL
- R2(config)#ip access-list extended TELNET-R2-ACCESS
- R2(config-ext-nacl)#permit tcp host 192.168.20.10 any eq 23
- R2(config-ext-nacl)#deny tcp any any eq 23
- R2(config-ext-nacl)#permit ip any any
- R2(config-ext-nacl)#exit
- Tillämpa ACL
- R2(config)#line vty 0 4
- R2(config-line)#access-class TELNET-R2-ACCESS in
- R2(config-line)#end
- R2#
4) Tillåt endast PC1 att SSH-ansluta till R3
- Aktivera SSH
- R3(config)#ip domain-name diginto.se
- R3(config)#username admin privilege 15 secret cisco
- R3(config)#crypto key generate rsa general-keys modulus 1024
- R3(config)#ip ssh version 2
- R3(config)#line vty 0 4
- R3(config-line)#login local
- R3(config-line)#transport input ssh
- R3(config-line)#exit
- Skapa en Extended ACL
- R3(config)#ip access-list extended SSH-R3-ACCESS
- R3(config-ext-nacl)#permit tcp host 192.168.10.10 any eq 22
- R3(config-ext-nacl)#deny tcp any any eq 22
- R3(config-ext-nacl)#permit ip any any
- R3(config-ext-nacl)#exit
- Tillämpa ACL
- R3(config)#line vty 0 4
- R3(config-line)#access-class SSH-R3-ACCESS in
- R3(config-line)#end
- R3#
5) Blockera ICMP (ping) mellan LAN 10 och LAN 20
- Skapa en Extended ACL
- R1(config)#ip access-list extended BLOCK-ICMP-LAN10-LAN20
- R1(config-ext-nacl)#permit icmp host 192.168.10.10 192.168.20.0 0.0.0.255
- R1(config-ext-nacl)#deny icmp 192.168.10.0 0.0.0.255 192.168.20.0 0.0.0.255
- R1(config-ext-nacl)#deny icmp 192.168.20.0 0.0.0.255 192.168.10.0 0.0.0.255
- R1(config-ext-nacl)#permit ip any any
- R1(config-ext-nacl)#exit
- Tillämpa ACL
- R1(config)#interface G0/0
- R1(config-if)#ip access-group BLOCK-ICMP-LAN10-LAN20 in
- R1(config-if)#end
- R1#
6) Tillåt endast LAN 10 att nå Web Server (192.168.30.10) via HTTP (port 80)
- Skapa en Extended ACL
- R3(config)#ip access-list extended WEB-SERVER-ACCESS
- R3(config-ext-nacl)#permit tcp 192.168.10.0 0.0.0.255 host 192.168.30.10 eq 80
- R3(config-ext-nacl)#deny tcp any host 192.168.30.10 eq 80
- R3(config-ext-nacl)#permit ip any any
- R3(config-ext-nacl)#exit
- Tillämpa ACL
- R3(config)#interface G0/0
- R3(config-if)#ip access-group WEB-SERVER-ACCESS out
- R3(config-if)#end
- R3#