4

You might also like

Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 7

Setting up Root and VLANs for (Picture1) - load sharing

- 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

Link Aggregation / Etherchannel (Benefits)


- Redundancy = if one of the ports go down, the port channel will still be up
- Higher throughput = ST not blocking one of the ports
- Load balance
***
Furthermore on "channel-group X mode ____"
active - LACP unconditional
passive - LACP only if LACP device is detected
desirable - PAgP unconditional
auto - PAgP only if PAgP device is detected
***
_______________________________________________________

===VLAN Simulations - Section247===


Configure a layer2 Etherchannel between the switches as follows:

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

===VLAN Simulations - Section248===


Configure interface fa0/23 and fa0/24 as 802.1Q trunk links between Switch1 and
Switch2
Configure the interfaces individually.
Configure a Layer 2 EtherChannel between Switch1 and Switch2 on the inter-switch
links. (fa0/23 and fa0/24).
Use PagP for dynamic negotiation
Switch1 should initiate negotiation and Switch2 should respond
Use Port-Channel no 12

**Basically... same as above except:


Switch1(config-if)# channel-protocol pagp (or lacp if it is asking for lacp)
Switch1(config-if)# channel-group 12 mode desirable

===VLAN Simulations - Section249===


Configure interface fa0/23 and fa0/24 as 802.1Q trunk links between Switch1 and
Switch2
Configure a Layer 2 EtherChannel between Switch1 and Switch2 on the inter-switch
links. (fa0/23 and fa0/24)
Use LACP for dynamic negotiation
Switch1 should initiate negotiation and Switch2 should respond
Use Port-Channel no 12

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

(??) ===VLAN Simulations - Section250===


Configure interface fa0/23 and fa0/24 on Switch1 and Switch2 as a Layer 3
EtherChannel.
Use Port-Channel no 12 and subnet 172.16.10.0/24
Switch1 = 172.16.10.1 ans Switch2 = 172.16.10.2

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".

_____________________________________________

*Recall, if a port is link-type = "Shared", we can make convergence faster by


making the port into a portfast
Switch3(config)#int g0/2
Switch3(config-if)#spanning-tree portfast

**Summary: To optimize your ST


1) Set all links to P2p Point-to-point
2) Set your edge ports(industry)/portfast (cisco) (ports connected to your edge
devices) as Shared Edge

**Turning an interface (or switch) into a router


Switch1(config-if)#no switchport
*With routers, you can set ip address to interfaces (ex. g0/0), but with switches,
you can only set VLANs

==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

**Summary of Switches & Routers:


- switchport is a Layer 2 Interface
- no switchport is a router Layer 3 Interface
- switch's IP address is configured via vlan (ex. vlan1)
- router's IP address is configured via interfaces (ex. g0/0)
- router ports do not run vlans, STP, DTP
- routers' interfaces are shut down by default
- routers block broadcast by default
*router ports are used between routers and switches
*vlans, switchports are used when traffic needs to be tagged throughout the network

==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

==To enable layer 3 IP routing==


Switch(config)#ip routing

==Random troubleshooting - Show commands==


Switch1#show cdp neighb
Switch1#show ip interface brief
Switch1#show ip protocol
Switch1#show ip eigrp int
Switch1#show interface trunk
Switch1#show vlan brief
Switch1#show vtp status
Switch1#show controllers serial X
Switch1#show mac address-table
Switch1#debug ip icmp
Routed vs Routing Protocols
1) Routed
- IPv4, IPv6
- Carry user information
?- Each router making independent decision in determining path
2) Routing
- EIGRP (bandwidth & delay), OSPF (bandwidth), RIP (hopcount), ISIS, BGP Border
Gateway Protocol (largest in world)
- Determine best route between networks - chooses the best path
- Routing protocols are used to automatically advertise routing between networks
and that's how routers learn about the available networks in a topology
- If a router receive traffic going to IP address A.A.A.A, but A.A.A.A doesn't
match a network in the router's routing table, the packets will be dropped -
applies specifically to unicast routing based on destination IP address

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

**Distance Vector vs Link State routing protocol


Distance Vector = Road sign
Link State = Road map

Link State routing protocol


- Floods network with LSAs Link State Advertisements
- Runs SPF Shortest Path First algorithm from their perspective to the destination
compared to the topological database (all routers in an area share the same
database with all the links and link state), then puts the best route into their
routing table
- OSPF, ISIS Intermediate System - Intermediate System

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

Link State routing (Benefits)


- Fast convergence
- Less suspectible to routing loops because of their great visibility of their
network
- Link State packets are sequenced and acknowledged (if not received, it will
retransmitt)
- Hierarchical design enables optimization of resources
- Can scale better than distance vector routing protocols
Link State routing (Drawbacks)
- Demands more resources (memory, CPU)
- Configuration and design can be complex

==Configure static route==


Topology: R1 f0/0 (10.1.1.1/24) <-> R2 f0/0 (10.1.1.2/24) <-> R2 f0/1 (10.1.2.1/24)
<-> R3 f0/0 (10.1.2.2/24) <-> R3 Loopback (3.3.3.3/32)
R1#show ip route
->FORWARD
R1#conf t
R1(config)#ip route destinationIP destinationGateway nextHopPortIPAddress
R1(config)#ip route 10.1.2.0 255.255.255.0 10.1.1.2
<-BACKWARD
R3#conf t
R3(config)#ip route 10.1.1.0 255.255.255.0 10.1.2.1
==Configure static route for R2 to R3 Loopback==
R2#conf t
R2(config)#ip route 3.3.3.3 255.255.255.255 10.1.2.2
**Note this also works, but matches other addresses too... so watch out: ip route
3.3.3.0 255.255.255.0 10.1.2.2
==Disable the above static route==
R2(config)#no ip route 3.3.3.3 255.255.255.255 10.1.2.2
==Next hop command==
R2#show ip cef
==Ping source==
R1#ping x.x.x.x source y.y.y.y

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

**If IP routing is enable on a switch, we use a routing protocol


**If IP routing is disabled on a switch, we use ip default gateway to allow a
switch to send traffic to a remote subnet
==Layer 2 Switch (no ip routing - disable by default) - requires==
S1(config)#ip default-gateway 10.1.1.254
==Layer 3 Switch (ip route) - requires==
S1(config)#ip route 0.0.0.0 0.0.0.0 10.1.1.254

**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

You might also like