Chapter 3 VLANs Switched Networks PresentationID 2008 Cisco

  • Slides: 67
Download presentation
Chapter 3: VLANs Switched Networks Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved.

Chapter 3: VLANs Switched Networks Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 1

Chapter 3 3. 1 VLAN Segmentation 3. 2 VLAN Implementation 3. 3 VLAN Security

Chapter 3 3. 1 VLAN Segmentation 3. 2 VLAN Implementation 3. 3 VLAN Security and Design 3. 4 Summary

Objectives § VLANs in a converged network § Trunking VLANs in a converged network

Objectives § VLANs in a converged network § Trunking VLANs in a converged network § Configuration of VLANs on switches § Troubleshooting misconfigurations in VLANs

3. 1 VLAN Segmentation Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco

3. 1 VLAN Segmentation Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 4

Introduction to VLANs Pak se hodí mít možnost seskupovat libovolně, i jinak, než jen

Introduction to VLANs Pak se hodí mít možnost seskupovat libovolně, i jinak, než jen podle toho, kde kdo sedí a kam je připojený. Umíme si představit, že do jedné skupiny počítačů budou patřit ty, které jsou připojené na jeden přepínač. Bude to např. v rámci jednoho patra, kde sídlí lidé, kteří k sobě nějak patří, třeba ředitelství, vývoj, ekonomický úsek. . . Ale co když všichni vývojáři sedí v přízemí a jednoho museli posadit do 1. patra?

VLANs VLAN umožňují dělit síť logicky podle funkce organizace, projektových týmů nebo aplikací, nejen

VLANs VLAN umožňují dělit síť logicky podle funkce organizace, projektových týmů nebo aplikací, nejen na základě fyzického nebo prostorového uspořádání. VLANs logically segment switched networks based on an organization's functions, project teams, or applications as opposed to a physical or geographical basis.

Broadcast Domains Toto je klasické uspořádání bez VLAN. Každé oddělení má svůj switch, který

Broadcast Domains Toto je klasické uspořádání bez VLAN. Každé oddělení má svůj switch, který všechny svoje počítače obsluhuje jako jednu broadcast doménu. Každé oddělení (tj. každý switch) má svoji síť s jinou adresou. Jednotlivé sítě odděluje / spojuje router.

Example: 3 Broadcast Domains, 3 VLANs Stejné požadavky ve stejném podniku, ale řešené pomocí

Example: 3 Broadcast Domains, 3 VLANs Stejné požadavky ve stejném podniku, ale řešené pomocí VLAN. Všichni sdílejí jeden společný switch. Jsou od sebe odděleni pomocí VLAN. Komunikaci mezi VLAN zajišťuje router.

Example: 3 Broadcast Domains, 3 VLANs Síťová vrstva – jede se podle IP adres.

Example: 3 Broadcast Domains, 3 VLANs Síťová vrstva – jede se podle IP adres. Datová – podle MAC adres. Fyzická – konektory, kabely, . . . Jsou zde tři sítě s různými adresami. Počítače jsou takto logicky seskupeny. . . bez ohledu na to, jak jsou fyzicky nadrátovány k přepínačům.

VLANs in a Converged Network Broadcast domains without VLANs V síti bez VLAN tvoří

VLANs in a Converged Network Broadcast domains without VLANs V síti bez VLAN tvoří všechny počítače jednu velkou broadcast doménu, protože jsou všechny v jedné síti: 172. 17. 40. 0 / 24. Broadcasty se šíří do všech počítačů v celé síti.

VLANs in a Converged Network Broadcast domains without VLANs I kdyby ale nepatřily všechny

VLANs in a Converged Network Broadcast domains without VLANs I kdyby ale nepatřily všechny PC do jedné sítě, jako tady: Vlevo je síť 192. 168. 1. x, vpravo je síť 192. 168. 2. x. Když levý horní chce poprvé pingnout levý dolní (tj. ve své vlastní síti), tak ARP broadcast dostanou všichni, tj. i ti vpravo.

VLANs in a Converged Network Broadcast domains with VLANs Je-li síť rozdělena na VLAN,

VLANs in a Converged Network Broadcast domains with VLANs Je-li síť rozdělena na VLAN, každý broadcast se šíří jen v rámci své VLAN. V síti na obrázku zatím není vyřešena komunikace mezi VLAN – není tam router.

VLANs in a Converged Network Broadcast domains with VLANs in a Converged Network Tady

VLANs in a Converged Network Broadcast domains with VLANs in a Converged Network Tady už je router. Komunikace může být intra-VLAN (uvnitř VLAN) a inter. VLAN (mezi VLAN). Když se komunikuje uvnitř VLAN, tak ARP request (žádost o zjištění neznámé MAC adresy ke známé IP adrese) proběhne jako broadcast jen v rámci jedné VLAN.

VLANs in a Converged Network Broadcast domains with VLANs in a Converged Network Když

VLANs in a Converged Network Broadcast domains with VLANs in a Converged Network Když se komunikuje mezi VLAN, např. z VLAN 10 do VLAN 20, tak router na ARP request odpoví MAC adresou svého portu, což je pro odesílající PC default gateway. PC to tedy pošle na default gateway = router. Když pak v dalším kroku router dostane paket s cílovou IP adresou do VLAN 20, rozešle do VLAN 20 ARP request a zjistí si MAC adresu cílového počítače. Na tu pak pošle frame a v něm zabalený paket.

VLANs in a Converged Network Broadcast domains with VLANs SVI = Switch Virtual Interface

VLANs in a Converged Network Broadcast domains with VLANs SVI = Switch Virtual Interface Podobně to funguje s přepínačem, který umí přepínat na vrstvě 3, tj. podle IP adres.

VLANs in a Converged Network Types of VLANs Typy VLAN • • • Data

VLANs in a Converged Network Types of VLANs Typy VLAN • • • Data Default Native Management Voice • • • Datová Přednastavená Původní, přirozená Řídicí Hlasová

VLANs in a Converged Network Data VLAN = Datová VLAN je konfigurovaná jen pro

VLANs in a Converged Network Data VLAN = Datová VLAN je konfigurovaná jen pro přenos dat, která generují uživatelé. Nedávají se do ní hlasová data ani data pro řízení a správu sítě. Někdy se jí také říká „uživatelská“ = „user“ VLAN.

VLANs in a Converged Network Default VLAN = Přednastavená VLAN Default VLAN je ta,

VLANs in a Converged Network Default VLAN = Přednastavená VLAN Default VLAN je ta, ke které patří všechny porty, které nebyly přiřazeny jinam. U přepínačů Cisco je default VLAN vždy VLAN 1 a nedá se to změnit. VLAN 1 není možné přejmenovat ani vymazat.

VLANs in a Converged Network Native VLAN = původní, přirozená VLAN Native VLAN je

VLANs in a Converged Network Native VLAN = původní, přirozená VLAN Native VLAN je ta, do které patří trunk interfaces = hlavní rozhraní, v obrázku F 0/1, F 0/3, F 0/5. Jsou to rozhraní, po kterých běží provoz všech VLAN. Native VLAN má v obrázku číslo 99. Framy pocházející z jednotlivých VLAN dostávají na vstupu do sítě značky (tags), jsou značkované (tagged). Podle těchto značek jsou pak rozdělovány do správných VLAN při výstupu ze sítě. 802. 1 Q je protokol, kterým je toto značkování řízeno. Dostane-li se do sítě frame neoznačený (untagged), je umístěn do native VLAN. Zařízení, připojená k native VLAN (např. PC vlevo nahoře), generují framy neoznačené (untagged).

VLANs in a Converged Network Management VLAN = Řídicí VLAN Řídicí (management) VLAN je

VLANs in a Converged Network Management VLAN = Řídicí VLAN Řídicí (management) VLAN je kterákoliv, které jsme přiřadili IP adresu a tím jí dali schopnost řídit přepínač. Přes tuto IP adresu můžeme přepínač ovládat na dálku pomocí HTTP, Telnet, SSH nebo SNMP. Po prvním zapnutí přepínače je řídicí (management) VLAN 1. Kvůli bezpečnosti je vhodné to změnit.

VLANs in a Converged Network Zvláštní úloha VLAN 1 • po prvním zapnutí (out-of-the-box)

VLANs in a Converged Network Zvláštní úloha VLAN 1 • po prvním zapnutí (out-of-the-box) je VLAN 1 • • • data VLAN • default VLAN • management VLAN po prvním zapnutí do ní patří všechny porty nelze ji vymazat nelze ji přejmenovat vždy zůstává default VLAN jde po ní řídicí provoz vrstvy 2, např. CDP, STP, nelze to změnit

VLANs in a Converged Network Příklad konfigurace VLAN – viz předchozí obrázky Funkce Out-of-the-box

VLANs in a Converged Network Příklad konfigurace VLAN – viz předchozí obrázky Funkce Out-of-the-box Po konfiguraci VLAN 1 VLAN 20, VLAN 30 Není žádná, protože switch má všechny interfaces rovnocenné, žádné trunk interfaces VLAN 1 VLAN 99 Default VLAN 1 Řídicí provoz vrstvy 2 VLAN 1 Data VLAN Native VLAN Management VLAN 99

VLANs in a Converged Network Shrnutí VLAN Data VLAN Vlastnosti Běhají po ní data

VLANs in a Converged Network Shrnutí VLAN Data VLAN Vlastnosti Běhají po ní data generovaná uživateli. Default VLAN Patří do ní všechny porty, které jsme nepřeřadili jinam. Vždy je to VLAN 1. Native VLAN Patří do ní trunk interfaces. Management VLAN Má IP adresu.

VLANs in a Converged Network Overview of VLANs Voice VLANs § Vo. IP traffic

VLANs in a Converged Network Overview of VLANs Voice VLANs § Vo. IP traffic is time-sensitive and requires: • Assured bandwidth to ensure voice quality. • Transmission priority over other types of network traffic. • Ability to be routed around congested areas on the network. • Delay of less than 150 ms across the network. § The voice VLAN feature enables access ports to carry IP voice traffic from an IP phone. § The switch can connect to a Cisco 7960 IP phone and carry IP voice traffic. § The sound quality of an IP phone call can deteriorate if the data is unevenly sent; the switch supports quality of service (Qo. S).

VLANs in a Converged Network § VLAN port membership modes Hlasová Datová Hlasová VLAN

VLANs in a Converged Network § VLAN port membership modes Hlasová Datová Hlasová VLAN – Port se konfiguruje tak, aby podporoval IP telefon. Nejdřív musíme vytvořit jednu VLAN pro hlas a jednu pro data. Síť musí být konfigurována tak, aby hlasový provoz přenášela přednostně. Když poprvé připojíme IP telefon k portu v hlasovém módu, switch poskytne telefonu jeho VLAN ID a konfiguraci. IP telefon pak značkuje svoje rámce tímto přiděleným ID a síť hlasové rámce přenáší po hlasové VLAN.

Overview of VLANs Voice VLANs (cont. ) § The Cisco 7960 IP phone has

Overview of VLANs Voice VLANs (cont. ) § The Cisco 7960 IP phone has two RJ-45 ports that each support connections to external devices. • Network Port (10/100 SW) - Use this port to connect the phone to the network. The phone can also obtain inline power from the Cisco Catalyst switch over this connection. • Access Port (10/100 PC) - Use this port to connect a network device, such as a computer, to the phone.

Overview of VLANs Voice VLANs (cont. )

Overview of VLANs Voice VLANs (cont. )

Trunking VLANs Jak by to bylo bez trunků: Pro každou VLAN by musel být

Trunking VLANs Jak by to bylo bez trunků: Pro každou VLAN by musel být mezi přepínači jeden fyzický spoj a na každém přepínači jeden port, protože „obyčejné“ porty v módu access je možno přiřadit jen do jedné VLAN. S přidáním každé další VLAN by na každém přepínači ubyl nejméně jeden port, který se pro ni musí vyhradit. (Černá propojka je pro management a native VLAN 99. )

Trunking VLANs S trunky: Pro všechny VLAN stačí jeden společný spoj – trunk.

Trunking VLANs S trunky: Pro všechny VLAN stačí jeden společný spoj – trunk.

Trunking VLANs How a trunk works Když PC z některé datové VLAN vyšle frame,

Trunking VLANs How a trunk works Když PC z některé datové VLAN vyšle frame, přepínač označí frame značkou (tag), zvanou VLAN ID. S touto značkou frame putuje přes trunky mezi přepínači, a podle značky přepínače poznají, do které VLAN frame patří. Když potom frame opouští poslední přepínač na své cestě, má vstoupit do některé datové VLAN a dojít do cílového PC, poslední přepínač značku z framu vyndá, aby z ní cílový PC nebyl zmatený.

VLANs in a Multi-Switched Environment Tagging Ethernet Frames for VLAN Identification § Frame tagging

VLANs in a Multi-Switched Environment Tagging Ethernet Frames for VLAN Identification § Frame tagging is the process of adding a VLAN identification header to the frame. § It is used to transmit multiple VLAN frames through a trunk link. § Switches tag frames to identify the VLAN to that they belong. § The protocol defines the structure of the tagging header added to the frame. § Switches add VLAN tags to the frames before placing them into trunk links and remove the tags before forwarding frames through nontrunk ports. § When properly tagged, the frames can transverse any number of switches via trunk links and still be forwarded within the correct VLAN at the destination.

VLANs in a Multi-Switched Environment Tagging Ethernet Frames for VLAN Identification

VLANs in a Multi-Switched Environment Tagging Ethernet Frames for VLAN Identification

M 3 A 9/4/19

M 3 A 9/4/19

VLANs in a Multi-Switched Environment Native VLANs and 802. 1 Q Tagging § Frames

VLANs in a Multi-Switched Environment Native VLANs and 802. 1 Q Tagging § Frames that belong to the native VLAN are not tagged. § Frames received untagged remain untagged and are placed in the native VLAN when forwarded. § If there are no ports associated to the native VLAN and no other trunk links, an untagged frame is dropped. § In Cisco switches, by default, the native VLAN is VLAN 1.

VLANs in a Multi-Switched Environment Voice VLAN Tagging

VLANs in a Multi-Switched Environment Voice VLAN Tagging

3. 2 VLAN Implementations Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco

3. 2 VLAN Implementations Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 36

VLAN Assignment VLAN Ranges on Catalyst Switches § Cisco switches support over 4, 000

VLAN Assignment VLAN Ranges on Catalyst Switches § Cisco switches support over 4, 000 VLANs. § VLANs are split into two categories: • Normal range VLANs • VLAN numbers from 1 to 1, 005 • Configurations stored in the vlan. dat (in the flash memory) • VTP can only learn and store normal range VLANs • Extended Range VLANs • VLAN numbers from 1, 006 to 4, 096 • Configurations stored in the running configuration (NVRAM) • VTP does not learn extended range VLANs

Configuring VLANs § Configuring trunks and VLANs Vytvoř VLANs Přiřaď porty Ověř VLANs Umožni

Configuring VLANs § Configuring trunks and VLANs Vytvoř VLANs Přiřaď porty Ověř VLANs Umožni trunk Ověř trunk

Configuring VLANs IOS commands to create a VLAN

Configuring VLANs IOS commands to create a VLAN

VLAN Assignment Assigning Ports to VLANs

VLAN Assignment Assigning Ports to VLANs

VLAN Assignment Changing VLAN Port Membership

VLAN Assignment Changing VLAN Port Membership

VLAN Assignment Changing VLAN Port Membership (cont. )

VLAN Assignment Changing VLAN Port Membership (cont. )

VLAN Assignment Deleting VLANs

VLAN Assignment Deleting VLANs

VLAN Assignment Verifying VLAN Information

VLAN Assignment Verifying VLAN Information

VLAN Assignment Verifying VLAN Information (cont. )

VLAN Assignment Verifying VLAN Information (cont. )

Configuring VLANs IOS commands used to create a trunk Vytvoř trunk Která VLAN bude

Configuring VLANs IOS commands used to create a trunk Vytvoř trunk Která VLAN bude native (tj. bude sloužit trunkům a půjdou po ní neoznačkované framy). Které VLAN budou na tomto trunku povolené. Když tento příkaz vůbec nezadáme, Když tento příkaz vůbec budou povolené nezadáme, native bude VLAN 1. všechny. Bude to fungovat, ale nebude to bezpečné.

VLAN Assignment Resetting the Trunk To Default State

VLAN Assignment Resetting the Trunk To Default State

VLAN Assignment Resetting the Trunk To Default State (cont. )

VLAN Assignment Resetting the Trunk To Default State (cont. )

VLAN Assignment Verifying Trunk Configuration

VLAN Assignment Verifying Trunk Configuration

Dynamic Trunking Protocol Introduction to DTP § Switch ports can be manually configured to

Dynamic Trunking Protocol Introduction to DTP § Switch ports can be manually configured to form trunks. § Switch ports can also be configured to negotiate and establish a trunk link with a connected peer. § The Dynamic Trunking Protocol (DTP) manages trunk negotiation. § DTP is a Cisco proprietary protocol. § If the port on the neighbor switch is configured in a trunk mode that supports DTP, it manages the negotiation. § The default DTP configuration for Cisco switches is dynamic auto.

Trunking VLANs Switch port trunking modes DTP = Dynamic Trunking Protocol, Cisco proprietary =>

Trunking VLANs Switch port trunking modes DTP = Dynamic Trunking Protocol, Cisco proprietary => ostatní to neumí. Both periodically send DTP frames, called advertisements. Oba periodicky vysílají DTP informace. The port is in an unconditional (always on) trunking state. Periodicky vysílá svoje DTP informace (advertisments), ale zůstává v trunking módu. The port goes in trunking state only if the remote port is configured to be trunk or desirable. Periodicky vysílá svoje DTP informace. Přejde do trunking módu, pokud ten na druhé straně je trunk nebo je ochoten se jím stát. Jinak zůstává v access módu.

Trunking VLANs Switch port trunking modes Jak to dopadne, když oba podporují DTP, a

Trunking VLANs Switch port trunking modes Jak to dopadne, když oba podporují DTP, a jeden je nastavený tak a druhý tak: Je mi to jedno Chci být trunk Jsem Trunk Jsem Access Nastavíme-li na jedné straně tvrdě Access a na druhé tvrdě Trunk, bude to průchozí (patrně v módu Access), ale není to zdravé. Proto se to nedoporučuje.

Troubleshooting Problems with VLANs and trunks Takto je to zapojeno, tak to chceme. Proč

Troubleshooting Problems with VLANs and trunks Takto je to zapojeno, tak to chceme. Proč to nejde? Viz další snímek.

Troubleshooting Problems with VLANs and trunks Zde hlásí mismatch => něco k sobě nepasuje.

Troubleshooting Problems with VLANs and trunks Zde hlásí mismatch => něco k sobě nepasuje. . . . a to 100 na S 3 a 99 na S 1 Toto je příčina: Na S 3 je jako native VLAN 100 místo VLAN 99 Řešení:

Troubleshooting procedure to fix a problem Takto je to zapojeno, tak to chceme. Proč

Troubleshooting procedure to fix a problem Takto je to zapojeno, tak to chceme. Proč to nejde? Viz další snímek.

Troubleshooting procedure to fix a problem S 1 i S 3: Oběma je to

Troubleshooting procedure to fix a problem S 1 i S 3: Oběma je to jedno (dynamic auto) => nastaví se do módu access, nikoliv trunk.

Troubleshooting procedure to fix a problem Řešení: Oběma nebo aspoň jednomu vnutíme mód trunk.

Troubleshooting procedure to fix a problem Řešení: Oběma nebo aspoň jednomu vnutíme mód trunk.

Troubleshooting Problems with VLANs and trunks Na jednom portu je určená jako native VLAN

Troubleshooting Problems with VLANs and trunks Na jednom portu je určená jako native VLAN 99, na jiném VLAN 100 Na jednom portu je trunk mód zapnutý, na protějším vypnutý VLAN a IP adresy nejdou dohromady Nevyjmenovali jsme všechny sítě, které na tomto trunku chceme povolit (příkaz „switchport trunk allowed vlan add. . . “)

3. 3 VLAN Security and Design Presentation_ID © 2008 Cisco Systems, Inc. All rights

3. 3 VLAN Security and Design Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 60

Attacks on VLANs Switch Spoofing Attack § There a number of different types of

Attacks on VLANs Switch Spoofing Attack § There a number of different types of VLAN attacks in modern switched networks; VLAN hopping is one example. § The default configuration of the switch port is dynamic auto. § By configuring a host to act as a switch and form a trunk, an attacker could gain access to any VLAN in the network. § Because the attacker is now able to access other VLANs, this is called a VLAN hopping attack. § To prevent a basic switch spoofing attack, turn off trunking on all ports, except the ones that specifically require trunking.

Attacks on VLANs Double-Tagging Attack § Double-tagging attack takes advantage of the way that

Attacks on VLANs Double-Tagging Attack § Double-tagging attack takes advantage of the way that hardware on most switches de-encapsulate 802. 1 Q tags. § Most switches perform only one level of 802. 1 Q de-encapsulation, allowing an attacker to embed a second, unauthorized attack header in the frame. § After removing the first and legit 802. 1 Q header, the switch forwards the frame to the VLAN specified in the unauthorized 802. 1 Q header. § The best approach to mitigating double-tagging attacks is to ensure that the native VLAN of the trunk ports is different from the VLAN of any user ports.

Attacks on VLANs Double-Tagging Attack (cont. )

Attacks on VLANs Double-Tagging Attack (cont. )

Attacks on VLANs PVLAN Edge § The Private VLAN (PVLAN) Edge feature, also known

Attacks on VLANs PVLAN Edge § The Private VLAN (PVLAN) Edge feature, also known as protected ports, ensures that there is no exchange of unicast, broadcast, or multicast traffic between protected ports on the switch. § Local relevancy only. § A protected port only exchanges traffic with unprotected ports. § A protected port does not exchange traffic with another protected port.

Design Best Practices for VLANs VLAN Design Guidelines § Move all ports from VLAN

Design Best Practices for VLANs VLAN Design Guidelines § Move all ports from VLAN 1 and assign them to a not-in-use VLAN § Shut down all unused switch ports. § Separate management and user data traffic. § Change the management VLAN to a VLAN other than VLAN 1. (The same goes to the native VLAN. ) § Ensure that only devices in the management VLAN can connect to the switches. § The switch should only accept SSH connections. § Disable autonegotiation on trunk ports. § Do not use the auto or desirable switch port modes.

Chapter 3: Summary This chapter: § Introduced VLANs and their types § Described the

Chapter 3: Summary This chapter: § Introduced VLANs and their types § Described the connection between VLANs and broadcast domains § Discussed IEEE 802. 1 Q frame tagging and how it enables differentiation between Ethernet frames associated with distinct VLANs as they traverse common trunk links. § Examined the configuration, verification, and troubleshooting of VLANs and trunks using the Cisco IOS CLI and explored basic security and design considerations.

Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 67

Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 67