I denna laboration kommer vi att undersöka hur Spanning Tree Protocol (STP), PortFast och BPDU Guard används för att skydda nätverket från loopar och oönskade STP-attacker. Dessutom implementerar vi Dynamic ARP Inspection (DAI) för att förhindra ARP-förgiftning (poisoning) och säkerställa nätverksintegritet.
Bakgrund
I nätverk med flera switchar kan redundanta länkar skapa nätverksloopar. STP identifierar och blockerar dessa loopar dynamiskt. PortFast snabbar upp nätverkstillgången för slutnoder genom att undvika STP-processen för access-portar, medan BPDU Guard förhindrar oönskade STP-enheter att påverka nätverket genom att stänga av portar som tar emot BPDU. Dynamic ARP Inspection (DAI) validerar ARP-paket genom att kontrollera att MAC-adresser och IP-adresser överensstämmer med DHCP-bindningar eller statiska ARP-bindningar, vilket skyddar mot ARP-förgiftning.
Topologi
Konfigurationer
- R1(config)# interface fa0/0
- R1(config-if)# no ip address
- R1(config-if)# shutdown
- R1(config-if)# exit
- R1(config)# interface fa0/0.10
- R1(config-subif)# encapsulation dot1q 10
- R1(config-subif)# ip address 192.168.10.254 255.255.255.0
- R1(config-subif)# no shut
- R1(config-subif)# exit
- R1(config)# interface fa0/0.20
- R1(config-subif)# encapsulation dot1q 20
- R1(config-subif)# ip address 192.168.20.254 255.255.255.0
- R1(config-subif)# no shut
- R1(config-subif)# exit
- R1(config)# interface fa0/0.30
- R1(config-subif)# encapsulation dot1q 30
- R1(config-subif)# ip address 192.168.30.254 255.255.255.0
- R1(config-subif)# no shut
- R1(config-subif)# exit
- R1(config)# interface fa0/0
- R1(config-if)# no shut
- R1(config-if)# end
- R1#
- S1(config)# vlan 10
- S1(config-vlan)# name vlan10
- S1(config-vlan)# vlan 20
- S1(config-vlan)# name vlan20
- S1(config-vlan)# vlan 30
- S1(config-vlan)# name vlan30
- S1(config-vlan)# exit
- S1(config)# interface fa0/24
- S1(config-if)# switchport mode access
- S1(config-if)# switchport access vlan 30
- S1(config-if)# no shut
- S1(config-if)# exit
- S1(config)# interface range fa 0/1-3
- S1(config-if-range)# switchport mode trunk
- S1(config-if-range)# exit
- S1(config)#
- S2(config)# vlan 10
- S2(config-vlan)# name vlan10
- S2(config-vlan)# vlan 20
- S2(config-vlan)# name vlan20
- S2(config-vlan)# vlan 30
- S2(config-vlan)# name vlan30
- S2(config-vlan)# exit
- S2(config)# interface fa0/10
- S2(config-if)# switchport mode access
- S2(config-if)# switchport access vlan 10
- S2(config-if)# no shut
- S2(config-if)# exit
- S2(config)# interface fa0/20
- S2(config-if)# switchport mode access
- S2(config-if)# switchport access vlan 20
- S2(config-if)# no shut
- S2(config-if)# exit
- S2(config)# interface fa 0/2
- S2(config-if)# switchport mode trunk
- S2(config-if)# exit
- S2(config)# interface fa 0/4
- S2(config-if)# switchport mode trunk
- S2(config-if)# exit
- S2(config)#
- S3(config)# vlan 10
- S3(config-vlan)# name vlan10
- S3(config-vlan)# vlan 20
- S3(config-vlan)# name vlan20
- S3(config-vlan)# vlan 30
- S3(config-vlan)# name vlan30
- S3(config-vlan)# exit
- S3(config)# interface fa0/10
- S3(config-if)# switchport mode access
- S3(config-if)# switchport access vlan 10
- S3(config-if)# no shut
- S3(config-if)# exit
- S3(config)# interface fa0/20
- S3(config-if)# switchport mode access
- S3(config-if)# switchport access vlan 20
- S3(config-if)# no shut
- S3(config-if)# exit
- S3(config)# interface fa0/24
- S3(config-if)# switchport mode access
- S3(config-if)# switchport access vlan 30
- S3(config-if)# no shut
- S3(config-if)# exit
- S3(config)# interface fa 0/1
- S3(config-if)# switchport mode trunk
- S3(config-if)# exit
- S3(config)# interface fa 0/3
- S3(config-if)# switchport mode trunk
- S3(config-if)# exit
- S3(config)#
- S4(config)# vlan 10
- S4(config-vlan)# name vlan10
- S4(config-vlan)# vlan 20
- S4(config-vlan)# name vlan20
- S4(config-vlan)# vlan 30
- S4(config-vlan)# name vlan30
- S4(config-vlan)# exit
- S4(config)# interface fa0/10
- S4(config-if)# switchport mode access
- S4(config-if)# switchport access vlan 10
- S4(config-if)# no shut
- S4(config-if)# exit
- S4(config)# interface fa0/20
- S4(config-if)# switchport mode access
- S4(config-if)# switchport access vlan 20
- S4(config-if)# no shut
- S4(config-if)# exit
- S4(config)# interface fa 0/1
- S4(config-if)# switchport mode trunk
- S4(config-if)# exit
- S4(config)# interface fa 0/4
- S4(config-if)# switchport mode trunk
- S4(config-if)# exit
- S4(config)#
- STP-konfiguration (VLAN 30 Root-brygga på S1)
- S1(config)# spanning-tree vlan 30 root primary
- PortFast-konfiguration på access-portar
- S1(config)# interface fa0/24
- S1(config-if)# spanning-tree portfast
- S1(config-if)# exit
- Markera trunkport som betrodd för ARP Inspection
- S1(config)# interface range fa0/1-3
- S1(config-if-range)# ip arp inspection trust
- S1(config-if-range)# exit
- Aktivera BPDU Guard globalt för alla PortFast-portar
- S1(config)# spanning-tree portfast bpduguard default
- Aktivera ARP Inspection för alla VLAN (10, 20, 30)
- S1(config)# ip arp inspection vlan 10
- S1(config)# ip arp inspection vlan 20
- S1(config)# ip arp inspection vlan 30
- S1(config)# end
- S1#
- PortFast-konfiguration på access-portar
- S2(config)# interface fa0/10
- S2(config-if)# spanning-tree portfast
- S2(config-if)# exit
- S2(config)# interface fa0/20
- S2(config-if)# spanning-tree portfast
- S2(config-if)# exit
- Markera trunkport som betrodd för ARP Inspection
- S2(config)# interface fa0/1
- S2(config-if)# ip arp inspection trust
- S2(config-if)# exit
- S2(config)# interface fa0/4
- S2(config-if)# ip arp inspection trust
- S2(config-if)# exit
- Aktivera BPDU Guard globalt för alla PortFast-portar
- S2(config)# spanning-tree portfast bpduguard default
- Aktivera ARP Inspection för alla VLAN (10, 20, 30)
- S2(config)# ip arp inspection vlan 10
- S2(config)# ip arp inspection vlan 20
- S2(config)# ip arp inspection vlan 30
- S2(config)# end
- S2#
- PortFast-konfiguration på access-portar
- S3(config)# interface fa0/10
- S3(config-if)# spanning-tree portfast
- S3(config-if)# exit
- S3(config)# interface fa0/20
- S3(config-if)# spanning-tree portfast
- S3(config-if)# exit
- S3(config)# interface fa0/24
- S3(config-if)# spanning-tree portfast
- S3(config-if)# exit
- Markera trunkport som betrodd för ARP Inspection
- S3(config)# interface fa0/1
- S3(config-if)# ip arp inspection trust
- S3(config-if)# exit
- S3(config)# interface fa0/3
- S3(config-if)# ip arp inspection trust
- S3(config-if)# exit
- Aktivera BPDU Guard globalt för alla PortFast-portar
- S3(config)# spanning-tree portfast bpduguard default
- Aktivera ARP Inspection för alla VLAN (10, 20, 30)
- S3(config)# ip arp inspection vlan 10
- S3(config)# ip arp inspection vlan 20
- S3(config)# ip arp inspection vlan 30
- S3(config)# end
- S3#
- PortFast-konfiguration på access-portar
- S4(config)# interface fa0/10
- S4(config-if)# spanning-tree portfast
- S4(config-if)# exit
- S4(config)# interface fa0/20
- S4(config-if)# spanning-tree portfast
- S4(config-if)# exit
- Markera trunkport som betrodd för ARP Inspection
- S4(config)# interface fa0/1
- S4(config-if)# ip arp inspection trust
- S4(config-if)# exit
- S4(config)# interface fa0/4
- S4(config-if)# ip arp inspection trust
- S4(config-if)# exit
- Aktivera BPDU Guard globalt för alla PortFast-portar
- S4(config)# spanning-tree portfast bpduguard default
- Aktivera ARP Inspection för alla VLAN (10, 20, 30)
- S4(config)# ip arp inspection vlan 10
- S4(config)# ip arp inspection vlan 20
- S4(config)# ip arp inspection vlan 30
- S4(config)# end
- S4#