Professional Documents
Culture Documents
4
4
4
- Switch1 is the root for vlan 1 and 10 and is a backup for vlan 20.
- Switch2 is the root for vlan 20 and backup for vlan 1 and 10.
1) Set Switch1 to be the root for vlan 10
S1(config)#spanning-tree vlan 10 priority 0
**Remember, Priority # = prioritySetting# + VLAN#... so priority 0 on vlan10 =
priority10
2) Set Switch2 to be the root for vlan 20
S2(config)#spanning-tree vlan 20 priority 0
3) Set Switch1 a backup for vlan 20
S1(config)#spanning-tree vlan 20 priority 4096 (can't use 1 - increments)
4) Set Switch2 a backup for vlan 1 and 10
S2(config)#spanning-tree vlan 1 priority 4096
S2(config)#spanning-tree vlan 10 priority 4096
==Result==
Switch1(vlan1)= Desg, Desg, Desg, Desg
Switch1(vlan10)= Desg, Desg, Desg, Desg
Switch1(vlan20)= Root, Altn (BLK), Desg, Desg
Switch2(vlan1)= Root, Altn (BLK), Desg, Desg
Switch2(vlan10)= Root, Altn (BLK), Desg, Desg
Switch2(vlan20)= Desg, Desg, Desg, Desg
**Management traffic such as cdp, and lldp are still transmitted and received on
blocked ports (i.e. ports that are discarding)
Link Aggregation / Etherchannel (for when there are 2 links between switches - does
not work if there is only 1 link)
- When there is too much traffic from Switch2 -> Switch1 or vice versa, we want to
make ST see 2 physical ports as a single port and doesn't block either of the ports
Switch1 =G0/1= Switch2
Switch1 =G0/0 = Switch2
ex. for vlan20, G0/0 is Root/FWD but G0/1 is Altn/BLK
==Set Switch1's G0/0 and G0/1 to be link aggregation or etherchannel==
Switch1#conf t
Switch1(config)#int range g0/0-1
Switch1(config-if-range)#shutdown
Switch1(config-if-range)#switchport trunk encapsulation dot1q
Switch1(config-if-range)#switchport mode trunk
Switch1(config-if-range)#channel-group 1 mode active (ex. using random channel 1
and using LACP (active))
*Note: LACP is industry standard, PAgP is Cisco proprietary
*Note: Do not set both side to passive (waiting for the other side to become
active), one side or both sides must be active
==Set Switch1's ST on G0/0 and G0/1 to be P2p==
*Recall, P2p is like full-duplex to Shared being half-duplex (uses timers,
blocking, listening, learning and forwarding)
Switch1(config)#int range g0/0-1
Switch1(config-if-range)#spanning-tree link-type point-to-point
==Make sure it is set properly by viewing this command==
Switch1#show etherchannel summary
Switch1#show etherchannel port-channel
*Note: Switch1or2#sh spanning-tree vlan 1/10/20, all ports are now FWD in Desg
*Note: cost = 3 instead of 4 because it is the better path
Configure interface fa0/23 and fa0/24 as 802.1Q trunk links between Switch1 and
Switch2. Configure interfaces individually (fa0/23 and then fa0/24)
Set the trunk encapsulation to dot1q and then manually configure the port as a
trunk port
Configure a Layer 2 EtherChannel between Switch1 and Switch2 on the inter-switch
links. (fa0/23 and fa0/24)
Use Port-Channel no 12 (Tip: This is number twelve)
These links should not use dynamic EtherChannel negotiation.
Switch2> en
Switch2# conf t
Enter configuration commands, one per line. End with CNTL/Z.
Switch2(config)# int f0/23
Switch2(config-if)# switchport trunk encapsulation dot1q
Switch2(config-if)# switchport mode trunk
Switch2(config-if)# int f0/24
Switch2(config-if)# switchport trunk encapsulation dot1q
Switch2(config-if)# switchport mode trunk
Switch2(config-if)# int f0/23
Switch2(config-if)# channel-group 12 mode on
Switch2(config-if)# int f0/24
Switch2(config-if)# channel-group 12 mode on
Switch1> en
Switch1# conf t
Enter configuration commands, one per line. End with CNTL/Z.
Switch1(config)# int f0/23
Switch1(config-if)# switchport trunk encapsulation dot1q
Switch1(config-if)# switchport mode trunk
Switch1(config-if)# int f0/24
Switch1(config-if)# switchport trunk encapsulation dot1q
Switch1(config-if)# switchport mode trunk
Switch1(config-if)# int f0/23
Switch1(config-if)# channel-protocol lacp
Switch1(config-if)# channel-group 12 mode active
Switch1(config-if)# int f0/24
Switch1(config-if)# channel-protocol lacp
Switch1(config-if)# channel-group 12 mode active
Switch1> en
Switch1# conf t
Enter configuration commands, one per line. End with CNTL/Z.
Switch1(config)# interface port-channel 12
Switch1(config-if)# no switchport
Switch1(config-if)# ip address 172.16.10.1 255.255.255.0
Switch1(config-if)# int f0/23
Switch1(config-if)# no switchport
Switch1(config-if)# channel-group 12 mode on
Switch1(config-if)# int f0/24
Switch1(config-if)# no switchport
Switch1(config-if)# channel-group 12 mode on
~The "no switchport" command puts the interface in L3 mode (known as "routed port")
and makes it operate more like a "router interface" rather than a "switch port".
_____________________________________________
==Enable eigrp==
Switch1#conf t
Switch(config)#router eigrp 1
Switch(config-router)#network 0.0.0.0
==Configure Layer 3 switch Switch1 to allow routes advertised to Layer 3 switch
Switch2 and vice versa==
Switch1#conf t
Switch1(config)#router eigrp 100
Switch1(config-router)#network 0.0.0.0
Switch1(config-router)#no auto-summary
Switch2#conf t
Switch2(config)#router eigrp 100
Switch2(config-router)#network 0.0.0.0
Switch2(config-router)#no auto-summary
==Created vlan 2 & 3, then place interface g0/0 in vlan2, g0/1 in vlan3==
Switch(config)#vlan 2
Switch(config-vlan)#vlan 3
Switch(config-vlan)#end
Switch#config t
Switch(config)#int g0/0
Switch(config-if)#switchport access vlan 2
Switch(config-if)#int g0/1
Switch(config-if)#switchport access vlan 3
==Set IP address to the vlans on SWITCHES==
Switch(config)#int g0/0
Switch(config-if)#ip address 10.1.2.254 255.255.255.0
Switch(config-if)#no shut
Switch(config-if)#int g0/1
Switch(config-if)#no shut
Switch(config-if)#ip address 10.1.3.254 255.255.255.0
==Set IP address to the vlans on PC==
PC(config)#int g0/0
PC(config-if)#no shut
PC(config-if)#ip address 10.1.2.1 255.255.255.0
PC(config-if)#exit
PC(config)#no ip routing [[since acting as PC but its really a router]]
PC(config)#ip default-gateway 10.1.2.254
Routed Protocols
- Are independent of each other
- IPv4 could be in different subnet, but IPv6 could be in same subnet. Therefore,
even if IPv6 can ping each other, IPv4 might not be able to
- "ships in the night" - what one ship is doing at night is different than what
another ship is doing at night
- Dynamic Routes - uses routing protocols EIGRP, OSPF, BGP...
- EIGRP - Cisco Proprietary
- OSPF - Industry Stardard - multivendor
Default route - similar to default gateway, special static route. When router does
not know where to send it, it will point your router to a gateway of last resort
3 Systems -
1) AS Autonomous System
- Grouping of network under one administrative domain
2) IGPs Internal Gateway Protocols - RIP, EIGRP, OSPF
- Routing protocol used within an AS
- These
3) EGP External Gateway Protocols - BGP Border Gateway Protocol
- Routing protocol used between AS going through ISP
To use BGP:
- You must have/apply for an AS number similar to IP Address
Routing Protocols:
1) Distance Vector - signs of road direction
- Determines direction (next hop address) and distance (hop count)
- Routing by rumour (could make bad choices based on word of mouth)
Algorithm: Bellman-Ford algorithm (relys on periodic updates and triggers)
Advantage: Easy to configure
Disadvantage: Limited visibility (only knows what neighbours tell them - routing by
rumour), does not know the entire path
2) Link State
- Each router originates information about itself, its directly connected links and
the state of those links, it is then advertised to all routers in its area - these
routers make a copy of this information so all routers share the same information
Algorithm: SPF Shortest Path First
Advantage: Visibility of entire network
Diadvantage: Difficult to configure, requires more memory
3) Advanced Distance Vector
- EIGRP, takes best of distance vector (easy to configure) and forms neighbour
relationships (similar to Link State protocol)
Advantage: Easy to configure, updates quickly
Diadvantage: Cisco Proprietary
4) Administrative Distance
? If 2 routing protocols conflict, which way to forward traffic
- routing protocol uses the route with the lowest Administrative Distance
? Order of believe (range: 0-255)
(1) itself 0 - administrative distance = 0
(2) next hop = 1
(3) Internal EIGRP = 90
(4) OSPF = 110
(5) RIP = 120
(6) Unknown = 255
- EIGRP is lower because it considers bandwidth and delay, whereas RIP only takes
into consideration of hop count
Classful routing
- Do not advertise subnet mask to other routers /24? /8?
- Assumes consistency of subnet mask
- Not scalable, deployable - this is why RIPv1 is no longer used
~Auto Summarization: when moving from Class A 10.1.1.0/24 to Class B, it will
summarize its advertisement as 10.0.0.0 /8 because it is Class A network
Classless routing
- Advertise subnet mask
- Support VLSM Variable Length Subnet Mask (mask does not have to be the same)
- Summary routes can be manually configured
OSPF Hierarchy
- Breaks a single AS into multiple areas, as a result:
1) reduction in routing table
2) hides internal changes (does not need to rerun SPF algorithm when a network goes
down)
3) reduces flooding
- AS "border routers" - connects OSPF to external AS
- AS routers within the border are "backbone/internal routers"
- "LSAs Link State Advertisements" are contained within its area
- "Summary LSAs" are propagated to other areas
Router Configurations
==Enable DNS and set it to DNS server 8.8.8.8==
R1#conf t
R1(config)#ip domain-lookup
R1(config)#ip name-server 8.8.8.8
==Set default route==
R1(config)#ip route 0.0.0.0 0.0.0.0 yourNextHopRouter
==Set next hop router at gateway of last resort 192.168.0.254==
R1(config)#ip route 0.0.0.0 0.0.0.0 192.168.0.254
==Set administrative distance to 100 (default is 1)==
R1(config)#ip route 0.0.0.0 0.0.0.0 192.168.0.254 enterAdminDistanceHere
R1(config)#ip route 0.0.0.0 0.0.0.0 192.168.0.254 100
**Traffic will only route to the longest match (i.e. it will choose 5.5.5.5
255.255.255.255 over 5.5.5.0 255.255.255.0)
**If 2 equal entries (5.5.5.5 255.255.255.255 & 5.5.5.5 255.255.255.255), then they
will be load balancing - each path will get an entry