enable
conf t
hostname   BRANCH
enable secret class
line con 0
password cisco
login
logging sync
exec-timeout 0 0
line vty 0 4
password cisco
login
exit
no ip domain-lookup
banner motd #authorized acces only !#
service password-encryption



enable
conf t
hostname ASW2
enable secret class
line con 0
password cisco
login
logging sync
exec-timeout 0 0
line vty 0 15
password cisco
login
no ip domain-lookup
banner motd # AUTHORIZED ACCESS ONLY! #




show ip interface brief


conf t
interface range fa0/1-24
shutdown
interface range Gi1/1-2
shutdown


vlan   10
name   RESS-HUM
vlan   20
name   FINANCE
vlan   30
name   ING
vlan   40
name   STORAGE
vlan   50
name   WIFI
vlan   99
name   Gestion/Natif


switchport mode access
switchport port-security   maximum 1
switchport port-security violation shutdown
switchport port-security mac-address sticky
switchport port-security

interface fa0/2
switchport mode access
switchport access vlan 99
no shutdown
interface fa0/3
switchport mode access
switchport access vlan 40
no shutdown


interface fa0/10
switchport mode access
switchport access vlan 10
no shutdown
interface fa0/15
switchport mode access
switchport access vlan 20
no shutdown
interface fa0/20
switchport mode access
switchport access vlan 30
no shutdown



interface Vlan99
ip address 10.13.4.2 255.255.255.240
no shutdown
ip default-gateway 10.13.4.1

interface Vlan99
ip address 10.13.4.3 255.255.255.240
no shutdown
ip default-gateway 10.13.4.1

interface Vlan99
ip address 10.13.4.4 255.255.255.240
no shutdown
ip default-gateway 10.13.4.1

interface Vlan99
ip address 10.13.4.5 255.255.255.240
no shutdown
ip default-gateway 10.13.4.1

interface Vlan99
ip address 10.13.4.6 255.255.255.240
no shutdown
ip default-gateway 10.13.4.1




interface Gi1/1
switchport trunk native vlan 99
switchport trunk allowed vlan 10,20,30,40,50,99
switchport mode trunk
no shutdown

interface   Gi1/2
switchport trunk native vlan 99
switchport trunk allowed vlan 10,20,30,40,50,99
switchport mode trunk
no shutdown


interface FastEthernet0/1
switchport trunk native vlan 99
switchport trunk allowed vlan 10,20,30,40,50,99
switchport mode trunk
no shutdown

interface FastEthernet0/2
switchport trunk native vlan 99
switchport trunk allowed vlan 10,20,30,40,50,99
switchport mode trunk
no shutdown




switchport   mode access
switchport   port-security maximum 1
switchport   port-security violation shutdown
switchport   port-security mac-address sticky
switchport   port-security




interface FastEthernet0/0
no ip address
no shutdown
interface FastEthernet0/0.10
encapsulation dot1Q 10
ip address 10.13.0.1 255.255.255.0

interface FastEthernet0/0.20
encapsulation dot1Q 20
ip address 10.13.1.1 255.255.255.0

interface FastEthernet0/0.30
encapsulation dot1Q 30
ip address 10.13.2.1 255.255.255.0

interface FastEthernet0/0.40
encapsulation dot1Q 40
ip address 10.13.4.17 255.255.255.248

interface FastEthernet0/0.50
encapsulation dot1Q 50
ip address 10.13.3.1 255.255.255.0

interface FastEthernet0/0.99
encapsulation dot1Q 99
ip address 10.13.4.1 255.255.255.240


32768

switch(config)#spanning-tree   mode   rapid-pvst
switch(config)#spanning-tree   vlan   <num> priority <num>
switch(config)#spanning-tree   vlan   <num> root primary
switch(config)#spanning-tree   vlan   <num> root secondary
interface range fa 0/10 - 24
switchport mode access
spanning-tree portfast


show spanning-tree summary


vtp mode server
vtp domain BRANCH
vtp password


show vtp status


vtp mode client
vtp domain BRANCH
vtp password


show vtp status

Cmd

  • 1.
    enable conf t hostname BRANCH enable secret class line con 0 password cisco login logging sync exec-timeout 0 0 line vty 0 4 password cisco login exit no ip domain-lookup banner motd #authorized acces only !# service password-encryption enable conf t hostname ASW2 enable secret class line con 0 password cisco login logging sync exec-timeout 0 0 line vty 0 15 password cisco login no ip domain-lookup banner motd # AUTHORIZED ACCESS ONLY! # show ip interface brief conf t interface range fa0/1-24 shutdown interface range Gi1/1-2 shutdown vlan 10 name RESS-HUM vlan 20 name FINANCE vlan 30 name ING vlan 40 name STORAGE vlan 50 name WIFI vlan 99 name Gestion/Natif switchport mode access switchport port-security maximum 1
  • 2.
    switchport port-security violationshutdown switchport port-security mac-address sticky switchport port-security interface fa0/2 switchport mode access switchport access vlan 99 no shutdown interface fa0/3 switchport mode access switchport access vlan 40 no shutdown interface fa0/10 switchport mode access switchport access vlan 10 no shutdown interface fa0/15 switchport mode access switchport access vlan 20 no shutdown interface fa0/20 switchport mode access switchport access vlan 30 no shutdown interface Vlan99 ip address 10.13.4.2 255.255.255.240 no shutdown ip default-gateway 10.13.4.1 interface Vlan99 ip address 10.13.4.3 255.255.255.240 no shutdown ip default-gateway 10.13.4.1 interface Vlan99 ip address 10.13.4.4 255.255.255.240 no shutdown ip default-gateway 10.13.4.1 interface Vlan99 ip address 10.13.4.5 255.255.255.240 no shutdown ip default-gateway 10.13.4.1 interface Vlan99 ip address 10.13.4.6 255.255.255.240 no shutdown ip default-gateway 10.13.4.1 interface Gi1/1 switchport trunk native vlan 99 switchport trunk allowed vlan 10,20,30,40,50,99 switchport mode trunk no shutdown interface Gi1/2
  • 3.
    switchport trunk nativevlan 99 switchport trunk allowed vlan 10,20,30,40,50,99 switchport mode trunk no shutdown interface FastEthernet0/1 switchport trunk native vlan 99 switchport trunk allowed vlan 10,20,30,40,50,99 switchport mode trunk no shutdown interface FastEthernet0/2 switchport trunk native vlan 99 switchport trunk allowed vlan 10,20,30,40,50,99 switchport mode trunk no shutdown switchport mode access switchport port-security maximum 1 switchport port-security violation shutdown switchport port-security mac-address sticky switchport port-security interface FastEthernet0/0 no ip address no shutdown interface FastEthernet0/0.10 encapsulation dot1Q 10 ip address 10.13.0.1 255.255.255.0 interface FastEthernet0/0.20 encapsulation dot1Q 20 ip address 10.13.1.1 255.255.255.0 interface FastEthernet0/0.30 encapsulation dot1Q 30 ip address 10.13.2.1 255.255.255.0 interface FastEthernet0/0.40 encapsulation dot1Q 40 ip address 10.13.4.17 255.255.255.248 interface FastEthernet0/0.50 encapsulation dot1Q 50 ip address 10.13.3.1 255.255.255.0 interface FastEthernet0/0.99 encapsulation dot1Q 99 ip address 10.13.4.1 255.255.255.240 32768 switch(config)#spanning-tree mode rapid-pvst switch(config)#spanning-tree vlan <num> priority <num> switch(config)#spanning-tree vlan <num> root primary switch(config)#spanning-tree vlan <num> root secondary
  • 4.
    interface range fa0/10 - 24 switchport mode access spanning-tree portfast show spanning-tree summary vtp mode server vtp domain BRANCH vtp password show vtp status vtp mode client vtp domain BRANCH vtp password show vtp status