Difference between revisions of "Cisco Switches"

Jump to navigation Jump to search
2,473 bytes added ,  16:29, 6 September 2023
Untagged trunk ports
m (Protected "Cisco Switches" ([Edit=Allow only administrators] (indefinite) [Move=Allow only administrators] (indefinite)))
(Untagged trunk ports)
 
(2 intermediate revisions by the same user not shown)
Line 51: Line 51:
</nowiki>
</nowiki>


== Set IP address ==
So as to be able to telnet or SSH on (if supported) instead of using the serial console
<nowiki>
switch#conf t                                                             
Enter configuration commands, one per line.  End with CNTL/Z.           
switch(config)#int vlan1                                                 
switch(config-if)#ip address 192.168.1.2 255.255.255.0                   
switch(config-if)#exit                                                                                                                 
switch(config)#ip default-gateway 192.168.1.1                                   
switch(config)#exit                                                             
switch#</nowiki>                                 
                             
== Create VLANs ==
== Create VLANs ==
Looking at the vlan setup doesn't require enable but changing it does.
Looking at the vlan setup doesn't require enable but changing it does.
Line 88: Line 100:
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.
switch(config)#vlan 2
switch(config)#vlan 30
switch(config-vlan)#name dmz
switch(config-vlan)#name servers
switch(config-vlan)#exit
switch(config-vlan)#exit
switch(config)#exit
switch(config)#exit
switch#</nowiki>
switch#</nowiki>
=== Setup trunk to Switch 2 ===
<nowiki>
switch#conf t   
Enter configuration commands, one per line.  End with CNTL/Z.
switch(config)#int gi1/0/4
switch(config-if)#switchport trunk encapsulation dot1q
switch(config-if)#switchport mode trunk
switch(config-if)#switchport trunk allowed vlan remove 1-4094
switch(config-if)#switchport trunk allowed vlan add 30,40
switch(config-if)#exit
switch(config)#exit
switch#</nowiki>
=== Setup trunk to Switch 1 ===
<nowiki>
switch2#conf t 
Enter configuration commands, one per line.  End with CNTL/Z.
switch2(config)#int gi1/0/6
switch2(config-if)#switchport trunk encapsulation dot1q
switch2(config-if)#switchport mode trunk
switch2(config-if)#switchport trunk allowed vlan remove 1-4094
switch2(config-if)#switchport trunk allowed vlan add 30,40
switch2(config-if)#exit
switch2(config)#exit</nowiki>
This config can now be seen with sh run (only pasting the relevant section)
<nowiki>
switch2#sh run
!
interface GigabitEthernet1/0/1
switchport trunk encapsulation dot1q
switchport trunk allowed vlan 30,40
switchport mode trunk
!</nowiki>
=== Port with untagged and tagged traffic ===
This is when a port is used as an access port and also has vlans available. Typically necessary for setting up something with a single interface.
<nowiki>
!
interface GigabitEthernet1/0/2
description white wire
switchport trunk encapsulation dot1q
switchport trunk native vlan 40
switchport trunk allowed vlan 30,40,50
switchport mode trunk
!
</nowiki>
In the above config it is necessary to have the "native" vlan (the equivalent of an access vlan, "switchport access vlan 40") also an allowed vlan for the trunk port.

Navigation menu