Labb 2: Redundant nätverk


I moderna nätverksmiljöer används ofta flera tekniker tillsammans för att skapa nätverk som är effektiva, skalbara och tillförlitliga. I denna laboration kombinerar vi VLAN, trunklänkar, redundant topologi, Router-on-a-Stick, DHCP, VTP, PVST+ och dynamisk routing med RIP version 2.

Huvudmålet med denna laboration är:

  • Implementera VLAN för att segmentera nätverkstrafik.
  • Konfigurera Router-on-a-Stick på R1 och R2.
  • Använda VTP (VLAN Trunking Protocol) för att distribuera VLAN-information.
  • Konfigurera PVST+, för att en loopfri topologi.
  • Konfigurera DHCP på routrarna för att dynamiskt tilldela IP-adresser till klienter i respektive VLAN.
  • Konfigurera dynamisk routing med RIP version 2 för att möjliggöra kommunikation mellan VLAN.
  • Använda passive-interface för att undvika skicka routing-information till slutenheter.

Topologi

Laborationen består av två separata Layer 2-domäner, som kopplas samman via routrar (2811) och och switchar av modellen 2960. Till routrar har lagts modulen HWIC-2T för WAN-anslutningar. Eftersom routrar arbetar på lager 3, bryter de lager 2-domänerna. Detta innebär att Spanning Tree endast körs inom varje domän och inte mellan dem.

IP design

Nätverket 192.168.1.0/24 delas upp med hjälp av VLSM i flera mindre subnät: /26, /27, /28, /29 och /30. Trots detta konfigureras RIP med kommandot network 192.168.1.0, vilket fungerar eftersom RIP aktiverar alla interface som tillhör huvudnätet. Med RIP version 2 och no auto-summary annonseras därefter varje subnät med korrekt subnetmask, vilket gör att routrarna kan skilja mellan näten och skicka trafiken rätt.

Router-on-a-Stick och subinterface

För att möjliggöra kommunikation mellan VLAN används Router-on-a-Stick. Detta innebär att ett fysiskt interface delas upp i flera subinterface. Varja subinterface kopplas till ett specifikt VLAN.

När vi arbetar med subinterfaces finns det två vanliga sätt att gå tillväga vid konfigurationen. Båda metoderna fungerar, men det är viktigt att förstå hur de påverkar interfacens status.

Metod 1 – Aktivera efter konfiguration

I den första metoden börjar vi med att det fysiska interfacet är avstängt (shutdown). Därefter skapar och konfigurerar vi subinterfacen. När konfigurationen är klar aktiverar vi det fysiska interfacet med no shutdown. När det fysiska interfacet går upp, kommer även alla korrekt konfigurerade subinterfaces att bli aktiva.

Metod 2 – Aktivera först

I den andra metoden aktiverar vi det fysiska interfacet först med no shutdown. Därefter skapar vi subinterfacen. I detta fall behöver vi normalt inte ange no shutdown på varje subinterface. De blir automatiskt aktiva så länge det fysiska interfacet är uppe och konfigurationen är korrekt.

I denna laboration används metod 1.

VLAN, VTP och L2-struktur

Vi jobbar med två separata domäner:

NG domänen (SWD1, SWC1 och SWC2) innehåller:

  • VLAN 10 (EXECUTIVES)
  • VLAN 20 (ECONOMY)

Diginto domänen (SWD2, SWC3 och SWC4) innehåller:

  • VLAN 30 (MARKETING)
  • VLAN 40 (SALES)

Dessa två domäner är sammankopplade via routrar (R1, ISP och R2). Eftersom routrar arbetar på Layer 3 bryter de Layer 2-domänerna, vilket innebär att Spanning Tree Protocol inte sträcker sig mellan domänerna. Därför körs STP helt separat i varje domän.

Hur PVST+ fungerar i denna topologi

Med PVST+ (Per VLAN Spanning Tree Plus) får varje VLAN ett eget spanning-tree instans.

Detta betyder att:

  • varje VLAN bygger sin egen logiska topologi
  • varje VLAN väljer sin egen root bridge
  • varje VLAN kan ha olika portar i forwarding- eller blocking-läge

Det är viktigt att förstå att VLAN inte påverkar varandra. Trafiken i VLAN 10 påverkar till exempel inte hur STP fungerar i VLAN 20. Alla VLAN arbetar parallellt, inte i någon bestämd ordning. Med det i åtanke är lättare att förstå hur PVST+ skapar lastbalansering mellan olika VLAN.

Root bridge för varje VLAN väljs enligt följande:

  • SWC1 för VLAN 10
  • SWC2 för VLAN 20
  • SWC3 för VLAN 30
  • SWC4 för VLAN 40

Genom att olika VLAN har olika root bridge kommer trafiken att ta olika vägar genom nätet. Detta gör att belastningen fördelas över flera länkar istället för att koncentreras till en enda.

Det är viktigt att förstå att STP alltid blockerar en port per VLAN i en redundant topologi för att förhindra loopar. Lastbalansering innebär inte att blockeringen försvinner, utan att olika portar blockeras i olika VLAN. På så sätt kan en länk vara aktiv i ett VLAN men blockerad i ett annat, vilket gör att redundansen i nätverket utnyttjas mer effektivt.

Instruktioner

  1. Nätverksplanering och IP-adressering
  2. Konfigurera ISP-routern
  3. Konfigurera R1 som DCE och Router-on-a-Stick
  4. Konfigurera R2 som DCE och Router-on-a-Stick
  5. Konfigurera switcharna (VLAN, VTP och STP) i ng domän
  6. Konfigurera switcharna (VLAN, VTP och STP) i diginto domän
  7. Konfigurera RIP på alla routrar

Genomförande

1. IP-adressering

  • 192.168.1.0 /26 = 255.255.255.192: 0 - 64 - 128 - 192 (sst = 64)
    192.168.1.0 /26 VLAN 10 EXECUTIVES HA: 192.168.1.1 - 192.168.1.62

  • 192.168.1.64 /27 = 255.255.255.224: 64 - 96 (sst = 32)
    192.168.1.64 /27 VLAN 20 ECONOMY HA: 192.168.1.65 -192.168.1. 94

  • 192.168.1.96 /28: = 255.255.255.240: 96 - 112 (sst = 16)
    192.168.1.96 /28 VLAN 30 MARKETING HA: 192.168.1.97 - 192.168.1.110

  • 192.168.1.112 /29: 255.255.255.248: 112 - 120 (sst = 8)
    192.168.1.112 /29 VLAN 40 SALES HA: 192.168.1.113 - 192.168.1.118

  • 192.168.1.120 /30: 255.255.255.252: 120 - 124 (sst = 4)
    192.168.1.120 /30 WAN1 HA: 192.168.1.121 - 192.168.1.122
    192.168.1.124 /30 WAN1 HA: 192.168.1.125 - 192.168.1.126

ISP-routern konfigureras för seriella anslutningar till R1 och R2.

  • ISP(config)# interface Serial2/0
  • ISP(config-if)# description Connected to R1
  • ISP(config-if)# ip address 192.168.1.121 255.255.255.252
  • ISP(config-if)# no shutdown
  • ISP(config-if)# exit
  • ISP(config)# interface Serial3/0
  • ISP(config-if)# description Connected to R2
  • ISP(config-if)# ip address 192.168.1.125 255.255.255.252
  • ISP(config-if)# no shutdown
  • ISP(config-if)# exit
  • ISP(config)#

ISP-routern konfigureras för routing med RIP

  • ISP(config)# router rip
  • ISP(config-router)# version 2
  • ISP(config-router)# no auto-summary
  • ISP(config-router)# network 192.168.1.0
  • ISP(config-router)# end
  • ISP# Copy running-config startup-config

R1 interface konfiguration och subinterface för VLAN 10 och 20

  • R1(config)# interface Serial2/0
  • R1(config-if)# description DCE Connected to ISP
  • R1(config-if)# clock rate 128000
  • R1(config-if)# ip address 192.168.1.122 255.255.255.252
  • R1(config-if)# no shutdown
  • R1(config-if)# exit
  • ! Konifguration av subinterfaces (det fysiska interfacet aktiveras av)
  • R1(config)# interface FastEthernet0/0
  • R1(config-if)# no ip address
  • R1(config-if)# shutdown
  • R1(config-if)# exit
  • R1(config)# interface FastEthernet0/0.10
  • R1(config-subif)# description Connected to VLAN 10
  • R1(config-subif)# encapsulation dot1Q 10
  • R1(config-subif)# ip address 192.168.1.1 255.255.255.192
  • R1(config-subif)# no shutdown
  • R1(config-subif)# exit
  • R1(config)# interface FastEthernet0/0.20
  • R1(config-subif)# description Connected to VLAN 20
  • R1(config-subif)# encapsulation dot1Q 20
  • R1(config-subif)# ip address 192.168.1.65 255.255.255.224
  • R1(config-subif)# no shutdown
  • R1(config-subif)# exit
  • ! Det fysiska interface aktiveras
  • R1(config)# interface FastEthernet0/0
  • R1(config-if)# no shutdown
  • R1(config-if)# exit
  • R1(config)#

Konfigurera R1 som DHCP server för VLAN 10 och 20

  • R1(config)# ip dhcp excluded-address 192.168.1.1 192.168.1.2
  • R1(config)# ip dhcp excluded-address 192.168.1.65 192.168.1.66
  • R1(config)# ip dhcp pool EXECUTIVES
  • R1(dhcp-config)# network 192.168.1.0 255.255.255.192
  • R1(dhcp-config)# default-router 192.168.1.1
  • R1(dhcp-config)# dns-server 8.8.8.8
  • R1(dhcp-config)# domain-name ng.se
  • R1(dhcp-config)# exit
  • R1(config)# ip dhcp pool ECONOMY
  • R1(dhcp-config)# network 192.168.1.64 255.255.255.224
  • R1(dhcp-config)# default-router 192.168.1.65
  • R1(dhcp-config)# dns-server 8.8.8.8
  • R1(dhcp-config)# domain-name ng.se
  • R1(dhcp-config)# exit
  • R1(config)#

R2 interface konfiguration och subinterface för VLAN 30 och 40

  • R2(config)# interface Serial3/0
  • R2(config-if)# description DCE Connected to ISP
  • R2(config-if)# clock rate 128000
  • R2(config-if)# ip address 192.168.1.126 255.255.255.252
  • R2(config-if)# no shutdown
  • R2(config-if)# exit
  • ! Konfiguration av subinterfaces (det fysiska interfacet stängs av)
  • R2(config)# interface fa0/0
  • R2(config-if)# no ip address
  • R2(config-if)# shutdown
  • R2(config-if)# exit
  • R2(config)# interface FastEthernet0/0.30
  • R2(config-subif)# description Connected to VLAN 30
  • R2(config-subif)# encapsulation dot1Q 30
  • R2(config-subif)# ip address 192.168.1.97 255.255.255.240
  • R2(config-subif)# no shutdown
  • R2(config-subif)# exit
  • R2(config)# interface FastEthernet0/0.40
  • R2(config-subif)# description Connected to VLAN 40
  • R2(config-subif)# encapsulation dot1Q 40
  • R2(config-subif)# ip address 192.168.1.113 255.255.255.248
  • R2(config-subif)# no shutdown
  • R2(config-subif)# exit
  • ! Det fysiska interfacet aktiveras 
  • R2(config)# interface FastEthernet0/0
  • R2(config-if)# no shutdown
  • R2(config-if)# exit
  • R2(config)#

Konfigurera R2 som DHCP server för VLAN 30 och 40

  • R2(config)# ip dhcp excluded-address 192.168.1.97 192.168.1.98
  • R2(config)# ip dhcp excluded-address 192.168.1.113 192.168.1.114
  • R2(config)# ip dhcp pool MARKETING
  • R2(dhcp-config)# network 192.168.1.96 255.255.255.240
  • R2(dhcp-config)# default-router 192.168.1.97
  • R2(dhcp-config)# dns-server 8.8.8.8
  • R2(dhcp-config)# domain-name diginto.se
  • R2(dhcp-config)# exit
  • R2(config)# ip dhcp pool SALES
  • R2(dhcp-config)# network 192.168.1.112 255.255.255.248
  • R2(dhcp-config)# default-router 192.168.1.113
  • R2(dhcp-config)# dns-server 8.8.8.8
  • R2(dhcp-config)# domain-name diginto.se
  • R2(dhcp-config)# exit
  • R2(config)#

SWD1 (VTP-server):

  • SWD1(config)# vlan 10
  • SWD1(config-vlan)# name EXECUTIVES
  • SWD1(config-vlan)# vlan 20
  • SWD1(config-vlan)# name ECONOMY
  • SWD1(config-vlan)# exit
  • SWD1(config)# vtp mode server
  • SWD1(config)# vtp domain ng
  • SWD1(config)# vtp password ngP@55
  • SWD1(config)#

SWD1 trunk konfigurering:

  • SWD1(config)# interface range fa0/1 - 3
  • SWD1(config-if-range)# switchport mode trunk
  • SWD1(config-if-range)# switchport trunk allowed vlan 10,20
  • SWD1(config-if-range)# exit
  • SWD1(config)#

SWC1 (VTP-client):

  • SWC1(config)# vtp mode client
  • SWC1(config)# vtp domain ng
  • SWC1(config)# vtp password ngP@55
  • SWC1(config)# do show vlan brief

SWC1 trunk och STP konfigurering:

  • SWC1(config)# interface range Fa0/1 - 2
  • SWC1(config-if-range)# switchport mode trunk
  • SWC1(config-if-range)# switchport trunk allowed 10,20
  • SWC1(config-if-range)# exit

SWC1 porttilldening

  • SWC1(config)# interface range FastEthernet0/3 - 5
  • SWC1(config-if-range)# switchport mode access
  • SWC1(config-if-range)# switchport access vlan 10
  • SWC1(config-if-range)# exit
  • SWC1(config)# interface range FastEthernet0/6 - 8
  • SWC1(config-if-range)# switchport mode access
  • SWC1(config-if-range)# switchport access vlan 20
  • SWC1(config-if-range)# exit
  • SWC1(config)#

SWC1 STP konfigurering:

  • SWC1(config)# spanning-tree vlan 10 root primary
  • SWC1(config)# spanning-tree vlan 20 root secondary
  • SWC1(config)# end
  • SWC1# copy running-config startup-config

SWC2 (VTP-client):

  • SWC2(config)# vtp mode client
  • SWC2(config)# vtp domain ng
  • SWC2(config)# vtp password ngP@55
  • SWC2(config)# do show vlan brief

SWC2 trunk konfigurering:

  • SWC2(config)# interface range Fa0/1 - 2
  • SWC2(config-if-range)# switchport mode trunk
  • SWC2(config-if-range)# switchport trunk allowed vlan 10,20
  • SWC2(config-if-range)# exit

SWC2 porttilldelning

  • SWC2config)# interface range FastEthernet0/3 - 5
  • SWC2(config-if-range)# switchport mode access
  • SWC2(config-if-range)# switchport access vlan 10
  • SWC2(config-if-range)# exit
  • SWC2(config)# interface range FastEthernet0/6 - 8
  • SWC2(config-if-range)# switchport mode access
  • SWC2(config-if-range)# switchport access vlan 20
  • SWC2(config-if-range)# exit
  • SWC2(config)#

SWC2 STP konfigurering:

  • SWC2(config)# spanning-tree vlan 20 root primary
  • SWC2(config)# spanning-tree vlan 10 root secondary
  • SWC2(config)# end
  • SWC2# copy running-config startup-config

SWD2 (VTP-server):

  • SWD2(config)# vlan 30
  • SWD2(config-vlan)# name MARKETING
  • SWD2(config-vlan)# vlan 40
  • SWD2(config-vlan)# name SALES
  • SWD2(config-vlan)# exit
  • SWD2(config)# vtp mode server
  • SWD2(config)# vtp domain diginto
  • SWD2(config)# password digintoP@55
  • SWD2(config)#

SWD2 trunk konfigurering:

  • SWD2(config)# interface range fa0/1 - 3
  • SWD2(config-if-range)# switchport mode trunk
  • SWD2(config-if-range)# switchport trunk allowed vlan 30,40
  • SWD2(config-if-range)# exit
  • SWD2(config)#

SWC3 (VTP-client):

  • SWC3(config)# vtp mode client
  • SWC3(config)# vtp domain diginto
  • SWC3(config)# vtp password digintoP@55
  • SWC3(config)# do show vlan brief

SWC3 trunk konfigurering:

  • SWC3(config)# interface range Fa0/1 - 2
  • SWC3(config-if-range)# switchport mode trunk
  • SWC3(config-if-range)# exit

SWC3 porttilldelning

  • SWC3(config)# interface range FastEthernet0/3 - 5
  • SWC3(config-if-range)# switchport mode access
  • SWC3(config-if-range)# switchport access vlan 30
  • SWC3(config-if-range)# exit
  • SWC3(config)# interface range FastEthernet0/6 - 8
  • SWC3(config-if-range)# switchport mode access
  • SWC3(config-if-range)# switchport access vlan 40
  • SWC3(config-if-range)# exit
  • SWC3(config)#

SWC3 STP konfigurering:

  • SWC3(config)# spanning-tree vlan 30 root primary
  • SWC3(config)# spanning-tree vlan 40 root secondary
  • SWC3(config)# end
  • SWC3# copy running-config startup-config

SWC4 (VTP-client):

  • SWC4(config)# vtp mode client
  • SWC4(config)# vtp domain diginto
  • SWC4(config)# vtp password digintoP@55
  • SWC4(config)# do show vlan brief

SWC4 trunk konfigurering:

  • SWC4(config)# interface range Fa0/1 - 2
  • SWC4(config-if-range)# switchport mode trunk
  • SWC4(config-if-range)# switchport trunk allowed vlan 30,40
  • SWC4(config-if-range)# exit

SWC4 porttilldelning:

  • SWC4config)# interface range FastEthernet0/3 - 5
  • SWC4(config-if-range)# switchport mode access
  • SWC4(config-if-range)# switchport access vlan 30
  • SWC4(config-if-range)# exit
  • SWC4(config)# interface range FastEthernet0/6 - 8
  • SWC4(config-if-range)# switchport mode access
  • SWC4(config-if-range)# switchport access vlan 40
  • SWC4(config-if-range)# exit
  • SWC4(config)#

SWC4 STP konfigurering:

  • SWC4(config)# spanning-tree vlan 40 root primary
  • SWC4(config)# spanning-tree vlan 30 root secondary
  • SWC4(config)# end
  • SWC4# copy running-config startup-config
  • R1
  • R1(config)# router rip
  • R1(config-router)# version 2
  • R1(config-router)# no auto-summary
  • R1(config-router)# network 192.168.1.0
  • R1(config-router)# passive-interface fa0/0.10
  • R1(config-router)# passive-interface fa0/0.20
  • R1(config-router)# end
  • R1# copy running-config startup-config
  • R2
  • R2(config)# router rip
  • R2(config-router)# version 2
  • R2(config-router)# no auto-summary
  • R2(config-router)# network 192.168.1.0
  • R2(config-router)# passive-interface fa0/0.30
  • R2(config-router)# passive-interface fa0/0.40
  • R2(config-router)# end
  • R2# copy running-config startup-config