You are on page 1of 4

Create a VLAN and assign it to an interface

Switch(config)#vlan 20
Switch(config-vlan)#name NomeVLAN
Switch(config-vlan)#exit
Switch(config)#interface gig x/y
Switch(config-if)#switchport access vlan 20 <-- Crea la VLAN se non è già stata
creata a priori

Switch(config)#interface gig x/y


Switch(config-if)#switchport mode trunk|access
Switch(config-if)#switchport trunk allowed vlan {add | except | remove} vlan-list
Switch(config-if)#switchport trunk allowed vlan {all | none}
Switch(config-if)#switchport trunk native vlan ID

Switch#show interface trunk

View the ports that are assigned to a VLAN


Switch#show vlan id 20

Displays the Trunking Native Mode VLAN on port Ethernet 1/18


Determine whether a switch is operating in trunking mode
Switch#show interface e1/18 switchport

Switched Virtual Interface


Switch(config)#feature interface-vlan
Switch(config)#interface vlan 100

Removes L2 switchport capability on a L3 switch (Routed Interface)


Switch(config)#interface fastethernet 0/1
Switch(config-if)# no switchport
Switch(config-if)# ip address X.X.X.X/X
Switch(config-if)# no shutdown

Displays the VLAN allowed on an interface


switch#show interface trunk

Displays IP information for an interface


switch#show ip interface [brief]

show mac address-table

VTP
Switch(config)#feature vtp
Switch(config)#vtp mode {server | client | transparent | off}
Switch(config)#vtp domain XXX
Switch(config)#vtp password XXX
Switch(config)#vtp version 2
Switch(config)#vtp pruning
Switch(config)#show vtp status

#CDP
sw1# show cdp neighbors [details]
#Abilita/disabilita CDP a livello di switch
sw1(config)# [no] cdp run

#Abilita/disabilita CDP sulla singola interfaccia


sw1(config)# interface FastEthernet 0/1
sw1(config-if)# [no] cdp enable

Routing Table
show ip route
show arp

#ip route IP MASK NEXT-HOP [AD]


sw1(config)# [no] ip route 10.10.30.0 255.255.255.0 10.10.10.2 95

#Default route
sw1(config)# ip route 0.0.0.0 0.0.0.0 10.10.10.2

sw1(config)# [no] ip default-gateway 10.10.0.2

Configure RIP
r1(config)# [no] router rip
r1(config-router)# [version 2]
r1(config-router)# network 10.0.0.0
r1(config-router)# no auto-summary

show ip rip database

debug ip rip
undebug all

EIGRP
r1(config)# feature eigrp
r1(config)# [no] router eigrp 100 <-- Autonomous System Number
r1(config-router)# no auto-summary
r1(config-router)# network 10.0.0.0 0.255.255.255

#EIGRP adjacencies
show ip eigrp neighbors

# Esclude una interfaccia dal routing


r1(config)# router eigrp 100
r1(config-router)# passive-interface FastEthernet 0/1

Configure EIGRP
feature eigrp
router eigrp 1 autonomous-system 1
interface Ethernet 1/1
ip address 10.1.1.1/24
ip router eigrp 1
no shutdown
#Distribute the default route 0.0.0.0/0
r1(config-router)# default-information originate

#show the router ID


show ip protocol

#Show the EIGRP Topology (including router-ID)


show ip eigrp topology

#Configure summarisation on some interfaces for specific networks


r1(config)# interface f0/0
r1(config-if)# ip summary-address rip|eigrp|ospf 10.1.0.0 255.255.0.0
r2(config)# interface f1/0
r2(config-if)# ip summary-address rip|eigrp|ospf 10.0.0.0 255.0.0.0

OSPF
r1(config)# feature ospf
r1(config)# [no] router ospf 1
r1(config-router)# [no] network 10.0.0.0 0.255.255.255 area 0
r1(config-router)# [no] network 10.1.0.0 0.255.255.255 area 1

# Verify the router's interfaces are in the correct areas


show ip ospf interface [brief]

show ip ospf database


show ip osfp neighbor

#Change interface cost


r1(config)# interface f3/0
r1(config-if)# ip ospf cost 1500

#Configure OSPF - Route the subnet but not form OSPF neighbors
feature ospf
interface vlan 10
ip address 10.1.1.1/24
no shutdown
ip router ospf 1
ip passive-interface ospf 1
router ospf 1

Spanning tree
#Modifica la port priority per una interfaccia
Switch(config-if)#spanning-tree vlan 20 port-priority 64

#Abilita Rapid PVST


spanning-tree mode rapid-pvst

show spanning-tree vlan 10

Port-channek
s2(config)# interface range f0/21-22
s2(config-if-range)# channel-group 2 mode active
s2(config-if-range)# exit
s2(config)# interface port-channel 2
s2(config-if)# description Link bla bla bla
s2(config-if)# switchport mode trunking
s2(config-if)# switchport trunk native vlan 199

s2#show etherchannel summary

You might also like