Nota: Este Post faz parte do guide de Routing.
Monitoring Commands
show ospf route
show ospf database
show ospf statistics
show ospf log
user@R2> show ospf interface extensive
Interface State Area DR ID BDR ID Nbrs
ge-0/0/3.0 DR 0.0.0.1 192.168.1.2 192.168.1.1 1
Type: LAN, Address: 172.26.1.2, Mask: 255.255.255.252, MTU: 1500, Cost: 1
DR addr: 172.26.1.2, BDR addr: 172.26.1.1, Priority: 128, Adj count: 1
Hello: 10, Dead: 40, ReXmit: 5, Not Stub
Auth type: None
Topology default (ID 0) -> Cost: 0
ge-0/0/1.0 BDR 0.0.0.0 192.168.1.3 192.168.1.2 1
Type: LAN, Address: 172.26.2.1, Mask: 255.255.255.252, MTU: 1500, Cost: 1
DR addr: 172.26.2.2, BDR addr: 172.26.2.1, Priority: 128, Adj count: 1
Hello: 10, Dead: 40, ReXmit: 5, Not Stub
Auth type: None
Topology default (ID 0) -> Cost: 0
O campos de output do comando show ospf interface são:
• Intf: Displays the name of the interface running OSPF.
• State: Displays the state of the interface. It can be BDR , Down, DR, DRother, Loop, PtToPt , or Waiting.
• Area: Displays the number of the area in which the interface is located.
• DR ID: Displays the address of the area’s designated router.
• BDR ID : Displays the BDR for a particular subnet.
• Nbrs: Displays the number of neighbors on this interface.
• Type (detail and extensive output only): Displays the type of interface. It can be LAN , NBMA, P2MP, P2P , or
Virtual.
• address (detail and extensive output only): Displays the IP address of the neighbor.
• mask (detail and extensive output only): Displays the mask of the interface.
• MTU (detail and extensive output only): Displays the interface’s maximum transmission unit (MTU).
• cost (detail and extensive output only): Displays the interface’s cost (metric).
• DR addr (detail and extensive output only): Displays the address of the designated router.
• BDR addr : Displays the address of the BDR.
• adj count (detail and extensive output only): Displays the number of adjacent neighbors.
• Flood list (extensive output only): Displays the list of LSAs pending flood on this interface.
• Ack list (extensive output only): Displays the list of pending acknowledgments on this interface.
• Descriptor list (extensive output only): Displays the list of packet descriptors.
• Dead (detail and extensive output only): Displays the configured value for the dead timer.
• Hello (detail and extensive output only): Displays the configured value for the hello timer.
• ReXmit (detail and extensive output only): Displays the configured value for the retransmit timer.
• OSPF area type (detail and extensive output only): Displays the type of OSPF area, which can be Stub, Not
Stub, or NSSA.
O campos de output do comando show ospf route são:
• Prefix : Displays the destination of the route.
• Route/Path Type: Displays how the route was learned:
– ABR : Route to area border router;
– ASBR: Route to AS border router;
– Ext : External router;
– Inter: Interarea route;
– Intra: Intra-area route; or
– Network: Network router.
• Metric : Displays the route’s metric value.
• Next hop i/f: Displays the interface through which the route’s next hop is reachable.
• Next hop addr : Displays the address of the next hop.
• area (detail output only): Displays the area ID of the route.
• options (detail output only): Displays the option bits from the LSA.
• origin (detail output only): Displays the router from which the route was learned.
O campos de output do comando show ospf database extensive são:
• bits: Displays the flags describing the router that generated the LSP.
• link count: Displays the number of links in the advertisement.
• Each link contains the following output fields:
– id: Displays the ID of a router or subnet on the link.
– data: For stub networks, displays the subnet mask; otherwise, it displays the IP address of the router that
generated the LSP.
– type: Displays the type of link; it can be PointToPoint, Transit, Stub, or Virtual.
– TOS count: Displays the number of type-of-service (ToS) entries in the advertisement.
– TOS 0 metric: Displays the metric for ToS 0.
• Each ToS entry contains the following output fields:
– TOS : Displays the ToS value.
– metric : Displays the metric for the ToS.
– Aging timer (extensive output only): Displays how long until the LSA expires (displayed as hrs:min:sec).
– Installed (extensive output only): Displays how long ago the route was installed.
– expires (extensive output only): Displays how long until the route expires (displayed in hrs:min:sec).
– Ours (extensive output only): Indicates that this advertisement is local.
!Visualizar as ocorrências dos cálculos do SPF
show ospf log
OSPF Tracing
set protocols ospf traceoptions file trace-ospf
set protocols ospf traceoptions flag error detail
set protocols ospf traceoptions flag event detail
set protocols ospf area 0 interface ge-0/0/0.0
set protocols ospf area 0 interface lo0.0
Viewing OSPF Error Counters
show ospf statistics
clear ospf statistics
Chapter 4 Border Gateway Protocol
Why BGP?
BGP é um path-vector protocol usado para interdomain routing.
RFC 4271 – BGP version 4 (BGP4)
BGP Peering Sessions
Neighbor States:
TCP Connectivity
Idle
Connect
Active
BGP Connectivity:
OpenSent
OpenConfirm
Established
BGP Message Types
Open
Update
Keepalive
Notification
Refresh – soft clearing do BGP
BGP Update Messages
Descrevem um single path para múltiplos prefixos. BGP peer assume essa informação enquanto não receber nenhum update subsequente advertindo um novo path para o prefixo ou lista-lo como unreachable.
BGP Message Types
BGP Attributes
Type Well-know mandatory
AS Path
Origin
Next-hop
Type Well-know discretionary:
Local Preference
Atomic Aggregator
Type Optional transitive:
Community
Agregator
Type Optional nontransitive:
MED
Cluster List
Originator ID
BGP Attributes
Type Well-know mandatory – A implementação do BGP deve obrigatoriamente suportar
Type Well-know discretionary – A implementação do BGP deve obrigatoriamente suportar
Type Optional transitive – a sua implementação não é obrigatória, mas caso suportado devem ser passados sem serem modificados aos outros Peers BGP
Type Optional nontransitive – a sua implementação não é obrigatória. Se um atributo optional nontransitive não for reconhecido, e ignorado e não enviado aos outros peers
Os Common BGP Attributes:Next-hop,Local Preference,AS-Path,Origin,MED,Community
Next-Hop Attribute
Se o next-hop para um determinado prefixo não for reachable, e colocado na tabela de routing como hidden
show route hidden
Local-Preference Attribute
Atributo visível apenas entre iBGP peers, permite direcionar tráfego de outbound para um determinado peer
Caso seja configurado o local-preference na config e via routing policy, o sistema usa o valor da routing policy
AS-Path Attribute
Verifica o AS-Path e caso o router identifique o seu próprio AS number neste update, é feito Drop devido ao mecanismo de Loop.
É advertido aos restantes peers o best path (menor AS Path para um prefixo)
Origin Attribute
O router que adverte o prefixo e responsável por inserir o atributo Origin
IGP – BGP assigna valor 0 a rota IGP. Exemplos: OSPF, IS-IS, static, e aggregate.
EGP – BGP assigna valor 1 a rota. Rotas EGP do protocolo EGP original, predecessor do BGP
Incomplete – BGP assigna valor 3 a rotas unknown. Estas rotas são conhecidas como não tendo origem no IGP ou EGP
By default o junOS assigna o valor I de IGP, este pode ser alterado usando um routing policy
MED Attribute
Usado para influenciar tráfego inbound (para o meu AS), o BGP assume o MED com valor 0 caso não seja usado o atributo.
Usar o comando metric-out no BGP protocol, group ou neighbor, é possível também usar na routing policy usando metric
Community Attribute
Permite identificar um conjunto de atributos de um grupo de prefixos
set policy-options policy-statement ibgp-export from neighbor 172.25.125.2
set policy-options policy-statement ibgp-export then community set custom-routes
set policy-options community custom-routes members 64700:133
user@R1# set policy-options policy-statement ibgp-export then community ?
Possible completions:
<community_name> Name to identify a BGP community
+ Add BGP communities to the route
– Remove BGP communities from the route
= Set the BGP communities in the route
add Add BGP communities to the route
delete Remove BGP communities from the route
set Set the BGP communities in the route
Summary of BGP Active Route Selection
1. Maior Local Preference
2. AS-Path mais curto
3. Menor Origin Value (I [IGP] < E [EGP] < ? [Incomplete])
4. Menor MED
5. Preferencia de rotas eBGP sob iBGP
6. Prefere best exit do AS (Escolhe o menor cost IGP para o next-hop do BGP)
7. Para rotas eBGP recebidas, prefere a corrente rota, de outra forma prefere a com o menor RID
8. Cluster Length mais curto
9.Prefere as rotas do peer com o menor Peer ID
Descrição de algumas das regras:
6. Escolhe o menor cost IGP para o next-hop do BGP. Para iBGP peer, instala os next-hop com base nas seguintes 3 regras:
a. BGP examina as tabelas inet.0 e inet.3 para encontrar o next-hop. É escolhido o next-hop com menor preference, frequentemente o BGP usa a versão do next-hop inet.3, via MPLS LSP.
b. A preference deve empatar na inet.0 e inet.3, e usado o next-hop na instance inet.3
c. Quando existe um empate na preference e a instance esta na mesma routing table, e examinado o numero de equal-cost paths por cada instance. E instalado o next-hop da instance com mais paths
Este empate é capaz ocorrer quando traffic-engineering bgp-igp é usado no MPLS.
7. BGP usa a rota advertida pelo peer com menor RID. Quando comparando rotas external de 2 External ASs distinctos, se as rotas forem iguais ate a comparação do RID, e preferida a corrente rota.
Esta preferência previne issues relacionados com oscilação de rotas relacionados com o MED
O comando external-router-id sobrepoem-se a este comportamento e prefere a rota external com o menor RID, independentemente de que rota esta atualmente activa.
IBGP Next-Hop Propagation
By default o Next-hop de uma rota eBGP não e alterada, quando e injectada no iBGP.
Usar o comando next-hop self na routing policy
Referências:
Notas estudo JNCIS-ENT parte 1
Notas estudo JNCIS-ENT parte 2
Notas estudo JNCIS-ENT parte 3
Notas estudo JNCIS-ENT parte 4
Notas estudo JNCIS-ENT parte 5
Notas estudo JNCIS-ENT parte 6
Notas estudo JNCIS-ENT parte 7
Notas estudo JNCIS-ENT parte 8
2 thoughts on “Notas estudo JNCIS-ENT parte 11”