Diferència entre revisions de la pàgina «A5. Configuració»
(→Resum de comandes de configuració VLAN) |
|||
(Hi ha 12 revisions intermèdies del mateix usuari que no es mostren) | |||
Línia 1: | Línia 1: | ||
+ | torna [[ M7 - Planificació i administració de xarxes ]] | ||
+ | |||
== Resum de comandes de configuració VLAN == | == Resum de comandes de configuració VLAN == | ||
Línia 24: | Línia 26: | ||
<u>Mètode 2</u>--> | <u>Mètode 2</u>--> | ||
− | <pre> | + | <html><pre><code class="cisco"> |
Switch#conf t | Switch#conf t | ||
Enter configuration commands, one per line. End with CNTL/Z. | Enter configuration commands, one per line. End with CNTL/Z. | ||
Línia 34: | Línia 36: | ||
Switch(config-vlan)#name ADMINISTRACIO | Switch(config-vlan)#name ADMINISTRACIO | ||
Switch(config-vlan)#exit | Switch(config-vlan)#exit | ||
− | </pre> | + | </code></pre></html> |
Línia 40: | Línia 42: | ||
− | <pre> | + | <html><pre><code class="cisco"> |
Switch(config)#interface range fastEthernet 0/1-10 | Switch(config)#interface range fastEthernet 0/1-10 | ||
Switch(config-if-range)#switchport mode access | Switch(config-if-range)#switchport mode access | ||
Línia 53: | Línia 55: | ||
Switch(config-if)#switchport access vlan 4 | Switch(config-if)#switchport access vlan 4 | ||
Switch(config-if)#ex | Switch(config-if)#ex | ||
+ | </code></pre></html> | ||
+ | |||
+ | |||
+ | <u>Configuració ports troncals</u> | ||
+ | |||
+ | <html><pre><code class="cisco"> | ||
Switch(config)#interface range gigabitEthernet 0/1-2 | Switch(config)#interface range gigabitEthernet 0/1-2 | ||
Switch(config-if-range)#switchport mode trunk | Switch(config-if-range)#switchport mode trunk | ||
Línia 60: | Línia 68: | ||
Building configuration... | Building configuration... | ||
[OK] | [OK] | ||
− | </pre> | + | </code></pre></html> |
Per modificar la configuració dels ports troncals | Per modificar la configuració dels ports troncals | ||
− | <pre> | + | <html><pre><code class="cisco"> |
Switch(config)#interface range gigabitEthernet 0/1-2 | Switch(config)#interface range gigabitEthernet 0/1-2 | ||
Switch(config-if-range)#switchport trunk allowed vlan ? | Switch(config-if-range)#switchport trunk allowed vlan ? | ||
Línia 80: | Línia 88: | ||
Building configuration... | Building configuration... | ||
[OK] | [OK] | ||
− | </pre> | + | </code></pre></html> |
− | Per | + | Per assiganr adreça IP a la VLAN (Opcional) |
− | <pre> | + | <html><pre><code class="cisco"> |
Switch(config)#interface vlan 4 | Switch(config)#interface vlan 4 | ||
Switch(config-if)# | Switch(config-if)# | ||
Línia 95: | Línia 103: | ||
Switch(config-if)#no shutdown | Switch(config-if)#no shutdown | ||
Switch(config-if)#do wr | Switch(config-if)#do wr | ||
− | </pre> | + | </code></pre></html> |
+ | |||
+ | == Resum de comandes de configuració Router subinterfícies (protocol 802.1Q) == | ||
+ | |||
+ | <html><pre><code class=""> | ||
+ | Router(config)#interface gigabitEthernet 0/0.2 | ||
+ | Router(config-subif)# | ||
+ | %LINK-5-CHANGED: Interface GigabitEthernet0/0.2, changed state to up | ||
+ | |||
+ | %LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/0.2, changed state to up | ||
+ | |||
+ | Router(config-subif)#encapsulation dot1Q 2 | ||
+ | Router(config-subif)#ip address 192.168.2.1 255.255.255.0 | ||
+ | Router(config-subif)#no shutdown | ||
+ | Router(config-subif)#do wr | ||
+ | Building configuration... | ||
+ | [OK] | ||
+ | Router(config-subif)#exit | ||
+ | Router(config)#interface gigabitEthernet 0/0.3 | ||
+ | Router(config-subif)#encapsulation dot1Q 3 | ||
+ | Router(config-subif)#ip address 192.168.3.1 255.255.255.0 | ||
+ | Router(config-subif)#no shutdown | ||
+ | Router(config-subif)#ex | ||
+ | Router(config)#interface gigabitEthernet 0/0.4 | ||
+ | Router(config-subif)#encapsulation dot1Q 4 | ||
+ | Router(config-subif)#ip address 192.168.4.1 255.255.255.0 | ||
+ | Router(config-subif)#no shutdown | ||
+ | Router(config-subif)#do wr | ||
+ | Building configuration... | ||
+ | [OK] | ||
+ | </code></pre></html> | ||
+ | |||
+ | |||
+ | Es pot comprovar la configuració | ||
+ | |||
+ | <html><pre><code class=""> | ||
+ | Router#sh ip int brief | ||
+ | Interface IP-Address OK? Method Status Protocol | ||
+ | GigabitEthernet0/0 unassigned YES unset up up | ||
+ | GigabitEthernet0/0.2 192.168.2.1 YES manual up up | ||
+ | GigabitEthernet0/0.3 192.168.3.1 YES manual up up | ||
+ | GigabitEthernet0/0.4 192.168.4.1 YES manual up up | ||
+ | GigabitEthernet0/1 172.16.0.1 YES manual up up | ||
+ | Vlan1 unassigned YES unset administratively down down | ||
+ | </code></pre></html> | ||
== Resum de comandes de configuració VTP == | == Resum de comandes de configuració VTP == | ||
Línia 138: | Línia 190: | ||
<code>Switch(config-if)#switchport mode trunk</code> | <code>Switch(config-if)#switchport mode trunk</code> | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
Revisió de 02:56, 21 ago 2024
torna M7 - Planificació i administració de xarxes
Contingut
Resum de comandes de configuració VLAN
Per arribar a configurar que un enllaç és per a una VLAN
Switch#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#vlan 2
Switch(config-vlan)#name VLAN2
Switch(config-vlan)#vlan 3
Switch(config-vlan)#name VLAN3
Switch(config-vlan)#vlan 4
Switch(config-vlan)#name ADMINISTRACIO
Switch(config-vlan)#exit
Assignar un rang de ports a una VLAN
Switch(config)#interface range fastEthernet 0/1-10
Switch(config-if-range)#switchport mode access
Switch(config-if-range)#switchport access vlan 2
Switch(config-if-range)#exi
Switch(config)#interface range fastEthernet 0/11-23
Switch(config-if-range)#switchport mode access
Switch(config-if-range)#switchport access vlan 3
Switch(config-if-range)#ex
Switch(config)#interface fastEthernet 0/24
Switch(config-if)#switchport mode access
Switch(config-if)#switchport access vlan 4
Switch(config-if)#ex
Configuració ports troncals
Switch(config)#interface range gigabitEthernet 0/1-2
Switch(config-if-range)#switchport mode trunk
Switch(config-if-range)#switchport trunk allowed vlan 2,3-4
Switch(config-if-range)#switchport trunk native vlan 99
Switch(config-if-range)#do wr
Building configuration...
[OK]
Per modificar la configuració dels ports troncals
Switch(config)#interface range gigabitEthernet 0/1-2
Switch(config-if-range)#switchport trunk allowed vlan ?
WORD VLAN IDs of the allowed VLANs when this port is in trunking mode
add add VLANs to the current list
all all VLANs
except all VLANs except the following
none no VLANs
remove remove VLANs from the current list
Switch(config-if-range)#switchport trunk allowed vlan remove ?
<1-4094> VLAN ID of a allowed VLAN when this port is in trunking mode
Switch(config-if-range)#switchport trunk allowed vlan remove 2
Switch(config-if-range)#switchport trunk allowed vlan add 2
Switch(config-if-range)#do wr
Building configuration...
[OK]
Per assiganr adreça IP a la VLAN (Opcional)
Switch(config)#interface vlan 4
Switch(config-if)#
%LINK-5-CHANGED: Interface Vlan4, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan4, changed state to up
Switch(config-if)#ip address 192.168.4.100 255.255.255.0
Switch(config-if)#no shutdown
Switch(config-if)#do wr
Resum de comandes de configuració Router subinterfícies (protocol 802.1Q)
Router(config)#interface gigabitEthernet 0/0.2
Router(config-subif)#
%LINK-5-CHANGED: Interface GigabitEthernet0/0.2, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/0.2, changed state to up
Router(config-subif)#encapsulation dot1Q 2
Router(config-subif)#ip address 192.168.2.1 255.255.255.0
Router(config-subif)#no shutdown
Router(config-subif)#do wr
Building configuration...
[OK]
Router(config-subif)#exit
Router(config)#interface gigabitEthernet 0/0.3
Router(config-subif)#encapsulation dot1Q 3
Router(config-subif)#ip address 192.168.3.1 255.255.255.0
Router(config-subif)#no shutdown
Router(config-subif)#ex
Router(config)#interface gigabitEthernet 0/0.4
Router(config-subif)#encapsulation dot1Q 4
Router(config-subif)#ip address 192.168.4.1 255.255.255.0
Router(config-subif)#no shutdown
Router(config-subif)#do wr
Building configuration...
[OK]
Es pot comprovar la configuració
Router#sh ip int brief
Interface IP-Address OK? Method Status Protocol
GigabitEthernet0/0 unassigned YES unset up up
GigabitEthernet0/0.2 192.168.2.1 YES manual up up
GigabitEthernet0/0.3 192.168.3.1 YES manual up up
GigabitEthernet0/0.4 192.168.4.1 YES manual up up
GigabitEthernet0/1 172.16.0.1 YES manual up up
Vlan1 unassigned YES unset administratively down down
Resum de comandes de configuració VTP
Mètode 1 (Antic)
Switch#vlan database
Switch(vlan)#vtp domain domain-name
Switch(vlan)#vtp {client | server | transparent}
Switch(vlan)#vtp pruning
Mètode 2
Switch(config)#vtp ?
Switch(config)#vtp domain marianao
Switch(config)#vtp password 1234
Posar les interfases que connecten els enllaços troncals
Switch(config)#interface FastEthernet 0/1
Switch(config-if)#switchport mode trunk
Switch(config-if)#switchport trunk encapsulation dot1q
// si es preferix le protocol IEEE 801.1Q
Als clients
Switch(config)#vtp domain marianao
Switch(config)#vtp mode client
Switch(config)#vtp password 1234
Switch(config)#interface FastEthernet 0/1
Switch(config-if)#switchport mode trunk
CheatSheet
Totes les comandes resumides en un únic document: