I denna laboration ska du blockera IPv4-trafik från nätverket 192.168.10.0/24 till nätverket 192.168.30.0/24 med en standard-ACL. Trafik från 192.168.10.0/24 till övriga LAN ska fortfarande tillåtas.
En standard-ACL filtrerar enbart utifrån paketets käll-IP-adress. Därför placeras den normalt så nära destinationsnätverket som möjligt. I denna laboration ska du undersöka hur placeringen och riktningen påverkar vilken trafik som blockeras.
Exemplet har jag byggt upp med PT-routrar och 2960 switchar samt routing med RIPv2.
Nätverkstopologi

ACL placering
| Placering | Riktning | Effekt på trafik från 192.168.10.0/24 |
|---|---|---|
| R1, Fa0/0 | in | Blockerar trafik som kommer in till R1 från LAN 10, inklusive trafik till LAN 11, 30 och 31. |
| R1, Se2/0 | out | Blockerar trafik mot LAN 30 och 31. Trafik till LAN 11 tillåts. |
| R3, Se3/0 | in | Blockerar trafik mot LAN 30 och 31. Trafik till LAN 11 tillåts. |
| R3, Fa0/0 | out | Blockerar trafik mot LAN 30. Trafik till LAN 11 och 31 tillåts. |
Konfigurationer
- PC1
- IP address: 192.168.10.1
- Subnet Mask: 255.255.255.0
- Default gateway: 192.168.10.254
- PC2
- IP address: 192.168.11.2
- Subnet Mask: 255.255.255.0
- Default gateway: 192.168.11.254
- PC3
- IP address: 192.168.30.3
- Subnet Mask: 255.255.255.0
- Default gateway: 192.168.30.254
- PC4
- IP address: 192.168.31.4
- Subnet Mask: 255.255.255.0
- Default gateway: 192.168.31.254
- Router> enable
- Router# configure terminal
- Router(config)# hostname R1
- R1(config)# no ip domain-lookup
- R1(config)# interface fa0/0
- R1(config-if)# description Connected to LAN 10
- R1(config-if)# ip address 192.168.10.254 255.255.255.0
- R1(config-if)# no shutdown
- R1(config-if)# exit
- R1(config)# interface fa1/0
- R1(config-if)# description Connected to LAN 11
- R1(config-if)# ip address 192.168.11.254 255.255.255.0
- R1(config-if)# no shutdown
- R1(config-if)# exit
- R1(config)# interface Se2/0
- R1(config-if)# description Connected to R2
- R1(config-if)# ip address 20.20.20.1 255.255.255.252
- R1(config-if)# no shutdown
- R1(config-if)# exit
- R1(config)# router rip
- R1(config-router)# version 2
- R1(config-router)# no auto-summary
- R1(config-router)# network 192.168.10.0
- R1(config-router)# network 192.168.11.0
- R1(config-router)# network 20.20.20.0
- R1(config-router)# end
- R1#
- Router> enable
- Router# configure terminal
- Router(config)# hostname R2
- R2(config)# no ip domain-lookup
- R2(config)# interface Se2/0
- R2(config-if)# description DCE connected to R1
- R2(config-if)# clock rate 128000
- R2(config-if)# ip address 20.20.20.2 255.255.255.252
- R2(config-if)# no shutdown
- R2(config-if)# exit
- R2(config)# interface Se3/0
- R2(config-if)# description DCE connected to R3
- R2(config-if)# clock rate 128000
- R2(config-if)# ip address 30.30.30.2 255.255.255.252
- R2(config-if)# no shutdown
- R2(config-if)# exit
- R2(config)# router rip
- R2(config-router)# version 2
- R2(config-router)# no auto-summary
- R2(config-router)# network 20.20.20.0
- R2(config-router)# network 30.30.30.0
- R2(config-router)# end
- R2#
- Router> enable
- Router# configure terminal
- Router(config)# hostname R3
- R3(config)# no ip domain-lookup
- R3(config)# interface fa0/0
- R3(config-if)# description Connected to LAN 30
- R3(config-if)# ip address 192.168.30.254 255.255.255.0
- R3(config-if)# no shutdown
- R3(config-if)# exit
- R3(config)# interface fa1/0
- R3(config-if)# description Connected to LAN 31
- R3(config-if)# ip address 192.168.31.254 255.255.255.0
- R3(config-if)# no shutdown
- R3(config-if)# exit
- R3(config)# interface Se3/0
- R3(config-if)# description Connected to R2
- R3(config-if)# ip address 30.30.30.1 255.255.255.252
- R3(config-if)# no shutdown
- R3(config-if)# exit
- R3(config)# router rip
- R3(config-router)# version 2
- R3(config-router)# no auto-summary
- R3(config-router)# network 192.168.30.0
- R3(config-router)# network 192.168.31.0
- R3(config-router)# network 30.30.30.0
- R3(config-router)# end
- R3#
- R3(config)# access-list 10 deny 192.168.10.0 0.0.0.255
- R3(config)# access-list 10 permit any
- R3(config)# interface fa0/0
- R3(config-if)# ip access-group 10 out
- R3(config-if)# end
- R3# copy running-config startup-config
ACL 10 granskar IPv4-paket som lämnar R3 genom Fa0/0 mot LAN 30.
Paket med en käll-IP-adress i 192.168.10.0/24 blockeras.
Övriga IPv4-paket tillåts av regeln permit any.
Före ACL: Kontrollera att alla datorer kan pinga varandra. Då vet eleverna att adressering och routing fungerar.
Efter ACL testa:
| Test | Förväntat resultat |
|---|---|
| PC1 ping PC3, 192.168.30.3 | Misslyckas |
| PC1 ping PC4, 192.168.31.4 | Lyckas |
| PC1 ping PC2, 192.168.11.2 | Lyckas |
| PC2 ping PC3, 192.168.30.3 | Lyckas |
| PC3 ping PC1, 192.168.10.1 | Misslyckas: svaret från PC1 blockeras på väg tillbaka till PC3 |
Verifiera på R3:
R3# show access-lists R3# show ip interface fa0/0 R3# show ip route