CCNP Switch Moje
CCNP Switch Moje
CCNP Switch Moje
> enable
# conf t
# no ip domain lookup
# sh vlan br
# interface range fa 0/1-24
# no vlan 2-999 jesli takie byly
# shutdown
# vtp mode transparent
>enable
# conf t
# hostname SWITH1
# interface vlan 1 vlan 1 is
management vlan
# ip add 10.1.1.101 255.255.255.0 config IP for
man.vlan
# no sh
Conf vtp
# sh vtp status VLAN information is not propagated
until a domain name is specified and
# vtp domain andrelab trunks are set up between the device
# vtp version 2
All switches in the VTP domain must run
sw1> vtp mode server the same VTP version.
sw2> vtp mode client
Conf trunks
command lists the configured mode of
# sh interacs switchport each port in detail
# sh interace trunk
Conf switchports
# interface fa 0/6
# switchport mode ?
# switchport mode access
Vlans
Before configuring VLANS make sure VTP configuration within domain LAN 1 is the management VLAN by
is the same default. By default, all ports are set to
# sh vtp status dynamic mode and their access
VLAN is set to 1
assign vlan 100 to fa 0/6 There is no need to create a VLAN 1,
# int fa 0/6 assign ports to it, or to set the mode of
# switchport access vlan 100 each port
-----------------------------------
Now configure LACP
-------------------
# interface range fa 0/11-12
again , remember you are setting
# channel-group 2 mode active up
# interface port-channel 2
# switchport trunk encapsulatin dot1q 1 interface range as channel-gr
# switchport mode trunk 2 channel gr as switchport mode
trunk
# show etherchannel summary
# show etherchannel 2 detail
# show etherchannel port-channel
-----------------------------------
Now configure L3 etherchannel
# interface range fa 0/11-12
# no switchport WHY? Because L3 , pamietaj o tym
no switchport bo switchport to L2 -------------------
# channel-group 3 mode desirable
# interface port-channel 3
# ip address 10.0.0.1 255.255.255.0
Load-balancing
# show etherchannel load-balance By default, source MAC address
Some older platforms, like Catalyst 2950 and Catalyst 3550 switches, may not addresses,
support all of these methods from next column !
source IP address,
destination IP address,
STP
Display default spanning tree info for all switches By default, spanning tree runs on
# sh spanning-tree every port. When a new
link becomes active, the port goes
through the
IEEE 802.1D spanning tree listening
and
learning
states before transitioning to
forwarding state.
During this
switch root in our STP topology period, the switch discovers if it is
connected to another switch or an
end-
user device
Spanning tree operation is based on
the MAC address
es of the switches.
# int fa 0/12
# spanning-tree port-priority 112
. -------------------
Another way of changing which port
# show spanning-tree becomes the root is to modify the port
costs
cost of 4 gigabyt
cost of 19 fastethernet
cost of 100 10base Ethernet port
lower better !
-------------------
RSTP (rapid spanning tree
protocol), which greatly reduces the
----------------------------------- time for a port
check current cost with simple show spanning-tree to transition to forwarding
# sh spanning-tree state
while s
till preventing
# interface fa 0/24 bridging loops.
# spanning-tree cost 10 Cisco
----------------------------------- -proprietary per
-VLAN rapid spanning tree (PVRST+)
combines the functionality of
# spannig-tree mode mst RSTP and PVST.
You will configure a group of switches and a router for the International Travel Agency. The
network includes two distribution switches, DLS1 and DLS2, and two access layer switches,
ALS1 and ALS2. External router R1 and DLS1 provide inter-VLAN routing. Design the addressing
scheme using the address space 172.16.0.0/16 range. You can subnet it any way you want,
although it is recommended to use /24 subnets for simplicity.
1. Disable the links between the access layer switches. czy to ma byc zrobione na
wszystkich linkach ? NIE ! Tylko fa0/11 & fa0/12
# interface range fa 0/11-12 fa 0/7-12
# shutdown
2. Place all switches in the VTP domain CISCO. Make DLS1 the VTP server and all other
switches VTP clients.
# show vtp status
# vtp version 2
# vtp domain CISCO
# vtp mode server | client
# show vtp status
3. On DLS1, create the VLANs shown in the VLAN table and assign the names given. For
subnet planning, allocate a subnet for each VLAN.
VLANS are created on switches first, when you create a VLAN on a switch you don't need a default gateway or ip address
because the VLANS are local to the switch.
If you want intervlan routing you need a router. You then setup a trunking port between the switch and router (ISL, 802.1Q).
Because we have trunk now between switch and router we need to configure sub-interfaces with default gateways and subnet
masks for each vlan ,
ON-ROUTER:
# Interface FastEthernet0/0.1
# Encapsulation dot1q 10 (10 represent VLAN ID 10 )
# IP address 10.1.1.1 255.255.255.0
IF you are using L3-SWITH you can create VLAN interface with default gateway but you need to enable IP-routing on your
Poprostu create VLANs & VLANs names, subnet planning only so just keep it in mind:
# vlan 10
# name RED
# vlan 20
# name BLUE
# vlan 30
# name ORANGE
# vlan 40
# name GREEN
4. Configure DLS1 as the primary spanning-tree root bridge for all VLANs. Configure DLS2
as the backup root bridge for all VLANs.
DLS1> spanning-tree vlan 1 root primary
!!! jesli to nie zmienia dla innych VLANow to zrob #vlan 1-4096 root primary
DLS2> spanning-tree vlan 1 root secondary
5. Configure Fa0/12 between DLS1 and DLS2 as a Layer 3 link and assign a subnet to it.
DLS1> interface fa 0/12
DLS1> no switchport zrobione na L3 witchu
DLS1> ip add 172.16.100.10 255.255.255.0
DLS1> no sh
7. Configure the Fa0/11 link between DLS1 and DLS2 as an ISL trunk.
DLS1> int fa 0/11
DLS1> switchport trunk encapsulation ? dot1q | isl
DLS1> switchport mode trunk
DLS1> no sh
9. Bind together the links from DLS1 to each access switch together in an EtherChannel.
DLS1> in range fa 0/7-10
DLS1> channel-group 1 mode desirable jak dalej nie dziala to pamietaj o trunku
( ustawiales go w kroku poprzednim )
12.Create an 802.1Q trunk link between R1 and ALS2. Allow only VLANs 10 and 40 to pass
through the trunk.
ALS2> int fa0/1
ALS2> switchport trunk encapsulation dot1q
ALS2> switchport mode trunk
ALS2> switchport trunk allowed vlan 10,40
14.Create an SVI on DLS1 in VLANs 20, 30, and 40. Create an SVI on DLS2 in VLAN 10, an
SVI on ALS1 in VLAN 30, and an SVI on ALS2 in VLAN 40.
SVI - switched virtual interface is configured after VTP trunking has been configured for
the switches, its configured on distribution switch to route between these VLANs ,
route czyli L3 interface !
DLS1> interface vlan 20
DLS1> ip add 172.16.20.10 255.255.255.0
DLS1> no sh
15.Enable IP routing on DLS1. On R1 and DLS1, configure EIGRP for the whole major
network (172.16.0.0/16) and disable automatic summarization.
DLS1>iprouting you need to allow switch to act like L3 device to route
between this vlan you set IPs , routing on now routing protocol, eigrp
DLS1> router eigrp 1
DLS1> no auto-summary
DLS1> network 172.16.0.0
DLS1> interface range fa 0/7-8 Configure trunks & ether channels between
DLS1> switchport trunk encapsulation dot1q switches.....
DLS1> switchport mode trunk
DLS1> channel-group 1 mode desirable
ten sam switch nastepny port channel
DLS1> interface range fa 0/11-12
DLS1> switchport trunk encapsulation dot1q
DLS1> switchport mode trunk
DLS1> channel-group 2 mode desirable
ostatni port channel na tym switchu
DLS1> interface range fa 0/13-14
DLS1> switchport trunk encapsulation dot1q
DLS1> switchport mode trunk
DLS1> channel-group 3 mode desirable
takie same port channel z tymi samymi numerami i interface
range na wszystkich switchach
DLS2> interface range fa 0/7-8
DLS2> switchport trunk encapsulation dot1q
DLS2> switchport mode trunk
DLS2> channel-group 1 mode desirable
ten sam switch nastepny port channel
DLS2> interface range fa 0/11-12
DLS2> switchport trunk encapsulation dot1q
DLS2> switchport mode trunk
DLS2> channel-group 2 mode desirable
ostatni port channel na tym switchu
DLS2> interface range fa 0/13-14
DLS2> switchport trunk encapsulation dot1q
DLS2> switchport mode trunk
DLS2> channel-group 3 mode desirable
Thats why we have SVIs switch virtual interface , with SVI switch will use virtual Layer 3 interface to route traffic to other Layer
3 interface thus eliminating the need for a physical router.
You have SVI on switches (Layer 3 and Layer 2) but switch should have a routing engine, ie. it should be a L3 switch.
There is one-to-one mapping between a VLAN and SVI, thus only a single SVI can be mapped to a VLAN. In default setting, an
SVI is created for the default VLAN (VLAN1) to permit remote switch administration.
In most typical designs we have the default gateway for the hosts pointing to the switches SVI, then the switch will route the
packets to rest of the Layer 3 domain.
Note: An SVI cannot be activated unless the VLAN itself is created and at least one physical port is associated and active in that VLAN. Unless the
VLAN is created there will be no spanning tree instance running hence the line protocol will be down for the SVI VLAN.
# show standby
TESTING ? Interface range fa0/7-8 shutdown a twoj drugi
switch staje sie ACTIVE dla VLANs ktore mial switch z
ktorego zabiles interfaces
# show standby brief && # sh IP route
HSRP _ v2
Implement IP SLAs - monito various network performance characteristics
SLA - IP service level agreements allow
ALS1 # hostname ALS1 us to monitor network performance between
ALS1 # enable secret cisco swithes and routers or to remote IP device.
ALS1 # line vty 0 15 1. standard settings
ALS1 # password cisco
ALS1 # login
same settings for ALS2
ALS1 # interface vlan 1 2. management IPs
ALS1 # ip address 172.16.1.101 255.255.255.0
ALS1 # no sh
DLS2> ip routing
DLS2> intarface vlan 1
DLS2> standby 1 ip 172.16.1.1
DLS2> standby 1 preemtp
DLS2> standby 1 priority 100 now configure SVIs & HSRP
DLS1> interface vlan 100
DLS1> ip add 172.16.100.3 255.255.255.0
DLS1> standby 1 ip 172.16.100.1
DLS1> standby 1 preempt
DLS1> standby 1 priority 150
# show ip route
NOW jesli wszystko dobrze jest zrobione i dziala dopiero teraz PORT SECURITY
# show port-security Protect against MAC flooding or
# show port-security interface fa0/15 spoofing
ALS2> interface range fa 0/15-20
ALS2> switchport port-security VLAN 200 must allow MAC
addresses assigned to port to change
because its students vlan, MAC
ALS1> interface range fa0/15-20 address is allowed at a given time.
ALS1> switchport port-security poprostu enable
port-sec VLAN 100 use sticky learning czyli
ALS1> switchport port-security maximum 2 enable MAC learned on port is added to
maxiumum of 2 MAC addresses learned on given port configuration on switch as if MAC
, because we assume admins use workstations and dont were configured using switchport
change MAC addresses often..... port-security mac-address
ALS1> switchport port-security mac-address sticky
sticky command allow the two MAC addresses to be learned
dynamicaly
# show port-security interface fa0/15
- - - - - - - - - - - - - - -
ALS1> username andre password 0 cisco ---------------
ALS1> username andrzej password 0 cisco
ALS1> aaa new-model turn AAA authentication ON
ALS1> aaa authentication dot1x default local AAA authentication requires user to
authentication of users and its passwords from local be identified before allowing him to
database access network .
ALS1> dot1x system-auth-control activates global
support for 802.1x authentication
ALS1> int range fa0/15-20 Przypomnij sobie RADIUS server &
ALS1> dot1x port-control auto local konfigurujemy LOCAL database for authentication
nasz VLAN 100 staff VLAN zeby uzywaly authentication
dot1x, auto znaczy ze port begins in unauthorised state
and allows negotiations between client & server to
authenticate user.
# show dot1x interface
SECURING SPANNING-TREE-PROTOCOL
# show spanning-tree vlan 1
# show interfaces trunk
Why setting up spanning-tree root?
DLS1> spanning-tree vlan 1,100 root primary TO optimize paths throughout the L2
DLS1> spanning-tree vlan 200 root secondary network...
# show spanning-tree
Now assign interface fa 0/6 for isolated vlan 151 switchport mode private-vlan host
DLS2 # interface fa 0/6 command sets the mode on
DLS2 # switchport mode private-vlan host the interface and the switchport private-
DLS2 # switchport private-vlan host-association 150 151 vlan host-association primary-vlan-id
secondary-vlan-id
Now assign interface fa 0/18-20 for isolated vlan 152 command assigns the appropriate VLANs
DLS2 # interface range fa 0/18-20 to the interface.
DLS2 # switchport mode private-vlan host
DLS2 # switchport private-vlan host-association 150 152
DLS1# access-list 100 permit tcp 172.16.200.0 0.0.0.255 Router ACL prevents traffic from
172.16.100.0 0.0.0.255 established student VLAN to staff VLAN,
DLS1# access-list 100 permit icmp 172.16.200.0 0.0.0.255 Vlan ACL for temporary staff, so it
172.16.100.0 0.0.0.255 echo-reply allows you set up machine on staff vlan
but is issolated from the rest staff
DLS1# access-list 100 deny ip 172.16.200.0 0.0.0.255 172.16.100.0 machines.
0.0.0.255
DLS1# access-list 100 permit ip any any
# show access-lists
# show ip interface vlan 100
IP telephony support
Wszystkie standardowe ustawienia jak wczesniejsze laby: In this lab, you configure the quality of
service (QoS) on the access and
1. passwords
distribution layer switches so that they
# hostname ALS1 a-jak-access
# enable secret cisco
trust the class of service (CoS) mapping
# line vty 0 15 provided by the IP phone through Cisco
# login Discovery Protocol (CDP). To ensure
2. vlan 1 with ip redundancy for the phones and user end
# inetrface vlan 150 stations, you will use Hot Standby Router
# ip add 172.16.1.101 255.255.255.0 Protocol (HSRP) on the distribution layer
# no sh
switches.
3. default gaeteway
# ip default-gateway 172.16.1.1
# interface vlan 10
# ip add 172.16.10.3 255.255.255.0
# standby 1 ip 172.16.10.1
# standby 1 preempt
# standby 1 priority 150
.... and same for vlan 30 on DLS1 and then on DLS2 with different
IPs and priority !
6. VOICE VLAN
# interface range fa 0/18-20
# switchport mode access
# switchport access vlan 10
# switchport voice vlan 20
# auto qos voip cisco-phone