Difference between revisions of "VLAN øvelse"
From Teknologisk videncenter
m (→Opgave 5: Opret et VLAN mere) |
m |
||
Line 24: | Line 24: | ||
<source lang=cli> | <source lang=cli> | ||
Switch> | Switch> | ||
− | Switch | + | Switch>enable |
− | Switch# | + | Switch#configure terminal |
Enter configuration commands, one per line. End with CNTL/Z. | Enter configuration commands, one per line. End with CNTL/Z. | ||
− | Switch(config)# | + | Switch(config)#vlan 100 |
− | Switch(config-vlan)# | + | Switch(config-vlan)#name Students |
− | Switch(config-vlan)# | + | Switch(config-vlan)#exit |
− | Switch(config)# | + | Switch(config)#vlan 200 |
− | Switch(config-vlan)# | + | Switch(config-vlan)#name Teachers |
− | Switch(config-vlan)# | + | Switch(config-vlan)#exit |
− | Switch(config)# | + | Switch(config)#exit |
Switch# | Switch# | ||
%SYS-5-CONFIG_I: Configured from console by console | %SYS-5-CONFIG_I: Configured from console by console | ||
− | Switch# | + | Switch#show vlan brief |
VLAN Name Status Ports | VLAN Name Status Ports | ||
---- -------------------------------- --------- ------------------------------- | ---- -------------------------------- --------- ------------------------------- | ||
Line 52: | Line 52: | ||
1004 fddinet-default active | 1004 fddinet-default active | ||
1005 trnet-default active | 1005 trnet-default active | ||
− | Switch# | + | Switch#copy running-config startup-config |
Destination filename [startup-config]? | Destination filename [startup-config]? | ||
Building configuration... | Building configuration... | ||
Line 62: | Line 62: | ||
Oprettelse af trunk på port 24. '''Husk skal gøres på begge switche..''' | Oprettelse af trunk på port 24. '''Husk skal gøres på begge switche..''' | ||
<source lang=cli> | <source lang=cli> | ||
− | + | Switch>enable | |
− | Switch# | + | Switch#show interfaces trunk |
− | Switch# | + | Switch#configure terminal |
Enter configuration commands, one per line. End with CNTL/Z. | Enter configuration commands, one per line. End with CNTL/Z. | ||
− | Switch(config)# | + | Switch(config)#interface fastethernet 0/24 |
− | Switch(config-if)# | + | Switch(config-if)#switchport mode trunk |
− | Switch(config-if)# | + | Switch(config-if)#exit |
− | Switch(config)# | + | Switch(config)#exit |
%SYS-5-CONFIG_I: Configured from console by console | %SYS-5-CONFIG_I: Configured from console by console | ||
− | Switch# | + | Switch#show interfaces trunk |
Port Mode Encapsulation Status Native vlan | Port Mode Encapsulation Status Native vlan | ||
Fa0/24 on 802.1q trunking 1 | Fa0/24 on 802.1q trunking 1 | ||
Line 90: | Line 90: | ||
De enkelte porte til PC'erne skal i forskellige VLAN's. '''Husk skal gøres på begge switche..''' | De enkelte porte til PC'erne skal i forskellige VLAN's. '''Husk skal gøres på begge switche..''' | ||
<source lang=cli> | <source lang=cli> | ||
− | Switch | + | Switch>enable |
− | Switch# | + | Switch#show vlan brief |
VLAN Name Status Ports | VLAN Name Status Ports | ||
Line 107: | Line 107: | ||
1004 fddinet-default active | 1004 fddinet-default active | ||
1005 trnet-default active | 1005 trnet-default active | ||
− | Switch# | + | Switch#configure terminal |
Enter configuration commands, one per line. End with CNTL/Z. | Enter configuration commands, one per line. End with CNTL/Z. | ||
− | Switch(config)# | + | Switch(config)#interface fastethernet 0/1 |
− | Switch(config-if)# | + | Switch(config-if)#switchport mode access |
− | Switch(config-if)# | + | Switch(config-if)#switchport access vlan 100 |
− | Switch(config-if)# | + | Switch(config-if)#exit |
− | Switch(config)# | + | Switch(config)#interface fastethernet 0/10 |
− | Switch(config-if)# | + | Switch(config-if)#switchport mode access |
− | Switch(config-if)# | + | Switch(config-if)#switchport access vlan 200 |
− | Switch(config-if)# | + | Switch(config-if)#exit |
− | Switch(config)# | + | Switch(config)#exit |
Switch# | Switch# | ||
%SYS-5-CONFIG_I: Configured from console by console | %SYS-5-CONFIG_I: Configured from console by console | ||
− | Switch# | + | Switch#show vlan brief |
VLAN Name Status Ports | VLAN Name Status Ports | ||
Line 131: | Line 131: | ||
Fa0/19, Fa0/20, Fa0/21, Fa0/22 | Fa0/19, Fa0/20, Fa0/21, Fa0/22 | ||
Fa0/23 | Fa0/23 | ||
− | + | 100 Students active Fa0/1 | |
− | + | 200 Teachers active Fa0/10 | |
1002 fddi-default active | 1002 fddi-default active | ||
1003 token-ring-default active | 1003 token-ring-default active |
Latest revision as of 07:31, 26 February 2025
Opgave 1: Opbyg netværk
Opbyg følgende netværk i Packet Tracer: (Switchene er type 2950-24)
- PC0 forbundet med lige i gennem kabel til Switch0 port 1
- PC1 forbundet med lige i gennem kabel til Switch0 port 10
- PC2 forbundet med lige i gennem kabel til Switch1 port 1
- PC3 forbundet med lige i gennem kabel til Switch1 port 10
- Switch0 port 24 forbundet med Switch1 port 24 med kryds kabel
IP adresser på PC'erne
- PC0 har IP adressen 192.168.1.10/24
- PC1 har IP adressen 192.168.1.11/24
- PC2 har IP adressen 192.168.1.12/24
- PC3 har IP adressen 192.168.1.13/24
Er det muligt at pinge mellem PC'erne??
Opgave 2: VLAN oprettes
Opret VLAN på begge switche: Husk skal gøres på begge switche..
Switch>
Switch>enable
Switch#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#vlan 100
Switch(config-vlan)#name Students
Switch(config-vlan)#exit
Switch(config)#vlan 200
Switch(config-vlan)#name Teachers
Switch(config-vlan)#exit
Switch(config)#exit
Switch#
%SYS-5-CONFIG_I: Configured from console by console
Switch#show vlan brief
VLAN Name Status Ports
---- -------------------------------- --------- -------------------------------
1 default active Fa0/1, Fa0/2, Fa0/3, Fa0/4
Fa0/5, Fa0/6, Fa0/7, Fa0/8
Fa0/9, Fa0/10, Fa0/11, Fa0/12
Fa0/13, Fa0/14, Fa0/15, Fa0/16
Fa0/17, Fa0/18, Fa0/19, Fa0/20
Fa0/21, Fa0/22, Fa0/23, Fa0/24
100 Students active
200 Teachers active
1002 fddi-default active
1003 token-ring-default active
1004 fddinet-default active
1005 trnet-default active
Switch#copy running-config startup-config
Destination filename [startup-config]?
Building configuration...
[OK]
Switch#
Opgave 3: Trunk oprettes
Oprettelse af trunk på port 24. Husk skal gøres på begge switche..
Switch>enable
Switch#show interfaces trunk
Switch#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#interface fastethernet 0/24
Switch(config-if)#switchport mode trunk
Switch(config-if)#exit
Switch(config)#exit
%SYS-5-CONFIG_I: Configured from console by console
Switch#show interfaces trunk
Port Mode Encapsulation Status Native vlan
Fa0/24 on 802.1q trunking 1
Port Vlans allowed on trunk
Fa0/24 1-1005
Port Vlans allowed and active in management domain
Fa0/24 1,100,200
Port Vlans in spanning tree forwarding state and not pruned
Fa0/24 none
Switch#
Opgave 4: PC porte i VLANs
De enkelte porte til PC'erne skal i forskellige VLAN's. Husk skal gøres på begge switche..
Switch>enable
Switch#show vlan brief
VLAN Name Status Ports
---- -------------------------------- --------- -------------------------------
1 default active Fa0/1, Fa0/2, Fa0/3, Fa0/4
Fa0/5, Fa0/6, Fa0/7, Fa0/8
Fa0/9, Fa0/10, Fa0/11, Fa0/12
Fa0/13, Fa0/14, Fa0/15, Fa0/16
Fa0/17, Fa0/18, Fa0/19, Fa0/20
Fa0/21, Fa0/22, Fa0/23
<notice>100 Students active </notice>
<notice>200 Teachers active </notice>
1002 fddi-default active
1003 token-ring-default active
1004 fddinet-default active
1005 trnet-default active
Switch#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#interface fastethernet 0/1
Switch(config-if)#switchport mode access
Switch(config-if)#switchport access vlan 100
Switch(config-if)#exit
Switch(config)#interface fastethernet 0/10
Switch(config-if)#switchport mode access
Switch(config-if)#switchport access vlan 200
Switch(config-if)#exit
Switch(config)#exit
Switch#
%SYS-5-CONFIG_I: Configured from console by console
Switch#show vlan brief
VLAN Name Status Ports
---- -------------------------------- --------- -------------------------------
1 default active Fa0/2, Fa0/3, Fa0/4, Fa0/5
Fa0/6, Fa0/7, Fa0/8, Fa0/9
Fa0/11, Fa0/12, Fa0/13, Fa0/14
Fa0/15, Fa0/16, Fa0/17, Fa0/18
Fa0/19, Fa0/20, Fa0/21, Fa0/22
Fa0/23
100 Students active Fa0/1
200 Teachers active Fa0/10
1002 fddi-default active
1003 token-ring-default active
1004 fddinet-default active
1005 trnet-default active
Hvilke PC'er kan der pinges imellem
- PC0 til PC1?
- PC0 til PC2?
- PC0 til PC3?
- PC1 til PC2?
- PC1 til PC3?
- PC2 til PC3?
Opgave 5: Opret et VLAN mere
- Opret VLAN 300 og kom fastethernet 0/5, 0/6 og 0/7 i VLAN 300. Gøres på begge switche
- Tilslut PC'er til alle porte i VLAN 300 og giv dem IP adresser i det logiske net 172.16.0.0/16
- Test det fungerer ved at pinge mellem PC'erne
- HUSK: Gem konfiguratioen og Packet tracer filen
Yderligere kommandoer
- show running-config
- show mac address-table