{"id":2009,"date":"2025-06-30T11:06:17","date_gmt":"2025-06-30T10:06:17","guid":{"rendered":"https:\/\/blog.thomarite.uk\/?p=2009"},"modified":"2025-06-30T11:06:17","modified_gmt":"2025-06-30T10:06:17","slug":"jncis-sp","status":"publish","type":"post","link":"https:\/\/blog.thomarite.uk\/index.php\/2025\/06\/30\/jncis-sp\/","title":{"rendered":"JNCIS-SP"},"content":{"rendered":"\n<p>JNCIS-SP<br>Junos Intermediate Routing On-Demand &#8211; DONE<br>Junos Service Provider Switching &#8211; DONE<br>Junos MPLS Fundamentals &#8211; DONE<\/p>\n\n\n\n<p><a href=\"https:\/\/jlabs.juniper.net\/vlabs\">https:\/\/jlabs.juniper.net\/vlabs<\/a><\/p>\n\n\n\n<p>=========================================<br>Junos Intermediate Routing On-Demand<br>=========================================<\/p>\n\n\n\n<p>CBT Junos Tunnels<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p>gr-0\/0\/0 GRE<br>ip-0\/0\/0 IPoverIP<\/p>\n\n\n\n<p>set chasis fpc 1 pic 2 tunnel-services [bandwidth X]&#8211;&gt; enable tunnels in x-1\/2\/x<\/p>\n\n\n\n<p>GRE header: 24bytes = 20byes IP header + 4bytes (reserv, version, protocol type) =&gt; increase MTU !!! 0x800 = ipv4 \/ 8x86dd iv6<\/p>\n\n\n\n<p>frames over GRE: set chassis network-services enhanced-ip<br>set intefaces gr-0\/0\/0 unit 0 family bridge interface-mode trunk vlan-id-list 100 core-facing<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>              set routing-instances virtsw instance-type virtual-switch\n                                           interface ge-0\/0\/2.0\n                                                     gr-0\/0\/0.0\n                                            bridge-domain C100 vlan-id 100<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">CBT Chassis HA<\/h2>\n\n\n\n<p>vrrp: MAC 0000.5E00.01xx (MC.18) group-id (8bit) identical, priority (8bit 1-254, def=100) or hights IP,<br>v3: ipv6 and &lt;1s<\/p>\n\n\n\n<p>(inside interface config)<br>set vrrp-group 1 virtual-address VIP [priority x]<\/p>\n\n\n\n<p>GR: graceful restart<br>set routing-options graceful-restart (show ospf overview)<\/p>\n\n\n\n<p>GRES: Graceful Routing Engine Switchover, BUT Control Planel needs to reconverge !!!<br>set chassis redundancy graceful-switchover<br>request chassis routing-engine master switch check<\/p>\n\n\n\n<p>NSR: Non-stop active routing. NSR helps GRES to get CP syncronize between REs. Incompatible with GR !!!<br>set routing-options nonstop-routing<br>set systen commit syschronize<br>show task replication<\/p>\n\n\n\n<p>ISSU: in-service sw upgrade<br>Needs GRES+NSR<br>request system software in-service-upgrade \/var\/tmp\/file.tgz reboot<\/p>\n\n\n\n<p>virtual-chassis<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">CBT IPv6<\/h2>\n\n\n\n<p>multicast FF00::\/8<br>link-local FE80::\/10 (no routable), NDP (like ARP) neighbor discovery prot (Neigh Solicitation, Neigh Adver)<br>unique-local FC00 or FEC8 (no internet routable &#8211; like private IP)<br>global unicst: 2000::\/3<\/p>\n\n\n\n<p>dhcp:<br>slaac (staless): EUI-64: use MAC 48b + FFFE (mac 24b (flip 7th) FFFE mac 24b) -&gt; 64 bits + 64 bits from Route Solication<br>set interface ge-0\/0\/2 unit 0 family inet6 address 2012:db8::\/64 eui-64<\/p>\n\n\n\n<p>dhcpv6 (stateful)<\/p>\n\n\n\n<p>ospf3: needs a router-id that is ipv4!!!<br>set routing-options router-id ipv4<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">CBT LACP<\/h2>\n\n\n\n<p>802.3ad<br>max 8 links per lacp<br>set chassis aggregated-devices ethernet device-count X<\/p>\n\n\n\n<p>set interfaces ge-0\/0\/0 ether-options 802.3ad ae0<br>1<br>set interfacce ae0 aggregated-ether-options lacp active|passive periodic fast|slow (30s) (def is fast=1sec)<br>unit 0 family etherent-switching port-mode trunk (EX)<br>interface-mode (QFX(<br>bridge interface-mode trunk vlan-id-list 300 (MX)<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">CBT ISIS<\/h2>\n\n\n\n<p>level0 &#8211; ES-IS<br>level1 &#8211; IS-IS intra-area<br>level2 &#8211; IS-IS inter-area<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code> intra-area AD=15  idem<\/code><\/pre>\n\n\n\n<p>ISIS inter-area AD=18 &#8211; metric default 10s<\/p>\n\n\n\n<p>IIH = Hello using MAC address. Router ID, area, Neighbor discovery<br>CSNP = Like DB descriptor in OSPF. After neighbor discovery<br>PSNP = request prefix and route info<\/p>\n\n\n\n<p>Border router, establish L2 adj (differnt area) -&gt; 2x LSDB!!!<br>establish L1 adj (same area)<\/p>\n\n\n\n<p>LSPDU: sent by border router, with Attached bit. The router L1 that receives it install a default route to the originator of LSPDU<\/p>\n\n\n\n<p>NET address: network entity title. In lo0 !!!<br>49.(16b &#8211; area ID).(48b MAC).00<\/p>\n\n\n\n<p>Set adjacencies (no need IPs!)<br>1) set NET in lo0.0 under family iso<br>2) set protocols isis interface X.0<br>3) set interface x.0 family iso (NET not needed!(<br>4) disable the level you dont need!! (by default all links are l1\/l2)<\/p>\n\n\n\n<p>authentication-type simple or md5<br>authenticaion-key key<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">Protocol Independent Routing (Static routes)<\/h1>\n\n\n\n<pre class=\"wp-block-code\"><code>0 directed  connect<\/code><\/pre>\n\n\n\n<p>AD: 5 static routes<br>7 rsvp-lsp<br>8 sr-te<br>9 lsdp-lsp<br>10 ospf internal<br>15 isis l1<br>18 isis l2<br>105 pim<br>130 agg<br>150 ospf ext<br>160 isis ext<br>170 bgp<\/p>\n\n\n\n<p>prefernce=5<br>nh = ip directled connected, reject, discard<br>no recursive loop-up performed by default (like cisco) -&gt; need to use &#8220;resolve&#8221;<br>qualified-next-hop IP preference X<br>no-readvertise (ie for mgmt not advertised into IGP) block exporting via policies<br>as-path, community, metric, preference<\/p>\n\n\n\n<p>ipv4: edit routing-options staic route \u2026<br>ipv6: edit routing-options rib inet6.0 static route \u2026<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Aggregate routes<\/h2>\n\n\n\n<p>preference=130<br>at least one contributing route active<br>default nh = reject<br>as-path, community, metric, policy, preference<br>show route AGG\/22 exact detail<\/p>\n\n\n\n<p>edit routing-optons aggregate -&gt;<\/p>\n\n\n\n<p>*If contributing routes don\u2019t have a next hop (i.e., are not usable), the aggregate route may still appear, but it will be hidden (inactive) \u2014 and not advertised unless you use a discard next-hop or similar workaround.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Generated Routes<\/h2>\n\n\n\n<p>similar to agg routes. NH = nh of primary (lowest preference) contributing route (aggregate nh=reject)<\/p>\n\n\n\n<p>diff from agg:<br>-you can assign a next hop.<br>-And you don&#8217;t need the contributing route to be resolvable \u2014 it just needs to exist in the routing table (even if unusable).<br>-It allows more flexibility when the contributing route is unusable or when you want to inject a route into the table regardless of reachability.<\/p>\n\n\n\n<p>ie: advertise default into osfp if you are learning a specific prefix from your ISP.<\/p>\n\n\n\n<p>set policy-option policy-statement match-contributing-prefix term match-bgp from protocol bgp route-filter NET1\/16 exact then accept<br>term else-reject then reject<br>set policy-option policy-statement export-default term match-default from protocol aggregate route-filter 0.0.0.0\/0 exact then accept<\/p>\n\n\n\n<p>set routing-options generate route 0.0.0.0\/0 policy match-contributing-prefix<br>set protocol ospf export export-default<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Martia Routes<\/h2>\n\n\n\n<p>0.0.0.0\/8 orlonger<br>127.0.0.0\/8 orlonger<br>192.0.0.0\/24 orlonger<br>240.0.0.0\/4 orlonger<\/p>\n\n\n\n<p>ipv6: loopback, rfc 2373, link-local<\/p>\n\n\n\n<p>set routing-options martians x\/8 orlonger<\/p>\n\n\n\n<p>show route martians table inet.0<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">Routing Instance (LAB)<\/h1>\n\n\n\n<p>show route instance -&gt; default: master -&gt; inet.0 inet6.0<\/p>\n\n\n\n<p>edit routing-instances<br>set instance-type x=forwarding, l2vpn, no-forwarding (make big network smaller), virtual-router (system virtualization), vpls, vrf (for l3vpn)<br>set interface ge-0xxxx<br>set routing-options static route \u2026. next-hop xxx<br>set protocols ospf area 0.0.0.0 interface ge-xxxxx<\/p>\n\n\n\n<p>show route table INSTANCE.inet.0<br>show interface terse routing-instance INSTANCE<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">rib groups: share routes between routing tables<\/h2>\n\n\n\n<p>edit routing-options<br>rib-groups NAME<br>export-rib T0 (only one! &#8211; where routes should be taken from) normally omitted because it is always the primary rib<br>import-rib T1 T2 (severals tables &#8211; where routes should be placed) ????????\/<br>import-policy POLICY<\/p>\n\n\n\n<p>edit routing-options<br>rib-group test<br>import-rib [ inet.0 test.inet.0] ===&gt; routes from inet.0 TO test.inet.0 ???? ^^^^ differente from aboves<\/p>\n\n\n\n<p>edit protocols ospf<br>set rib-group test<br>area 0.0.0.0 interface ge-0\/0\/0.0 lo0.0<\/p>\n\n\n\n<p>create a logical-tunnel interface between instances and route between them: lt-0\/0\/0<br>*requires service card<\/p>\n\n\n\n<p>edit interfaces lt-0\/0\/0<br>unit 0<br>encapsulation ethernet<br>peer-unit 1<br>family inet<br>uni t<br>encapsulation ethernet<br>peer-unit 0<br>family inet<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">LOAD BALANCING<\/h1>\n\n\n\n<p>per-packet issue -&gt; out-of-order (Junos doesnt do per-packet !!!!)<\/p>\n\n\n\n<p>per-flow LB:<br>set policy-options policy-statement LB-ALL then load-balance per-packet<br>set routing-options forwarding-place export LB-ALL<\/p>\n\n\n\n<p>show route forwarding-plane<\/p>\n\n\n\n<p>default flow ipv4: incoming interface, src add, dst add, protocol<br>ipv6: l3,l4,traffic class<\/p>\n\n\n\n<p>modify: set forwarding-option hash-key family inet layer-3 layer-4<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">Filter-Based-Forwarding (FBF) (lab)<\/h1>\n\n\n\n<p>forwarding based on source IP<\/p>\n\n\n\n<p>1) using RIB-groups<br>-create match filter and apply to incomming interfaces<br>set firewall family inet filter F-NAME term TERM from CONDITION then routing-instance INSTANCE<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>create default term because by default, filter discard traffic!<br>set interface ge-0\/0\/0 unit 0 family inet filter input F-NAME<\/li>\n<\/ul>\n\n\n\n<p>-create routing instance<br>set routing-instance INSTANCE instance-type forwarding!! routing-option static route 0.0.0\/0 next-hop IP<br>next-table inet.0<br>-create rib group<br>set routing-options interface-routes rib-group inet GROUP<br>rib-groups NAME import-rib [ inet.0 INSTANCE.inet.0 ]<\/p>\n\n\n\n<p>show route table INSTANCE.inet.0<\/p>\n\n\n\n<p>2) using instance-import instead of RIB-group<\/p>\n\n\n\n<p>set policy-options policy-statement ISP-IMPORT from instance master then accept<\/p>\n\n\n\n<p>set routing-options ISP instance-type forwarding!! routing-options static route 0.0.0\/0 next-hop IP<br>instancce-import ISP-IMPORT<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">Fundamenals OSPF<\/h1>\n\n\n\n<p>LSDB, flooding LSA, all routers must have identical LSDB, SPF algo<\/p>\n\n\n\n<p>packets type:<br>1 hello: 10s default, MC to 224.0.0.5, incluse: netmask<em>, hello interval<\/em>, dead<em>, options<\/em>, priority, DR, BDR, neighbor<br>2 db description: during adj formation, hightest RID is primary for sync and set\/maintein seq nu. This relationship is forgotten after transfer. LSDB = ospf header, seq nu, lsa header<br>3 ls-request: request precise version of db: ospf header, ls-type, ls-id, adv-router (RID of the originator router)<br>4 ls-update:to 224.0.0.5\/6: ospf header, num of adc, ls-adv<br>5 ls-ack: unicast to originator.<\/p>\n\n\n\n<p>Adj states<br>down<br>init: hello packet sent<br>2way: hell received, bidir achieved<br>exStart: decide primary router for db sync<br>exchange: lsdb exchange started<br>load: transmision finish but still reading from peer<br>full: lsdb is sync<\/p>\n\n\n\n<p>ethernet: avoid adj all routers. DR only router creates adj to all routers in segment. BDR creates adj to all routers too.<br>interface-type p2p: no DR\/BDR is elected (saves time), no lsa type-2 generated<br>DR: higher priority (default 128), higher RID, no preemption,<br>NoDR routers create 2way adj with other NoDR routers.<\/p>\n\n\n\n<p>scalability<br>reduce lsdb: multiple areas, route summarization between areas.<br>areas:<br>area0: all connect to area0<br>ABR: connect areaX to area0<br>ASBR: outside ospf to areaX<br>stub area: LSA3 yes (inter-area), no LSA4\/5 (ext) and no ASBR. Inject default route (need configuration)<br>totally stubby-area: only default, no LSA3-5.<br>not-so-stubby-area: it gets external routes and can advertise them to are0 but it can&#8217;t receive LSA5 from other areas.<\/p>\n\n\n\n<p>lsa1: router links (intra-area)<br>lsa2: network links (by DR only), describe routers attached to the segment<br>lsa3: summary, by ABR, inter-are links<br>lsa4: by ABR, path to ASBR.<br>lsa5: external, prefix redistributed by ASBR, by-default lsa5-type2 (ext cost not included) (type1 cost to ASBR includded)<br>lsa7: nssa, by ASBR in NSSA, then the ABR creates a LS5.<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">Deploy OSPF<\/h1>\n\n\n\n<p>ospfv3 works with ipv4\/6\/<br>auth, summarization (ABR), external prefix-limit, graceful-restart, BFD<\/p>\n\n\n\n<p>!! cost=ref-bw\/bw !!<\/p>\n\n\n\n<p>set protocols osfp reference-bandwidth X (100Mbps default) (lo.0 has always cost 0)<\/p>\n\n\n\n<p>set routing-options router-id LO-IP<br>set protocols ospf|ospf3 area AREAID interface x.x<\/p>\n\n\n\n<p>set policy-options policy-statement 2OSPF term MATCH from protocol direct route-filter NET\/X exact then accept<br>set protocols ospf export 2OSPF<\/p>\n\n\n\n<p>show ospf neighbor extensive<br>clear ospf neighbor<\/p>\n\n\n\n<p>show ospf interface [extensive]<br>show ospf route [abr, asbr, inter, intra, extern, detail,instance]<br>show ospf database [brief (default), detail, extensive,]<br>show ospf statistics<br>show ospf log<\/p>\n\n\n\n<p>troubleshooting:<br>no neighbor: check link status<br>exstart: check MTU<br>2way: normal for DR-other neighbor<\/p>\n\n\n\n<p>set protocols ospf traceoptions file TRACE-ospf flag error detail flag even detail \u2026.<br>show log TRACE-ospf<\/p>\n\n\n\n<p>edit protocols ospf<br>save \/var\/tmp\/working-ospf.confg ==&gt; save config to a file from config mode.<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">Fundamenals BGP<\/h1>\n\n\n\n<p>path vector routing protocol.<br>NLRI: Network Layer Reachability Information<br>classless, bgpv4, rfc 4271<br>nonportable (ISP provide IP range), portable (customer has its own prefix).<br>ebgp -&gt; ttl=1 !!!<br>ibgp: full-mesh, using lo0 !!!<br>tcp 179, manually defined neighbors<br>loop avoidance: as path,<\/p>\n\n\n\n<p>state:<br>idle: init stte<br>connect: waiting for tcp to complete<br>active: trying to establish tcp connection<\/p>\n\n\n\n<p>opensent: tcp completed. wait for open from peer<br>openconfirm: wait for keep alive from peer.<br>established: received keepalive from peer. all done<\/p>\n\n\n\n<p>4096 max bgp message size, min 19 bytes<\/p>\n\n\n\n<p>messages:<br>open: after tcp completed, initiates bgp sesson<br>update: transport routing info<br>keepalive:<br>notificaton: signal when something is wrong.<br>refresh: soft clearing bgp session to re-advertise route<\/p>\n\n\n\n<p>attributes<br>wellknown-mandatory: as-path, origin, NH. supported by al bgp implementations. included in each bgp update<br>wk-discretionary: local-pref, atomic-agg. supported by all bgp implementation. not included in each bgp update<br>optional-transitive: community, agg. not supported by all bgp implementation. but they need to pass it along unchanged<br>optional-nontransitive: MED, cluster-list, originator ID. not supported by all bgp implemnetation. If attribure is not identified, it is ignored and not passed along.<\/p>\n\n\n\n<p>NH: ip of peer advertising prfix, must be in RIB-local. ibgp doesnt change it, ebgp changes it.<br>LP: determine outbound. higher best. used withing individual AS, not redistributed to ebgp (default 100)<br>as-path: check loop<br>origin: where was received: 0 &#8211; IGP, 1 &#8211; EGP, ? &#8211; incomplete (redistribute)<br>MED: multihomed to same external ISP (same ASN!!!). determine inbound from that ISP to you. lower best (default 0)<br>communities: edit policy-optionss<\/p>\n\n\n\n<p>path-selection:<br>NH + no loop, highest LP, shortest AS-path, lowest origin, lowest med, ebgp before ibgp, if all ibgp then best exit from AS, if all ebgp, choose current active or one from peer with lowest RID, RR: shortest cluster lenght, routes from peer with lowest RID<\/p>\n\n\n\n<p>nh calculation: checki inet.0 (ipv4) and inet.3 (mpls). If preference equal, inet.3 preferred.<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">Deploy BGP<\/h1>\n\n\n\n<p>ibgp: split-horizon -&gt; full-mesh. NH not changed for routes coming from ebgp (change it with &#8220;next-hop self&#8221;)<\/p>\n\n\n\n<p>edit policy-options<br>set policy-statemen NH-self term 1 then next-hop self<\/p>\n\n\n\n<p>edit routing-options<br>set router-id LO.0<br>set autonomous-system ASN<\/p>\n\n\n\n<p>edit protocols bgp<br>set group int-ASN<br>type internal<br>local-addess LO.0<br>neihbor R1.lo0<br>export NH-self<br>set group ext-ASN<br>type external<br>peer-as ASN<br>neighbor R2.interface.IP<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p>edit routing-options aggregate<br>route IP\/22<\/p>\n\n\n\n<p>edit policy-options<br>set policy-statement adv-agg term 1 from protocol aggregate route-filter IP\/22 extac then accept<\/p>\n\n\n\n<p>routers from peers -&gt; RIB-in -&gt; import-policy -&gt; RIB-local -&gt; export-policy -&gt; RIB_out -&gt; routes to peers<\/p>\n\n\n\n<p>only for active routes<\/p>\n\n\n\n<p>RIB-in: shw route receved-protocol bgp IP (before routing filtering!!!)<br>RIB-out: show route advertised-protocol bgp IP (after route filtering!!!)<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">IP Tunneling<\/h1>\n\n\n\n<p>both statelss by default: keepalive config possible or use BFD<br>set protocols oam gre-tunnel interface gr-x\/x\/x.1 keepalive-time 10 hold-time 30<\/p>\n\n\n\n<p>define static routes to use tunnel<br>set routing-options static route LAN2 next-hop gr-x\/x\/x.0<\/p>\n\n\n\n<p>GRE: ipv4\/6, mpls. 24B overhead. TTL decremented. RFC1702<br>gr-x\/x\/x<\/p>\n\n\n\n<p>support multiple logical units per interface. as stateless, you need a valid route to the remote endpoints<\/p>\n\n\n\n<p>set interface gr-0\/0\/0 unit 0 tunnel source IP1 destination IP2<br>family inet<\/p>\n\n\n\n<p>IP-IP: 20B overhead. TTL decremented. rfc2003. Only for IP<br>ip-x\/x\/x<\/p>\n\n\n\n<p>pmtud: set system internet-options gre-path-mtu-discovery<br>watch out MTU !!!<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">GR and BFD<\/h1>\n\n\n\n<p>uptime &lt;&gt; availability<br>GR=Graceful Restart: (NSR is mutuel excluent from GR)<br>BFD: hello bassed<br>VRRP: vip lan side<br>ISSU: dual RE, upgrade withouth interruption<\/p>\n\n\n\n<p>GR<br>rquest grace period to neighbord. fowarding continue during restart. neighbord hide the failure to the rest of the network<br>supported: ospf, isis,bgp, rsvp, ldp.<br>requirements: all routers (restarting and helpers) need to support GR and NonStopForwarding !!!!<br>GR !!helper!! mode is enabled by default, but not for restarter???<br>set routing-options graceful-restart disable (globla or can do via protocol)<\/p>\n\n\n\n<p>show bgp neighbor IP<br>set protocols ospf traceoptions flap graceul-restart<\/p>\n\n\n\n<p>BFD ospf, isis, bgp, rsvp, pim, static routes. 3 hellos missed -&gt; down<br>set protocols bgp group G1 bfd-liveness-detection minimun-interval 300<br>show bfd session<br>show bgp neighbor IP<\/p>\n\n\n\n<p><a href=\"https:\/\/www.cisco.com\/en\/US\/technologies\/tk648\/tk365\/tk480\/technologies_white_paper0900aecd80244005.html\">https:\/\/www.cisco.com\/en\/US\/technologies\/tk648\/tk365\/tk480\/technologies_white_paper0900aecd80244005.html<\/a><\/p>\n\n\n\n<p>How are the timers actually negotiated? Each system, upon receiving a BFD control packet will take the &#8220;Required Min RX Interval&#8221; and compare it to its own &#8220;Desired Min TX Interval&#8221; and take the greater (slower) of the two values and use it as the transmission rate for its BFD packets. Thus, the slower of the two systems determines the transmission rate.<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">GRES, NSR, Unified ISSU<\/h1>\n\n\n\n<p>GRE switchover: doesnt conserve control plane\u2026 if NSR is configured, then it is kept.<br>without GRES: PFE is restarted, the new RE restart RPD<br>with GRES: PFE is not restarted, new RP restars RPD.<\/p>\n\n\n\n<p>set groups RE1 system hostname R1-RE1 backup-router IP<br>interfaces fxp0 \u2026<br>RE0 system hostname R1-RE0 backup-router IP<br>interfaces fxp0<\/p>\n\n\n\n<p>commit synchronize<\/p>\n\n\n\n<p>set chassis redudancy gracedful-switchover<br>show system switchover (only in backup RE)<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">NSR: uses GRES. RPD runs in backup RE. Mutually exclusive with GR<\/h2>\n\n\n\n<p>set routing-options nonstop-routing<br>chassis redunddancy graceufl-switchover<\/p>\n\n\n\n<p>show task replication<\/p>\n\n\n\n<p>Unified ISSU: unifie in-service software upgrade. ugrade junos withou disruption CP<br>GRES + NSR<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">VRRP<\/h1>\n\n\n\n<p>rfc 2338, by default master doesnt respond to ICMP to VIP (can be changed), support auth, preempt enabled by default<br>vrrp master: responds to ARP<br>224.0.0.18, ttl=255, 1s interval<br>virtual mac: 00.00.5E.00.01.VRID<br>hight priority -&gt; best (dfault 100)<\/p>\n\n\n\n<p>set interface ge-0\/0\/3 unit 0 family inet address IP vrrp-group X virtual-address VIP priority 200<\/p>\n\n\n\n<p>show vrrp summary<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">INTRO IPv6<\/h1>\n\n\n\n<p>QoS, no NAT, end2end ipsec, autoconfig<br>header 40B. version, traffic class, flow label, payoad length, next header, hop limit, src add, dst add<\/p>\n\n\n\n<p>extension headers<br>hop-by-hop options<br>routing<br>fragment<br>destination options<br>auth<br>enc security payload<\/p>\n\n\n\n<p>8x 16b hex blocs<\/p>\n\n\n\n<p>unicast<br>multicast<br>anycast<\/p>\n\n\n\n<p>::\/0 = default route<br>::1 -&gt; loopback<\/p>\n\n\n\n<p>scope:<br>broadcast: none!!!!!!!!!<br>multicast: MAC: 33-33:.. \/\/ FF00::\/8<br>link-local: always assigned, no routable: FE80::\/10 or \/64<br>unique local: like priv ip, routable internally. FC00::\/7 or FD00::\/8<br>global unicast: pub ip, routable internet 2000::\/3<\/p>\n\n\n\n<p>NDP = Neighbor Discovery Protocol -&gt; ICMP + link-local + multicast.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Duplicate address detection (DAD)<\/li>\n\n\n\n<li>link layer address resolution<br>&#8212; Neighbor Solicitation: src.ip=link-local dst.ip=solicited_node_ip (ff02::1:)<br>&#8212; Neigbor Advertisiement:<\/li>\n<\/ul>\n\n\n\n<p>Router Discovery:<br>router solicitation: RS, request sent by host, dst.ip: FF02::2 (all routers) use link-local as src.ip<br>router advertisement: RA, reply sent by router, src.ip link-local, dst.ip = FF02::1 (all hosts in link-local). It contains global unicast range<\/p>\n\n\n\n<p>SLAAC: Stateless Address AutoConfiguration<br>1) obtain prefix through RA<br>2) host creates its own interface id.<br>2.1: use EUI-64: use MAC (48b) and filling -&gt; 1st half MAC + FFFE + 2nd half MAC + flip the 7th bit of the MAC.<\/p>\n\n\n\n<p>dhcpv6: rfc3315 &#8211; it doenst require the MAC to build the ipv6<br>anycast: rfc2526<br>set routing-options rib inet.6 static route 0::\/0 next-hop IP<br>ospf3<\/p>\n\n\n\n<p>tunneling ipv6 over ipv4:<br>set interfaces gr-0\/0\/0 unit 0 tunnel source IPv4.r1.loopback destination IPv4.r2.loopback<br>family inet6 address IPV6<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">INTRO ISIS<\/h1>\n\n\n\n<p>CLNP packets originally<br>PDU &#8211; protocol data units. IP reachability include in updates<br>LSDB. Single AS (IGP)<br>End-System = host<br>Intermidiate-System = router<br>L1: route within the area or towards L2<br>L2: route between areas and toward other AS<\/p>\n\n\n\n<p>ospf similiraties:<br>L1L2 router = ABR<br>L2 = area 0<\/p>\n\n\n\n<p>ISIS PDU:<br>hello: discover neighbor (IIH) like ospf hello, regular intervals 3sec for DR. broadcast networks =&gt; uses MC.14\/15.<br>circuit type (l1,l2,l1l2, source ID (system ID), holding time, pdu lenght, priority (0-127), LAN ID<\/p>\n\n\n\n<p>LS PDU: flood periodically in area. build LSDB<\/p>\n\n\n\n<p>Seq Num PDU: complete: all LS in LSDB, flood periodically. multicast<br>partial: request missing LS PDU<br>CSNP: maintain LSDB in sync. sent by DIS only<br>TLV: encodig Type length Value<\/p>\n\n\n\n<p>Adj:<br>L1: area ID must be same<br>L2: area ID can be different<br>DIS election (like DR in OSPF for multicass networks = ethernet). Use priority (0=never DIS, higher = winner) There is a DIS for L1 and L2.<br>there is no backup DIS, there is preemption.<br>metric: max=1023<br>delay<br>expense<br>error<br>wide metrics: 2^24<\/p>\n\n\n\n<p>config:<br>by default all links are l1l2<br>edit protocols<br>set isis interface ge-0\/0\/0.0 level 1 disable<\/p>\n\n\n\n<p>set interfaces ge-0\/0\/0 unit 0 family iso<br>family inet address IP<br>lo unit 0 family iso address 49.001.0192.0168.0291.00<br>inet address IP<\/p>\n\n\n\n<p>show isis interfaces<br>show isis database<br>show isis adjacency<br>show isis spf log<br>show isis statistics<br>show isis route<br>set protocols isis traceoptions file isis-trace flag error detail flag hello detail<br>monitor start log-file-name<br>show log log-file-name<\/p>\n\n\n\n<p>issues: physical (l1) or ethernet (l2) issue. Mismatch ares (for level1) and levels, minimum MTU 1492, lack of iso-net, missing lo0<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">CBT Service Provider Bridging Concepts<\/h2>\n\n\n\n<p>802.1q tag 32b -&gt; vlan id: 12b. It doesnt scale -&gt;<br>802.1ad SP (q-in-q) to overcome 802.1q: C-TAG, S-TAG &#8211;&gt; 2x 802.1q header!<br>-&gt; it must still learn MACs !<br>-&gt; between SP, you need vlan translation<br>PEB (PE) customer port is &#8220;access port&#8221; !!! \/\/ IVL &#8211; independent VLAN Learning<br>set interface ge-0\/0\/2 unit 0 family bridge vlan-id S-TAG interface-mode access<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>  if needed to filter C-TAG, in PE to P port:\n  set interface ge-0\/0\/2 unit 0 family bridge inteface-mode trunnk \n                                              inner-vlan-id-list x-y &#91;limit the C-TAG vlans from customer]\n                                vlan-id S-TAG\n\nS-VLAN Bridge (P device) and PE-P ports\n  set interface ge-0\/0\/2 unit 0 family bridge vlan-id S-TAG interface-mode trunk\n                         encapsulation flexible-ethernet-services (aka 802.1ad!)\n                         flexible-vlan-tagging\n\nMX: create vlans -&gt; family bridge!!! (created under edit bridge-domains)\n    set bridge-domains CUSt1 vlan-id or vlan-id-list 200-204\n    show bridge mac-table\nCE are trunk ports   <\/code><\/pre>\n\n\n\n<p>C-VLAN normalization (mainly PEB) = rewrite C-TAG<br>vlan-id none -&gt; pop C-TAG!<\/p>\n\n\n\n<p>set bridge-domains CUST1 vlan-id none<br>interface ge-0\/0\/0.200<br>.201<br>interface ge-0\/0\/2.300<\/p>\n\n\n\n<p>\/\/ interface PE-&gt; CE<br>set interface ge-0\/0\/0 flexible-vlan-taggin<br>encapsulation flexible-ethernet-services<br>unit 200 encapsulation vlan-bridge vlan-id 200<br>unit 201 201<\/p>\n\n\n\n<p>\/\/ interface to PE-&gt;P<br>set interface ge-0\/0\/2 flexible-vlan-tagging<br>encapsulation flexible-ethernet-services<br>unit 300 (S-TAG!) encapsulation vlan-bridge<br>vlan-tags outer 300 inner 200<\/p>\n\n\n\n<p>S-VLAN translation. In P router, link between SP1 P and SP2 P<\/p>\n\n\n\n<p>set interface ge-0\/0\/2 flexible-vlan-tagging<br>encapsulation flexible-ethernet-services<br>unit 0 family bridge interface-mode trunk vlan-id-list 300<br>vlan-rewrite translate INCOMING_S_TAG OUR_S_TAG<\/p>\n\n\n\n<p>vpls: mpls, igp, 802.1q (replacement of q-in-q)<\/p>\n\n\n\n<p>=========================================<br>Junos SP Switching On-Demand<br>=========================================<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">Ethernet Switching and L2<\/h1>\n\n\n\n<p>physical (show interface terse) vs logical (.x), interface family (inet, inet6, iso, mpls, etc)<br>ethernet ieee 802.3, single broadcast and collision domain, MAC 48bits, uses CSMA\/CD<br>hub: collisions can occur, no csma\/cd<\/p>\n\n\n\n<p>bridgin: 802.1d-2004, segments of a single collision domain, isolates L1, FIB,<\/p>\n\n\n\n<p>learning domain: is a DB, attaches to bridge domain 1:1,<\/p>\n\n\n\n<p>learning: check all frames, learn MAC, src port and timing.<br>forwarding\/flooding(BUM)\/filtering\/aging<\/p>\n\n\n\n<p>show bridge mac-table<\/p>\n\n\n\n<p>timeout = 300s, max learned MAC 393215<\/p>\n\n\n\n<p>mac-table-size default 5120<\/p>\n\n\n\n<p>l2 firewall filters:<br>set firewall family bridge filter NAME term 1 from x then y<br>set interface ge-0\/0\/0 unit 0 family bridge filter input\/output FILTER<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>default: discard<\/li>\n<\/ul>\n\n\n\n<h1 class=\"wp-block-heading\">VLANS and IRBs<\/h1>\n\n\n\n<p>vlan: broadcast domain<br>trunk: native-vlan-id<br>802.1q frame: 4 bytes: tag protocol: 16 bits &#8211; 0x8100,<br>priority: 3 bits, 802.1p<br>canonical format indicator: CFI = 0 (1 bit)<br>unique vlan id: 12 bits<\/p>\n\n\n\n<p>vlan-id-list [100 500-505] Really Mean? &#8211; This interface accepts or outputs only VLAN IDs 100 and 500 to 505 \u2014 after translation!!<br>It\u2019s the post-rewrite VLAN ID list. This is the range of VLANs that can be present after any translation occurs.<br>It\u2019s bi-directional (symmetric translation).<\/p>\n\n\n\n<p>set bridge-domains NAME vlan-id [ X y z a-b ]<br>set interfaces ge-1\/0\/0 unit 0 family brige interface-mode access vlan-id X<br>set interfaces ge-2\/0\/0 native-vlan-id x vlan-tagging unit 0 famyly bridge interface-mode trunk<br>vlan-id-list [ x y ] or [ x-y z a-b ]<br>show bridge domain [ NAME detail]<\/p>\n\n\n\n<p>MVRP: multiple vlan registration protocol, l2 messaging protocol to automae creation and mgmt vlans. only on trunk ports.<br>MRP messages<br>set protocols mvrp no-dynamic-vlans interface ge-0\/0\/0.0<br>show mvrp statistics<\/p>\n\n\n\n<p>IRB: integrated routing and bridging: l3 gw for a vlan.<br>set interfaces irb unit X description vlan-x family inet address IPx<\/p>\n\n\n\n<p>set brige domains NAMEX vlan-id x<br>routing-interface irb.x<\/p>\n\n\n\n<p>show bridge mac-table<\/p>\n\n\n\n<p>chatgpt:<br>Each bridge-domain is a VLAN.<br>You define bridge-domains explicitly in Junos, and then map interfaces (and VLANs) to them.<br>Because each bridge-domain has its own MAC table, flood domain, and associated interfaces \u2014 it behaves like a mini switch inside the virtual-switch.<br>You can associating Multiple VLANs to One Bridge-Domain: why? Service Provider bridging where customer traffic uses many VLANs, but you want to transport all of them over a single bridge-domain \u2014 maybe because you&#8217;re mapping all of them into one L2VPN or EVPN instance<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">Virtual Switches (lab) ***<\/h1>\n\n\n\n<p>routing instances -&gt; virtual router (default) or virtual switch (default-switch)<\/p>\n\n\n\n<p>set routing-instances NAME instance-type virtual-router|virtual-switch<br>interface ge-0\/0\/0.0<br>bridge-domains NAMEv100 vlan-id 100<br>NAMEv200 vlan-id 200 routing-instance irb.1<\/p>\n\n\n\n<p>show bridge domain<br>show route instance<\/p>\n\n\n\n<p>interconnecting methods:<br>internal: loginal tunnel = only supported for VR -&gt; enable in PFE:<br>set chassis fpc 1 pic 0 tunnel-service bandwidht 1g =&gt; that creates le-1\/0\/x interface!<br>set interfaces le-1\/0\/10 unit 0 peer-unit 1<br>vlan-id 100<br>\u2026.<br>le-1\/0\/10 unit 1 peer-unit 0<br>vlan-id 200<br>\u2026.<\/p>\n\n\n\n<p>external: using physical interfaces, supported for VS and VR<\/p>\n\n\n\n<p>Logical-Systems: LSYS &#8211; max 15, offer routing and mgmt separation<br>set logical-systems LSYS-1 interfaces ge-1\/0\/5 unit 0 family bridge interface-mode access vlan-id 100<\/p>\n\n\n\n<p>show bridge domain logical-system LSYS-1<\/p>\n\n\n\n<p>interconnect: via logical-tunnel or physical loop<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">Provider Bridging LAB ***<\/h1>\n\n\n\n<p>802.1q<br>vlan id 12bit= 4094<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">802.1ad stacking vlans: c-vlan (inner tag) = one customer vlan \/ s-vlan (outer tag) = service vlan represent customer<\/h2>\n\n\n\n<p>issue: mac learning form customers<br>s-vlan tag: tag prot id (16b 0x88A8), priority (3b), drop eligibility (1 bit, default=0), unique vlan-id (12b)<br>c-vlan tag: 0x8100 canonical fomat indicator<\/p>\n\n\n\n<p>PBN = Provider Bridged Network<br>push, pop, swap, pop-pop, push-push, swap-swap, pop-swap, swap-push, rewrite vlan and tag-protocol-id<\/p>\n\n\n\n<p>Learning:<br>-IVL: independent vlan learning: learning domain for eachc VLAN (included BUM)#<br>-SVL: single learning domain shared by all vlans in a bridge domain<\/p>\n\n\n\n<p>set interfaces ge-0\/0\/0 flexible-vlan-tagging unit 0 vlan-id 200 \/\/ s-tag<br>family bridge interface-mode trunk<br>inner-vlan-id-list 111-114 \/\/ c-tag<\/p>\n\n\n\n<p>set bridge-domain NAME vlan-id 200 \/\/ s-tag<\/p>\n\n\n\n<p>customer edge port<br>set interfaces ge-1\/0\/0 vlan-tagging encapsulation flexible-ethernet-service unit 111 encapsulation vlan-bridge<br>vlan-id 111<br>input-vlan-map push vlan-id 200 \/\/ s-vlan<br>output-vlan-map pop<br>provider network port<br>set interfaces ge-1\/0\/4 stacked-vlan-tagging encapsulation flexible-ethernet-service unit 0 encapsulation vlan-bridge<br>vlan-tags outer 200 inner 111<\/p>\n\n\n\n<p>set bridge-domains NAME1 interface ge-1\/0\/0<br>ge-1\/0\/4<\/p>\n\n\n\n<p>vlan-id none =&gt; C-vlan pops before MAC table look-up<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">VPLS<\/h2>\n\n\n\n<p>for customer is just a LAN segment<br>PE learns MACs, MAC mapped to outbound LSP o interfaces<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">STP<\/h1>\n\n\n\n<p>broadcast storm, duplicated packets<br>slow convergence, excessive flooding, single tree<br>rstp: rapid<br>mstp: rapid and per instance<br>root bridge: loweest bridge id (priority + mac)<br>root port: port in a bride closest to the root bridge<br>default cost = 20k for 1G port<br>designated port: forwarding port on a LAN segment<br>BPDU: info about STP, 2sec<br>config: sent by root bridge<br>tcn: topology change notificatin: sent by any bridge towards root.<\/p>\n\n\n\n<p>blocking: doesnt sent BPDU, but listen<br>convergence: 2xforwading-delay (15s) + max-age (20)<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">RSTP 802.1w \/ 802.1d-2004<\/h2>\n\n\n\n<p>in p2p links: transition to forwarding without waiting for timers to expire<br>edge port: if unique port in LAN, then always forwarding<\/p>\n\n\n\n<p>new port-roles:<br>alternate: alternate path to root bridge (backup for root port). Block traffi while receiving superior BPDU<br>backup: backup of designated port. block traffic while receivng superior BPDU<\/p>\n\n\n\n<p>states: discarding (disabled, blocking, listening \/\/ role: alternate, backup, disable), learning, forwarding (role: root, designated, edge)<\/p>\n\n\n\n<p>bpdu: as keepalive (2s)<\/p>\n\n\n\n<p>mx full-duplex -&gt; port is p2p.<\/p>\n\n\n\n<p>format: flags,<\/p>\n\n\n\n<p>bridge id: priority (4b) + extended id (12b) + bridge address (48b)<\/p>\n\n\n\n<p>tcn: only when non-edge (intereconnect switches) port transition to fw state. Transition to discarding doesnt trigger tcn<br>initiator of tcn, sends out of all designated ports and root port.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code> received of tcn: doesnt flush MAC learned from edge-ports, doesnt flush MAC learned on the port receiving the TCN<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">MSTP 802.1s &#8211; 802.1q-2003<\/h2>\n\n\n\n<p>extension rstp<br>stp per vlan. MSTI. Maps 1or+ vlans to one MSTI -&gt; load-balancing<\/p>\n\n\n\n<p>MST region: MST switches with same region name, revision level and vlan-2-instance mapping<br>max 64 MSTI per region, one regional root bridge per instancce<\/p>\n\n\n\n<p>CST = common ST, interconnects MST regions, one root bridge for CST, each MSTP region appears as a virtual bridge<br>IST = internal ST, STP inside the region<\/p>\n\n\n\n<p>RSTP is used to interconnect MSTP regions or RSTP-only bridges<\/p>\n\n\n\n<p>VSTP: similat to RSTP, 4094 instances, proprietary<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">Configuring STP (MSTP Lab)<\/h1>\n\n\n\n<p>show spanning-tree interface<br>bridge<br>statistics interface<\/p>\n\n\n\n<p>set protocols rstp hello-time X max-age x forward-delay x bridge-priority x<br>interface ge-1\/0\/1 priority 128 mode point-to-point|shared cost x<br>edge (to host)<br>extended-system-id 0 (default)<\/p>\n\n\n\n<p>set protocols mstp configuration-name REGION1 revision-level x<br>interface ge-1\/0\/0<br>\u2026<br>msti 1 bridge-priority 4k vlan 100-199<br>msti 2 bridge-priority 8k vlan 200-299<\/p>\n\n\n\n<p>show spanning-tree mstp configuration<\/p>\n\n\n\n<p>set protocols vstp interface ge-1\/0\/1<br>\u2026<br>vlan 100 bridge-priority 60k<br>interface ge-1\/0\/1<br>\u2026<br>vlan 200 bridge-priority 8k<br>interface ge-1\/0\/1<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">bpdu protection<\/h2>\n\n\n\n<p>show spanning-tree interface<\/p>\n\n\n\n<p>set protocols rstp interface ge-1\/0\/1 edge<br>bpdu-block-on-edge<\/p>\n\n\n\n<p>if not rstp:<br>set protocols layer2-control bpdu-block interface [ ge-1\/0\/0 ge-1\/0\/1 ]<\/p>\n\n\n\n<p>show l2-learning interface<\/p>\n\n\n\n<p>clear error bpdu interface<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>loop protection -> on all root and alternate ports -> lack of BPDUs -> transition to &#8220;loop inconsistent state&#8221; = DIS state = blocking. Returns to origital state when receives BPDUs<\/li>\n<\/ul>\n\n\n\n<p>set protocols rstp interface ge-1\/0\/1 bpdu-timeout-action block<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>root protection: on ports shouldn&#8217;t be elected as root port (shouldn&#8217;t receive supeior BPDUs) -> If receive supeior BPDU -> transition to Inconsisent state. When stops receiving BPDUs, returns to the original state.<\/li>\n<\/ul>\n\n\n\n<p>set protocols rstp interface ge-1\/0\/1 no-root-port<\/p>\n\n\n\n<p>set protocols rstp force-version stp<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">Ethernet OAM<\/h1>\n\n\n\n<p>Operation Administration Maintenance &#8211; OAM<\/p>\n\n\n\n<p>availability, frame delay, frame delay variation (jitter), frame lost &#8211; 802.3-2008.clause &#8211; First mile OAM. Link Fault Management LFM<\/p>\n\n\n\n<p>detect defects: use of continuitity check messages (CCM), unidirect and without ack, by intervals<\/p>\n\n\n\n<p>indicators:<br>node detect failure -&gt; send AIS (Alarm Indicator Signal) and FDI (Forward Defect Indicator) downstream<br>node received AIS\/FDI -&gt; notifies upstream devices when failure occurs in reverse direction (BDI &#8211; Backward Defect Indicator)<\/p>\n\n\n\n<p>loopback messages:<br>nonintrusice loopback: like ping<br>intrusive loopback: signal a remote node to go into special test mode (where normal traffic can&#8217;t flow)<\/p>\n\n\n\n<p>Link Trace Messages LTMs: like traceroute. identify nodes along the path. perform bidir continuity check<\/p>\n\n\n\n<p>LFM: Link Fault Management is limitied to a single Ethernet link (no AIS available)<br>client needs to support LFM. L2, no IP needed. exchange OAM PDUs, dst MAC = 0180c2-000002 (never flooded). Discovery<br>Active client start the discovery<br>OAM PDU<br>codes:<br>0x00 information -&gt; discovery, heartbeat (1s), Critical events<br>0x01 event notification -&gt; signal link events and stats<br>0x02-03 variable request\/response (polling MIBs) &#8211; not supported in Junos<br>0x04 loopback control: signal remote peer to set\/unset looped interface<br>flags<br>bit 0: link fault<br>bit 1: dying gasp (external failure: ie power)<br>bit 2: critical event<br>bit 3-4: used during discovery<\/p>\n\n\n\n<p>CFM: Connectivity Fault Management<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>fault monitoring using continuity check CC (neighbor discovery and health check)<\/li>\n\n\n\n<li>path discovery and fault verifiation using LFM<\/li>\n\n\n\n<li>fault isolation using loopbak protocol<\/li>\n\n\n\n<li>frame delay measurement dst MAC, src MAC, vlan tag, type\/length, CFM header, Data(TLVs), FCS maintenance domains:<br>5-7: customer<br>3-4: SP<br>0-2: operator (subset SP network) quicker fault detection maintenacne point: Port of type:<br>MEP: Maintenance End Point: edge port to edge port (protecting E-Line) or EVC (Ethernet Virtual Connect) or<br>edge port to multiple edge ports (protecting E-LAN) or multipoint-to-multipoint EVC<br>MIP: Maintenance Intermidiate Point: internal to a domain. Optional. Respond to CFM messages from higher level than their own<br>Transparent: doesn&#8217;t respond to CFM messages task<br>initiate CFM message: MEP<br>respond to loopback and link trace messages: MEP, MIP<br>track CCM: MEP, MIP MEP: forms neighbor exchanging CCMs with other MEPs in same maintenance domain, maintenance association, level and direction<\/li>\n\n\n\n<li>Down MEP: MEP interface that faces a neighbor down MEP<\/li>\n\n\n\n<li>Up MEP: MEP interface that faces away from a neighboring UP MEP CCM maintenance 0 -> dst MAC 0180C2-000030 (multicast) | 38 (link trace)<br>7 7 | 3F (link trace) LBR: LoopBack Reply<\/li>\n<\/ul>\n\n\n\n<h1 class=\"wp-block-heading\">Configuring OAM (LAB)<\/h1>\n\n\n\n<p>** LFM config<br>set protocols oam ethernet link-fault-management action-profile NAME event link-adjacency-loss (when PDU are missing)<br>action link-down<br>interfacce ge-1\/3\/6 apply-action-profile NAME<br>pdu-interval 100 (ms)<br>link-discovery active<br>pdu-threshold 10<br>negotiation-options allow-mode-loopbackcs<br>remote-loopback -&gt; set a loop on the reote peer<\/p>\n\n\n\n<p>show oam ethenet link-fault-management<\/p>\n\n\n\n<p>&#8211;<\/p>\n\n\n\n<p>test looped circuit<\/p>\n\n\n\n<p>edit interface ge-1\/3\/5 unit 0 family inet<br>set address 10.0.0.0\/31 arp 10.0.0.1 mac<\/p>\n\n\n\n<p>ping 10.0.0.1 &#8211;&gt; It seem TTL exceed that is good!!! loop works<\/p>\n\n\n\n<p>** CFM config: customer bridge<br>set protocols oam ethernet connectivity-fault-management action-profile NAME event adjacency-loss<br>action interface-down<br>maintenance-domain customer leve 5<br>maintenance-association evc1 continuity-check internval 100ms<br>mep 101 inteface ge-0\/0.115 vlan 115<br>direction down<br>auto-discovery<br>remote-mep 106<br>action-profile NAME<br>provider bridge<br>set protocols oam ethernet connectivity-fault-management<br>maintenance-domain provider leve 4<br>maintenance-association evc1 continuity-check internval 100ms<br>mep 102 inteface ge-0\/0.115 vlan 115<br>direction up<br>auto-discovery<br>mip-half-function default<\/p>\n\n\n\n<p>show oam ethernet connecitivty-fault-management interface ge-1\/1\/5.115 vlan 115 [extensive]<\/p>\n\n\n\n<p>ping ethernet maintenance-domain customer maintenance-association evc1 mep 106<br><br>traceroute ethernet maintenance-domain customer maintenance-association evc1 mep 106<\/p>\n\n\n\n<p>monitor ethernet delay-measurement maintenance-domain customer maintenance-association evc1 mep 106 two-way<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">ERP and LAG<\/h1>\n\n\n\n<p>ERP = Ethernet Ring Protection &#8211; ITU-T G.8032. Replaces STP, less 50ms recovery for ring.<br>RPL = Ring protection Link. RPL-owner places RPF in blocking state during normal operation. When failure, RPL-owner puts RPL in forwarding<br>RPL-owner sents R-APS (Ring-Automatic Protection Switching) eachc 5sec<br>Normal node generates R-APS whne local link failure occurs. Listen and forward R-APS<br>APS requires a vlan to deliver R-APS. all vlans affeccted by APS. Uses CFM frame format Opcode = 40. Flags=0. dst MAC = 0119A7-000001<br>Frame fields: Request\/State 4bits 1011 (signal fail 0000 (no request), Reserved, RPL Blocked 1b, Do not flush 1b, Status Reserved 6b, NodeID (MAC(, Reserved<\/p>\n\n\n\n<p>config: must have eas and west-interfacce<\/p>\n\n\n\n<p>set protocols protection-group ethernet-ring PNAME<br>guar-interval x<br>node-id MAC<br>eas-interface ring-protecton-link-end<br>control-chnnel CHA-NAME vlan X interface<br>west-interface control-channel CHA-NAMe vlan X interface<br>ring-protectoin-link-owner<\/p>\n\n\n\n<p>show protection-group ethernet-ring aps [detail]<\/p>\n\n\n\n<p>LAG<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p>802.3ad<br>duplex, speed, max 8 link. RE generated traffic always sent on lowest member link. IP traffic hashing uses l2-4<\/p>\n\n\n\n<p>LACP: actor, partner (remote). Active or passive (default). you must one active end. Junos doesnt do automatic aggregation.<\/p>\n\n\n\n<p>set chassis aggregated-devices ethernet device-count x<\/p>\n\n\n\n<p>set interface ae0 unit 0 family bridge<br>aggregated-ether-options lacp active (1sec) \/ passive (30s)<br>ge-0\/0\/0 gigether-options 802.3ad ae0<br>ge-0\/0\/7 gigether-options 802.3ad ae0<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">MC-LAG and Virtual-Chassis<\/h1>\n\n\n\n<p>MC-LAG uses ICCP (Inter-Chassis Control Protocol, used TCP similar to BGP) to exchange info between nodes<br>active\/standby or active\/active (all links active, MCP cards onluy, must have a ICL link betweend devices)<\/p>\n\n\n\n<p>set switching-options service-id X (idem in both devices)<br>set protocols iccp local-ip-addre IP<br>peer IP2 redundancy-group-id-list x<br>liveness-detection minimym-interval 300<br>multiplier 3<\/p>\n\n\n\n<p>set interface ae0 aggregated-ether-option lacp active<br>periodic fast<br>system-id 00000000000<br>admin-key 1<br>mc-ae<br>mc-ae-id x<br>redundancy-group 1<br>chassis-id 0 (the other peer is 1)<br>status-contorl active (the other peer is standby)<br>mode activ-active<br>unit 0 family bridge interface-mode trunk<br>vlan-id-list XXX<br>multi-chassis-protection IP2 interface ge-0\/0\/x \/\/ the peer is: IP1 interface ge-0\/0\/x (only for active\/active)<\/p>\n\n\n\n<p>show iccp<br>show interfaces mc-ae<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">MX virtual-chassis:<\/h2>\n\n\n\n<p>inter chassis redundancy. VCCP, based on ISIS, MPC cards, recommend 10G interfaces for VCP ports.<br>primary router<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">Troubleshooting<\/h1>\n\n\n\n<p>show system processses<\/p>\n\n\n\n<p>show system core-dumps<br>file list \/var\/tmp\/<em>core<\/em><\/p>\n\n\n\n<p>edit protocols rstp<br>traceoptions<\/p>\n\n\n\n<p>show chassis routing-engine<\/p>\n\n\n\n<p>edit snmp<br>set health-monitor<\/p>\n\n\n\n<p>jflowv10 &#8211; mpc card<\/p>\n\n\n\n<p>edit services<br>flow-monitoring<br>version-ipfix<br>template NAME<br>ipv4-template<\/p>\n\n\n\n<p>edit forwarding-options sampling<br>instance NAME input rate 10<br>run-lenght 5<br>max-packet-per-second 30000<\/p>\n\n\n\n<p>edit chassis<br>tfeb<br>slot 0<br>sampling-instance X<br>inline-servies<br>flow-table-size<br>ipv4-flw-table-size 10<br>ipv6-flow-table-size 5 (requires reboot because by default is onlu ipv4)<\/p>\n\n\n\n<p>show services accounting status inline-jflow<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">port-mirroring<\/h2>\n\n\n\n<p>edit forwarding-options port-mirroring<br>input rate 1<br>family inet output inerface ge-0\/\/0.0 next-hop IP<\/p>\n\n\n\n<p>edit firewall family inet<br>filter port-mirror<br>term 1<br>then port-mirror<\/p>\n\n\n\n<p>ARP entry for the monitoring device<\/p>\n\n\n\n<p>show forwarding-options port-mirroring<\/p>\n\n\n\n<p>=========================================<br>Junos MPLS Fundamentalss On-Demand<br>=========================================<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">MPLS Intro<\/h1>\n\n\n\n<p>p2mp -&gt; avoid to run multicast<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">MPLS Mechanics<\/h1>\n\n\n\n<p>mpls header: 32b<br>label: 20 bits &#8211; no 0-15: reserved special use<br>label 3 = implicit null = pop label before sending. this label is sent by egreess PE to neighbor<br>label 0 (ipv4) \/ 2 (ipv6 = explicit null = the neihgbor uses label 0\/2<br>label 1 = router alert -&gt; pop label and process packet locally, push label 1 again, it is never on the bottom of the stack<br>tc (traffic class or EXP): 3b<br>s: 1b &#8211; bottom of stack 1=it is the bottom \/ 0= is not the bottom and there are labels underneath<br>ttl: 8b &#8211; by default copied from ip ttl<\/p>\n\n\n\n<p>LSP is unidirectional<br>head-end: ingress router<br>tail-end: egress router<\/p>\n\n\n\n<p>PHP: penultime hop poping<\/p>\n\n\n\n<p>inet.3 -&gt; all ingress LSP for the router. inet.3 is used to resolve bgp NH. BGP checks inet.0 and inet.3s, the protocol with lower AD wins (RSVP\/LDP is lower that ISIS OSPF etc). inet.3 is used for no-labeled traffic<\/p>\n\n\n\n<p>** You use install active when you want regular traffic (not BGP-labeled) to use the LSP directly \u2014 for example, in LSP ping tests, or when configuring static routes using LSPs.<\/p>\n\n\n\n<p>set protocols mpls label-switched-path R1-to-R2 to 192.0.2.2<br>set protocols mpls label-switched-path R1-to-R2 install 192.0.2.2\/32 active<\/p>\n\n\n\n<p>set routing-options static route 10.10.10.0\/24 next-hop 192.0.2.2<\/p>\n\n\n\n<p>show route table mpls.0 label 16 detail (mpls.0 = LFIB) &#8211; mpls.0 is used for labeled traffic. So mainly in P routers<\/p>\n\n\n\n<p>static LSP: rare in prod networks<\/p>\n\n\n\n<p>RSVP:<br>manual creation. but very powerfull<\/p>\n\n\n\n<p>LDP:<br>simple. automatically creates a full mesh LSPs. Follows the best path according your IGP -&gt; trade-off !!! for TE mainly<\/p>\n\n\n\n<p>SR:<br>MPLS SR advertise labels directly in OSPF\/ISIS -&gt; no extra protocol needed! It has best-path and TE capabilities.<\/p>\n\n\n\n<p>BGP-LU: BGP can advertise labels using special address-family. Run MPLs VPN between AS<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">MPLS STATIC LSP and forwarding plane<\/h1>\n\n\n\n<p>set interfaces ge-0\/0\/0 unit 0 family mpls (for data plane)<\/p>\n\n\n\n<p>set protocols mpls interface ge-0\/0\/0.0 (for control plane) -&gt; show mls interface (says noting about remote routers! only local)<\/p>\n\n\n\n<p>1.000.000 &#8211; 1.400.000 statuc labels<\/p>\n\n\n\n<p>!! unidirectioal !!<br>For ingress:<br>set protocols mpls static-label-switched-path NAME ingress next-hop PHY-IP to Lo.IP-egrees-PE push<\/p>\n\n\n\n<p>For transit (P)<br>set protocols mpls static-lable-switch-path NAME transit next-hop PHY-IP2 swap<\/p>\n\n\n\n<p>For PHP (P)<br>set protocols mpls static-label-switch-path NAME transit pop next-hop PHY_PE_IP<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>you can use LSP as NH for static route<br>set routing-options static route NET\/2x static-lsp-next-hop LSP_NAME<\/li>\n<\/ul>\n\n\n\n<p>show mpls static-lsp ingress|transit<\/p>\n\n\n\n<p>show route table mpls.0 (routing based on incoming labels) you may see (S=0) that&#8217;t the stack-bottom bit !!!<\/p>\n\n\n\n<p>show route Lo.IP-egrees-PE =&gt; will show the static lsp in inet.3 !!<\/p>\n\n\n\n<p>show route NET_advertised_by_egrees_PE [detail]<\/p>\n\n\n\n<p>set protocols mpls icmp-tunneling =&gt; show mpls hops in traceroute<\/p>\n\n\n\n<p>set cli logical-system X<br>clear cli logial-system -&gt; back to main system<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">RSVP INTRO<\/h1>\n\n\n\n<p>create RSVP LSP at ingress router. Every other hop takes care by itself.<\/p>\n\n\n\n<p>feature rich. backup standby LSP from headend (ingress), create local-repair LSP to protect from link\/node failure.<\/p>\n\n\n\n<p>ospf\/isis used for advertise TE. default by isis.<br>TE is stored in TED.<br>RSVP can use TED: ERO = Explicit Route Object, created by ingress PE, and each router in path obeys ERO.<br>or LSDB: isis\/ospf, follows best path hop by hop, no ERO<\/p>\n\n\n\n<p>set interfaces ge-0\/0\/0 unit 0 family mpls (for data plane)<\/p>\n\n\n\n<p>set protocols mpls interface ge-0\/0\/0.0 (for control plane) -&gt; show mpls interface (says noting about remote routers! only local)<\/p>\n\n\n\n<p>set protocols rsvp interface ge-0\/0\/0.0 (for control plane) -&gt; show rsvp interfaces (idem) \/ show rsvp neighbor<\/p>\n\n\n\n<p>enable firewall if CoP enabled!<br>set firewall family inet filter NAME term RSVP from protocol rsvp then accept<br>MPLS_PING from protocol udp port 8503 then accept.<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">RSVP: config basic LSP<\/h1>\n\n\n\n<p>set protocols ospf areo 0.0.0.0 interface X.0 interface-type p2p<br>\u2026<br>interface lo0.0<br>reference-bandwidth 100g<\/p>\n\n\n\n<p>set protocols mpls (!!!) label-switched-path NAME to lo.IP.egreess_PE no-cspf (turns-off constrained shortest path first -&gt; dont use TED!!)<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>confirm your lsp with &#8220;Resv messages&#8221; (from destination back to origin)<\/li>\n<\/ul>\n\n\n\n<p>show mpls lsp [name NAME] [ingress, transit, egress] [extensive]<br>RRO=Record route object -&gt; each hop adds to this object to indicate the full end-to-end path. avoid loops too!<\/p>\n\n\n\n<p>show rsvp session<\/p>\n\n\n\n<p>show route table inet.3<br>show route NET\/x (advertised by egrees PE)<\/p>\n\n\n\n<p>mpls self-ping: check if lsp is ready to forward traffic because lsp are unidirect!<br>udp ping sent down the lsp: src: r1 dst: r1<br>udp ping returned as regular IP traffic (not via LSP!!!)<br>-needed for backup\/local repair paths! if mpls self-ping doesnt work, traffic will never be moved over to these backups<\/p>\n\n\n\n<p>hello message<br>path message: head-end to tail-end<br>resv message: tail-end to head-end. confrirm the lsp was successful<\/p>\n\n\n\n<p>messages contain many objects.<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">RSVP TED<\/h1>\n\n\n\n<p>bw visibility, tag links. Every router has almost identical TED. ISIS gives hostname!! OSPF gives router Id number -&gt; difficult!<\/p>\n\n\n\n<p>show ted database [extensive ]<br>remote: 0.0.0.0 -&gt; pseudonode = LAN<\/p>\n\n\n\n<p>ISIS TLVs.<br>show isis database extensive<\/p>\n\n\n\n<p>set protocols mpls label-switched-path NAME to lo.IP.egreess_PE<\/p>\n\n\n\n<p>show mpls lsp [name NAME] detail -&gt; shows ERO. Transit router never calculate an alternate path. ERO can be strict or loose<br>extensive -&gt; shows CSPF<\/p>\n\n\n\n<p>stric: hops must be directly connected.<br>loose: can be many hops away<\/p>\n\n\n\n<p>set protocols mpls path NAME_PATH lo0.PEx loose<br>set protocols mpls path NAME_PATH lo0.PEy strict<\/p>\n\n\n\n<p>set protocols mpls label-switched-path NAME_LSP to lo.PEz primary NAME_PATH<\/p>\n\n\n\n<p>&#8212;<\/p>\n\n\n\n<p>set protocols ospf traffic-engineering -&gt; LSA type10 &#8211; opaque LSA, not sent outside area<br>show ospf database opaque-area [extensive lsa-id IP advertising-router Lo0.PE]<\/p>\n\n\n\n<p>&#8212;<br>you can use TE features in a non-TE network but are limited<br>-ERO: but hops in between stil decide the best next hop<br>-bw reservation: if no bw, lsp can&#8217;t find another path.<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">RSVP LSP bw reservation<\/h1>\n\n\n\n<p>It uses CSPF<br>lsp priority: when there is no enough bw, the lsp with higher priority can force low priority lsp to find alternative path.<br>bw reservation is not a policer! it is just a reservation at control plane<\/p>\n\n\n\n<p>manual bw reservation are hard -&gt; auto-bw, but complicated. not showed in this curse.<\/p>\n\n\n\n<p>set protocols mpls label-switch-path NAME1 to lo0.PE1 bandwidth Xm<br>show mpls lsp name NAME1 detail<br>show rsvp interface<br>show ted database extensive lo0.PE1<\/p>\n\n\n\n<p>oversubscribe vs undersubscribe<br>set protocols rsvp interface ge-0\/0\/0.0 subscription 500 -&gt; oversubscribe link by 5x!<br>1.0 bandwidth 2g -&gt; change the total bw. For example if physical is 1g, now you say it is 2g.<\/p>\n\n\n\n<p>monitor labeled-swith-path NAME -&gt; show traffic stats<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Juniper Paragon: monitor LSP<\/li>\n<\/ul>\n\n\n\n<h1 class=\"wp-block-heading\">RSVP LSP Priorities<\/h1>\n\n\n\n<p>solve issue from bw reservation. first lsp gets best path. Or some LSP may not come up<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>the bin packing problem: pack big items first<br>priority: 0 = best \/ 7 = worst. Priority only matters: 1) best path cannot offer enough bw. low-priority may not come up if no bw availabel anywhere.<br>2) box has many lsp: high priority signaled first. Equal priority, signalled alphabetical order<\/li>\n<\/ul>\n\n\n\n<p>Two values: setup priority (default 7): value used to install lsp in a path. It is compared with the hold value of other lsp<br>hold priority (default 0): value used to keep a lsp. this is compared with the setup priority of a contenden lsp.<br>=&gt; if setup is better (lower value) than hold -&gt; existing lsp is kicked off<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>lsp setup priority can never be better than its hold priority !!! Only preempt if better (if equal, no changes)<\/li>\n<\/ul>\n\n\n\n<p>set protocols mpls label-switch-path NAME1 priority SETUP HOLD &#8211;&gt; This can trigger LSP flaps !!!!s<\/p>\n\n\n\n<p>show mpls lsp name NAME detail<br>show ted database Lo0.PE.NAME extensive<\/p>\n\n\n\n<p>set groups RSVP_PRIO protocols mpls labeled-switched-path &lt;*&gt; priority 5 4<br>set apply-groups RSVP_PRIO<br>show configuration protocols mpls | display intheritance no-commens<\/p>\n\n\n\n<p>default: lsp rerouting is not graceful!!! because it turns down and signals a new path<br>-&gt; sol: soft-preemption<br>set groups RSVP_PRIO protocols mpls labeled-switched-path &lt;*&gt; soft-preemption<br>&#8211;&gt; find a new path first, move traffic, and if good for 30s, delete old path<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">CSPF and Adming Groups<\/h1>\n\n\n\n<p>CSPF = Constrained Shortest Path First. Used TED. like SPF<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>compute LSPs one at a time &#8211; Start with high-priority LSP, tie braker is alphabetic order.<\/li>\n\n\n\n<li>links are pruned if: not enough bw, dont contain mandatory tag or tagged to be avoided<\/li>\n\n\n\n<li>strict and loose hops are considered<\/li>\n\n\n\n<li>equal cost paths? -> choose the one with least hops, if still equal, choose random (default) or available bw ratio (most full path or least full path)<br>100G with 60G reserved = 40% avail bw ratio<br>10G with 1G reserved = 90% avail bw ratio<br>least-fill -> highest avail bw ratio<br>most-fill -> lowest avail bw ratio -> good to avoid bin packing prob<\/li>\n<\/ul>\n\n\n\n<p>set protocols mpls label-switched-path NAME to IP [random, most-fill, lest-fill]<\/p>\n\n\n\n<p>Admin Groups = affinity group, link coloring. Group link to be avoided or be used. This is unidirectional !!!<\/p>\n\n\n\n<p>set protocols mpls admin-groups ADGROUP [0-31] -&gt; only number is advertised !!! so you have to map the names to number in each device when writing config!!!<br>it is a 32-bit value, so an interface can &#8220;activate&#8221; several groups.<br>set protocols mpls interface ge-0\/0\/0.0 admin-group ADGROUP<\/p>\n\n\n\n<p>set protocols mpls lable-switched-path LSP to PE-IP adming-group [include-any | inclide-all | exclude ] [GROUP1 GROUP2]<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>if you tag a link AFTER an LSP is up, nothing happens by default or you can configure self-optimize<br>ie: to put a pure P transit router in maintenance, just add all links into &#8220;MAintenance&#8221; group and have all LSP to exclude Maintenance, and add self-optimize<\/li>\n<\/ul>\n\n\n\n<h1 class=\"wp-block-heading\">LSP Failures, errors and session Maintenance<\/h1>\n\n\n\n<p>messages: (path-&gt;egress(direct path) \/ resv-&gt;ingress(return path))<\/p>\n\n\n\n<p>PathTear: towards egress (direct path: downstream). Tear down LSP<br>ResvTear: towards ingress (return path: upstream)<\/p>\n\n\n\n<p>PathErr: towards ingrees (upstream). Commumicate errors info<br>ResvErr: towards egress (downstream)<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>diffent direct from Tear messages!!! This is slow process until the ingress PE received the ResvTear and a new LSP is programmed<br>sol: backup local repair lsp: pre-signaled lsp around link or node failures. each hop can generate a local repair path<br>secondary path: pre-signaled and with differnt constrains from primary<\/li>\n<\/ul>\n\n\n\n<p>overload reduction:<br>initial: soft-state (it was like UDP)<br>rfc 2961: rsvp refresh overhead reduction extensions<br>hello are optional: default 9sec in junos (hello-interval)<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">Primary and secondary path<\/h1>\n\n\n\n<p>Primary is used. several secondary paths can be defined. secondary is calculated if primary goes down.<br>Scondary is used until primary is recovered, after 60s.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>constraints -> + diversity<\/li>\n\n\n\n<li>constraints -> + difficult to scale<\/li>\n<\/ul>\n\n\n\n<p>set protocols mpls path PATH1 PE1-LO loose<\/p>\n\n\n\n<p>set protocols mpls label-switched-path LSPx to PEx-Lo primary PATH1 secondary PATH2 secondary PATH3<\/p>\n\n\n\n<p>retry-limit: default 0 (unlimiited) &#8211; number of times will try to find a new primary<br>retry-timer: default 30s &#8211; time between attempts<br>revert-timer: default 60s &#8211; (0 = never revert) once primary is up, wait x sec before move traffic to primary<br>or dont define primary, and just define secondary paths for the lsp<\/p>\n\n\n\n<p>set protocols mpls label-switched-path LSP1 secondary PATHx select manual &#8211;&gt; secondary path comes up immediately and used for forwarding.<br>-&gt; this is very manual!!1 ie: used for re-route traffic when node in maintenance -&gt; all LSP going through that node need the &#8220;select manual&#8221;<\/p>\n\n\n\n<p>&#8212;<\/p>\n\n\n\n<p>defining secondary constraints is manual and tedious<br>-&gt; sol: secondary standby paths: pre-calculated, pre-signaled and always-up. It adds a temp metric of 8M to each link used by primary path.<\/p>\n\n\n\n<p>set protocols mpls label-switched-path LSP1 to PEx-Lo primary BLANK_PRIMARY secondary BLANK_SECONDARY standby!<br>set protocols mpls path BLANK_PRIMARY (without constraints!)<br>set protocols mpls path BLANK_SECONDARY (without constraints!)<\/p>\n\n\n\n<p>show mpls lsp ingress LSP1 detail<\/p>\n\n\n\n<p>trade-off: standby secondary -&gt; double up number RSVP tunnels<br>if standby is configured with bw constraints -&gt; you may artificially run out of RSVP bw.<\/p>\n\n\n\n<p>show route IP\/x detail | match &#8220;inet.0|IP|via|Push&#8221;<br>-&gt; you see path for primary and secondary in RIB, but only lowest weigh route is installed in FIB!!<br>if you want both installed (but only the primary actually used) you need to configure LB (as per JNCIA and below)<\/p>\n\n\n\n<p>show route forwarding-table matching IP\/x extensive<\/p>\n\n\n\n<p>enable LB in FIB:<br>set policy-options policy-statement LB then load-balace per-packet<br>set routing-options forwardinig-table export LB<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">Local-Repair P1: 121 backup or FRR (Fast Reroute)<\/h1>\n\n\n\n<p>protect agains link and node failure, reduce downtime -&gt; always-on backup LSP at the &#8220;point of local repair&#8221;. Used short time until headend calculate new LSP<br>Local repair sens PathErr to head-end to program new lsp. It does only node protection<\/p>\n\n\n\n<p>rfc 4090<br>-121 backup: 1 backup path (&#8220;detour&#8221;) for each LSP. At each hop along the path! (scale issues) pointing to the tailend!!! = Fast-Reroute<br>&#8211; node protection, find fastest path to tailend<br>&#8211; as it creates many LSP, some nodes can &#8220;merge&#8221; detour (1+ ingress) and only generate 1 egress detour<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code> set protocols mpls label-switched-path LSP1 to PE-IP fast-reroute &#91;hop-limit 6=default | bandwidth 0=default | include-any GROUP]\n   + CONFIGURE LB in FIB\n\n show mpls lsp ingress extensive\n show rsvp session detail\n show mpls lsp transit -&gt; detour lsp uses the same name as the main lsp!!! so you can't figure out if it is a detour!\n                          detour number x means the number of detour have been merged to x detour\n  -&gt; show rsvp session detail | match \"Detour branch from\" -&gt; This can help you to figure out if it is a detour\n                                                              and if several detour branch have the same \"label out\" =&gt; it is merged!<\/code><\/pre>\n\n\n\n<h1 class=\"wp-block-heading\">Local-Repair P2: Facility Backup or Node-Link-Protection<\/h1>\n\n\n\n<p>-facility backcup: 1 backup pth (&#8220;bypass&#8221;) for many LSP. = link-protection or node-link-protectio (better). Scales better in big networks<br>it is a separate, standalone LSP with its own name. The bypass LSP pushes a second label !! There is PHP to pop the second label. It doesnt signal to the tailend.<\/p>\n\n\n\n<p>bypass to next-hop -&gt; protects link-failure<br>bypass to next-next-hop -&gt; proteccts link and node failure. trade-off: LSP is longer, may impact delay-sensitive traffic<\/p>\n\n\n\n<p>set protocols rsvp interface ge-0\/0\/0.0 link-protection [on all links you want link-protection\/node-protection]<br>set protocols mlps label-swtiched-path LSP1 to PEx-lo [link-protection | node-link-protection ]<\/p>\n\n\n\n<p>show route IP\/x [detail] -&gt; you can see Bypass!! it has hight weight, the bottom label is the one for identifying the next-next-hop,<br>and top label for the bypass lsp that is the next node.<br>show route table inet.3<br>show mpls lsp<br>show mpls lsp bypass ingress<br>show rsvp sesion ingress -&gt; all lsps included bypass<\/p>\n\n\n\n<p>big networks -&gt; facility backup if they support 3 labels at least, if not, use FRR<br>but one bypass LSP can overwhelm a link! -&gt; setup several bypass or put bandwidht reservation for each bypass<\/p>\n\n\n\n<p>ring topology + 121 -&gt; ech router merges incomeing detour into its outgoing detour<br>+ node-protection -&gt; traffic has to make a U-turn twice !!! (need drawing)<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">RSVP LSP Optimization<\/h1>\n\n\n\n<p>lsp stays in same path until tear-down or kicked-out by LSP with lower priority value<br>optimization -&gt; runs CSPF periodically<\/p>\n\n\n\n<p>global: set protocols mpls optimize-timer X (0s=never until 65535s)<br>indiv: set protocols mpls label-switched-path LSP1 to PE-Lo optmize-timer X<\/p>\n\n\n\n<p>manual: clear mpls lsp name LSP optimize -&gt; It will not clear it!!!<\/p>\n\n\n\n<p>conditions for LSP optimization<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>new CSPF metric must not be higher than old path<\/li>\n\n\n\n<li>if metrics are same, new path must no have more hops<\/li>\n\n\n\n<li>new path must not cause preemption of other lsps<\/li>\n\n\n\n<li>new path must not have worse &#8220;available bw ratio&#8221; (but only the 4 lowest ratios are compared in the path no matter how long)<br>if least-fill used, new path should be at least 10% less than current path<\/li>\n<\/ul>\n\n\n\n<p>set protocols mpls optimize-aggressive -&gt; optimized purely in IGP metric!<br>clear mpls lsp name LSP optmize-aggressive<\/p>\n\n\n\n<p>optmize detour and bupass:<br>set protocols rsvp fast-reroute optimize-timer (0..65535)<\/p>\n\n\n\n<p>set protocols rsvp interface ge-0\/0\/0 link-protecton optimize-timer (0..65535)<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">RSVP Make-before-break and adaptive<\/h1>\n\n\n\n<p>when link\/node down, temporarily, there are two copies same LSP: same name, same tunnel ID but different LSP ids -&gt; show rsvp session<\/p>\n\n\n\n<p>MBB: make before break: traffic is hitlessly moved to an alternative path<br>show mpls lsp name LSP extensive<\/p>\n\n\n\n<p>outside scope: auto-bw and p2mp lsp (l2vpn course &#8211; vpls)<\/p>\n\n\n\n<p>preventing double-counting of bw: this happens with two copies of the same LSP share a link. By default, routers see two copies of same LSP as tehy are different LSPs -&gt; problem<\/p>\n\n\n\n<p>sol: reservation style:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>fixed filter FF: default, cannot share bw reservations. two of same lsp are treated as separate lsps<\/li>\n\n\n\n<li>shared explicit SE: two of same lsps can share a bw reservation -> &#8220;adaptive&#8221; knob<\/li>\n<\/ul>\n\n\n\n<p>set protocols mpls label-switched-path LSP1 adaptive \/\/ it enabled MBB<br>show rsvp session extensive name LSPx -&gt; look for &#8220;Resv style&#8221;<\/p>\n\n\n\n<p>map traffic to rsvp lsp:<br>set policy-options policy-statement MAP term T1 from route-filer IP\/x exact then install-nexthop lsp LSP1 accept<br>next-hop ingress-PE-Lo<br>match bgp community list<br>term T2 from route-filter IP2\/y exact then install-nexthop lsp LSP2 accept<br>term T3 then accept<\/p>\n\n\n\n<p>set routing-options forwarding-table export MAP<\/p>\n\n\n\n<p>show route IP\/x<br>IP2\/y<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">LDP &#8211; INTRO<\/h1>\n\n\n\n<p>automatic full-mesh lsp to loobacks, follows igp best path -&gt; inet.3<br>No TE.<br>FEC = forwarding equivalence class = set of traffic is forwarded through an LSP<br>PE Lo0 is a FEC<\/p>\n\n\n\n<p>RSVP: ingress router send a Path message = &#8220;downstream on deman&#8221; &#8211;&gt;<br>LDP: egrees router advertises a FEC for itself unprompted = &#8220;downstream unsolicited&#8221; &lt;&#8211;<\/p>\n\n\n\n<p>Ordered control: junos only advertised a FEC when it has received a label downstream<br>Liberal label retention: junos keep all labels they receive (speeds up recovery for link\/node failures)<\/p>\n\n\n\n<p>LDP LSP are like a tree -&gt; multipoint-to-point LSP (the top is the originating PE.lo=FEC) Every PE has a LSP to the egress = top<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">LDP &#8211; CONFIG<\/h1>\n\n\n\n<p>hello msg: dst IP: 224.0.0.2. it containes the lo.0 so then they can start TCP sesion. TCP started by highest Lo IP<br>tcp: 646<\/p>\n\n\n\n<p>header: version:1 , LSR ID = loopbackc, Label Space ID = 0 (any label can be used)<\/p>\n\n\n\n<p>set protocols ldp interface ge-0\/0\/0.0 (not needed in the loopback) (CP)<br>set protocols mpls interfacce ge-0\/0\/0.0 (CP)<br>set interfaces ge-0\/0\/0.0 unit 0 family mpls (DP)<\/p>\n\n\n\n<p>set firewall family inet filter LO term LDP from protocol tcp udp port ldp then accept<\/p>\n\n\n\n<p>show ldp interface [detail | extensive]<br>show ldp neighbor [extensive] (physical interfaces)<br>show ldp session [Lo.IP detail] (loopback interfaces) -&gt; two negihbor routers, have as many neighbor as interfaces, but only one session<br>show ldp databse [session lo.IP]<br>show route table inet.3<br>show ldp traffic-statistics<br>clear ldp session\/neighbor [all | lo.IP]<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">LDP &#8211; ENHANCEMENTS<\/h1>\n\n\n\n<p>ldp-igp sync: If not ldp in best path, mpls packets are dropped<br>with &#8220;ldp-synchronization&#8221;, router advertises a high metric (isis\/ospf) until LDP is up. Once it is up for 10s, the metric changes to real value<\/p>\n\n\n\n<p>set protocols isis interface ge-0\/0\/0.0 ldp-synchronization (only in p2p interface!!!!)<\/p>\n\n\n\n<p>by default ldp metric = 1 -&gt; if used with BGP multipath =&gt; LDP can LB with un-equal cost paths.<br>-&gt; change that<br>set protocols ldp track-igp-metric<\/p>\n\n\n\n<p>&#8220;session-protection&#8221; creates an always-up multihop LDP neighborship from loopback to loopback. The router were adjacent, but the link went down.<br>set protocols ldp interface lo0.0<br>set protocols ldp session-protection<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">LDP &#8211; EGRESS, IMPORT, EXPORT<\/h1>\n\n\n\n<p>egress policies: advertise other FECs apart from PE lo0.<\/p>\n\n\n\n<p>set policy-options policy-statement LDP_EGRESS term export from route-fileter CPE-LO\/32 route-filter PE-LO\/32 (default term is rejecT!!!)\u2026 then accept<br>set protocols ldp egress-policy LDP_EGRESS<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>this will advertise all new FECs with the same transport label (aggregation) -> load-balancing is not going to be possible<br>if you want LB:<br>set protocols ldp deaggreate (in all routers!!!)<\/li>\n<\/ul>\n\n\n\n<p>import\/export: act on FECs that already exist<br>import: tag received FEC as filtered in LDP db. Prevent FEC to be imported into inet.3 and to be readvertised<br>set policy-options policy-statement LDP_IMPORT term block from route-fileter PEx-LO\/32 then reject<br>term rest then accept<br>(** default policy for LDP is to accept all in import but make it clear)<br>set protocols ldp import LDP_IMPORT<br>show ldp database session PE-Lo<br>show route table inet.3 PE-Lo<\/p>\n\n\n\n<p>export: Prevent accepted FEC to be readvertised<br>set policy-options policy-statement LDP_EXPORT term block from route-fileter PEx-LO\/32 then reject<br>term rest then accept (**default ldp export policy for LDP is to reject all!!!)<br>set protocols ldp export LDP_EXPORT<\/p>\n\n\n\n<p>-ldp tunneling<br>-ldp local repair<br>-ldp auth<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">SEGMENT ROUTING<\/h1>\n\n\n\n<p>2010 &#8211; SR or SPRING. shortest-path, TE and local-repair. Source-based routing.<br>SRv6: uses ipv6 headers instead of mpls labels<\/p>\n\n\n\n<p>SR advertises labels using is-is\/ospf, so all routers know the labels that every other router has assinged, router can build a stack of labels to specify an exact path: huge reduction in state -&gt; no extra adjecencis (rsvp\/ldp), TE lsp dont need to be signaled<\/p>\n\n\n\n<p>segment = link, router, prefix, etc. each segment has SID (segment ID). All advertised by isis\/ospf<\/p>\n\n\n\n<p>Adj SID: label allocated to each link running isis\/ospf. One label for ipv4 and other for ipv6<br>Node SID: router. populate inet.3<\/p>\n\n\n\n<p>set interface ge-0\/0\/0 unit 0 family mpls (DP)<br>set protocols mpls interface ge-0\/0\/0.0 (CP)<br>set chassis network-services enhanced-ip =&gt; reboot !!!<br>set protocols isis source-packet-routing<\/p>\n\n\n\n<p>show isis adjacency R4 detail<br>show isis databse R3 detail<br>Flags: F (family) no set = ipv4 \/ set = ipv6<br>V value<br>L local signigicant<br>P persistent SID across reboots<br>B backup = local-repair<br>S belongs to set of interfaces for unequal-cost load balancing<\/p>\n\n\n\n<p>show route table mpls.0 label X<\/p>\n\n\n\n<p>Controller for generating stack of labels: Juniper Paragon Pathfinder.<\/p>\n\n\n\n<p>Replace LDP: no need label stacks, no need external controller. SR can use the same transport label at every hop.<br>each router allocates a block of labels (advice: configure the same block in each router)<br>eachc router has a uniquer id = node SID -&gt; mpls label = node SID + starting label<br>*ldp generates a label for itself and for each received FEC.<br>*SR advertise an entire block of labels = SRGB = SR Global Block. By default SRGB=4096<\/p>\n\n\n\n<p>set protocols isis source-packet-routing node-segment ipv4-index 405<br>ipv6-index 605<\/p>\n\n\n\n<p>(same in all routers)<br>set protocols isis source-packet-routing srgb start-label 800000<br>index-range 4000 (by default is 4096) -&gt; 50% for ipv4 and 50% for ipv6.<\/p>\n\n\n\n<p>show route table mpls.0 label XXX<\/p>\n\n\n\n<p>when you configure node SIDs on each router, you will find that inet.3 is automatically populated with a full mesh of shortest-paths LSP to each other router, like LDP =&gt; show route table inet.3<\/p>\n\n\n\n<p>calculating label = next-hop router starting label + router destination SID<\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>JNCIS-SPJunos Intermediate Routing On-Demand &#8211; DONEJunos Service Provider Switching &#8211; DONEJunos MPLS Fundamentals &#8211; DONE https:\/\/jlabs.juniper.net\/vlabs =========================================Junos Intermediate Routing On-Demand========================================= CBT Junos Tunnels gr-0\/0\/0 GREip-0\/0\/0 IPoverIP set chasis fpc 1 pic 2 tunnel-services [bandwidth X]&#8211;&gt; enable tunnels in x-1\/2\/x GRE header: 24bytes = 20byes IP header + 4bytes (reserv, version, protocol type) =&gt; increase MTU &hellip; <a href=\"https:\/\/blog.thomarite.uk\/index.php\/2025\/06\/30\/jncis-sp\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;JNCIS-SP&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[],"class_list":["post-2009","post","type-post","status-publish","format-standard","hentry","category-networks"],"_links":{"self":[{"href":"https:\/\/blog.thomarite.uk\/index.php\/wp-json\/wp\/v2\/posts\/2009","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.thomarite.uk\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.thomarite.uk\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.thomarite.uk\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.thomarite.uk\/index.php\/wp-json\/wp\/v2\/comments?post=2009"}],"version-history":[{"count":1,"href":"https:\/\/blog.thomarite.uk\/index.php\/wp-json\/wp\/v2\/posts\/2009\/revisions"}],"predecessor-version":[{"id":2010,"href":"https:\/\/blog.thomarite.uk\/index.php\/wp-json\/wp\/v2\/posts\/2009\/revisions\/2010"}],"wp:attachment":[{"href":"https:\/\/blog.thomarite.uk\/index.php\/wp-json\/wp\/v2\/media?parent=2009"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.thomarite.uk\/index.php\/wp-json\/wp\/v2\/categories?post=2009"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.thomarite.uk\/index.php\/wp-json\/wp\/v2\/tags?post=2009"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}