{"id":2127,"date":"2026-04-06T19:52:56","date_gmt":"2026-04-06T18:52:56","guid":{"rendered":"https:\/\/blog.thomarite.uk\/?p=2127"},"modified":"2026-04-06T19:52:56","modified_gmt":"2026-04-06T18:52:56","slug":"jncip-sp","status":"publish","type":"post","link":"https:\/\/blog.thomarite.uk\/index.php\/2026\/04\/06\/jncip-sp\/","title":{"rendered":"JNCIP-SP"},"content":{"rendered":"\n<p>JNCIP-SP<br>JN0-664<br>https:\/\/www.juniper.net\/us\/en\/training\/certification\/tracks\/service-provider-routing-switching\/jncip-sp.html<br>Advanced Junos Service Provider Routing On-Demand &#8211; DONE<br>Junos Layer 2 VPNs On-Demand<br>Junos Layer 3 VPNs On-Demand<\/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>Advanced Junos Service Provider Routing On-Demand<br>=========================================<\/p>\n\n\n\n<p>OSPF for SP<br>============<br>ip protocol 89<br>DR in ethernet segment: highest priority (def 128), highest RID.<br>P2P dont need DR: save 40s wait time<br>packet types:<br>hello: fomr and maintain adj<br>DB descriptor: header info for contents of LSDB<br>LS request: request copy of neighbor LSA<br>LS update: advertise LSA into network<br>LS ack: ack, ensure reliable floodingof LSAs<br>States: Down, Init, 2Way, ExStart, Exchange, loading, full<br>Areo0, ABR: genreate LSA3 from areaX into area0 and viceversa.<br>add lo0.0 into ospf<br>set routing-options router-id LO.IP !!!!! must be unique<br>if lo0 has several ips<br>set protocols ospf area 0.0.0.0 interface LO.IP.x (instead of interface name)<\/p>\n\n\n\n<p>LSA types:<br>max age: 1h, need refresh 3000sec<br>LSA1 router: sent by each router to describe its links and status<br>LSA2 network: sent by DR<br>LSA3 summary: sent by ABR to describe routers from area into another<br>LSA4 ASBR summary: sent by ABR to describe ASBR<br>LSA5 external: sent by ASBR to describe routers external to ospf<br>LSA7 NSSA: sent by ASBR in an NSSA to describe external router<br>LSA9,10 opaque: TE<\/p>\n\n\n\n<p>LS update packet: 24b OSPF header, 4b (num of LSAs), variable: LSA header (20b), LSA data (var), repeat<\/p>\n\n\n\n<p>LSA header 20b<br>LS age: 2b &#8211;<br>Options: 1b &#8211; E=external, P=NSSA<br>LS type: 1b &#8211;<br>LS ID: 4b &#8211; very vary\u2026<br>Adv Router: 4b &#8211; RID of originator<br>LS seq nu: 4b &#8211; increases with each change<br>LS checlsum: 4b<br>Length: 2b<\/p>\n\n\n\n<p>LSA1 Router: &gt; show ospf database router extensive<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>= generated the LSA<br>cost: cost of sending out packer in the interface<br>bits: V virtual link 0x4<br>E by ASBR 0x2<br>B by ABR 0x1<br>Link ID: far side of the link<br>MT = multi topology link type link ID Link Data<br>1 p2p neighbors RID local router interface IP<br>2 transit DR interface IP local router interface IP<br>3 stub Network subnet mask<br>4 virtual neighbors RID local router interface IP<\/li>\n<\/ul>\n\n\n\n<p>LSA2 Network: &gt; show ospf database network extensive<br>ID: IP of DR in the segment<br>Adv Router: DR lo<br>attachced router: RID of each router attached<\/p>\n\n\n\n<p>LSA3 Summary: &gt; show ospf databse netsummary extensive<br>ID: IP advertised<br>Adv Rtr: RID of advertising router<\/p>\n\n\n\n<p>LSA4 ASBR summary: &gt; show ospf database asbrsummary extensive<br>Area: 0.0.0.0 (sent to this adjacent area)<br>ID: RID of ASBR<br>Net mask: no meaning<br>Adv Rtr: RID of advertising router<\/p>\n\n\n\n<p>LSA5 External: &gt; show ospf database external extensive (not stored as part of any area)<br>generated ASBR<br>E bit: type external metric: type1: add metric to ASBR, type2: only add external metric<br>ID: IP advertised<br>Adv Rtr: RID of advertising router<\/p>\n\n\n\n<p>LSA7 NSSA: &gt; show ospf database nssa extensive<br>generated by ASBR in NSSA. Has area scope, not advertised to other areas (as lsa7), the ABR will transate to lsa5. Other routers in the area get the lsa7. If there are several ABR in the NSSA, the hightest RID does the lsa7-&gt;5 translation. doesnt require lsa4<br>lsa7 format is identical to lsa5. only diff, lsa7 uses FWd addr: can be the RID of the originater or the connected IP to reach it<br>only nssa-capable routers can interpret type7.<\/p>\n\n\n\n<p>LSA9 Graceful restart &#8211; link local scope<br>LSA10 MPLS TE &#8211; are scope<\/p>\n\n\n\n<p>OSPF DB protection<\/p>\n\n\n\n<p>SPF: candidate db, tree db and LSDB<br>you can&#8217;t block lsa flooding, just use &#8220;set protocols ospf import X&#8221; to block external routes in the routing table<\/p>\n\n\n\n<p>before hold-down (5sec default) timer triggers, junos does three runs of SPF.<\/p>\n\n\n\n<p>spf-options delay x = def 200ms between topology change and SFP run<\/p>\n\n\n\n<p>spf calculation order: Intra-A (E1 cost=3), Inter-A, External E1, External E2,<\/p>\n\n\n\n<p>metric = ref bw \/ link bw<\/p>\n\n\n\n<p>overload: set metric 65535 in all ospf links -&gt; device can be put in maintenance<\/p>\n\n\n\n<p>authentication: none (default), simple, md5<\/p>\n\n\n\n<p>show ospf interface detail<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">ospfv3 (ipv6)<\/h2>\n\n\n\n<p>ospfv2 (ipv4 -&gt; protocols ospf3 realm ipv4-unicast) + GR + Auth + ipv6<br>interfaces MUST have family inet6 !!!<\/p>\n\n\n\n<p>diff: ipv6 uses link-local addresses to originate packets, auth done at ipv6 layer<br>options fiel expanded, lsa format changes: new lsa and remaining) IA LSA<\/p>\n\n\n\n<p>LSA Function LS type Description Like ospfv2<br>1 0x2001 router lsa lsa1 router<br>2 0x2002 net lsa lsa2 network<br>3 0x2003 InterA-prefix lsa lsa3 summary<br>4 0x2004 InterA-router lsa lsa4 asbr summary<br>5 0x4005 AS-Externa lsa lsa5 external<br>6 0x2006 Group Memb lsa lsa6 multicast<br>7 0x2007 type-7 lsa lsa7 nssa<br>8 0x2008 link lsa none<br>9 0x2009 IntraA-prefix lsa lsa1 + lsa2<\/p>\n\n\n\n<p>U bit: unknow: 0 -&gt; link local scope \/ 1 -&gt; flood<\/p>\n\n\n\n<p>S2 S1 &#8211; flooding scope<br>0 0 link-local<br>0 1 area<br>1 0 AS<br>1 1 reserved<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">Advance OSPF for SP<\/h1>\n\n\n\n<p>shrinking LSDB &#8211; route summarization, areas<\/p>\n\n\n\n<p>Stub: lsa1,2,3. no lsa4,5<br>totally stub: lsa1,2 and just one lsa3 (default route) no lsa4,5<br>NSSA: lsa1,2, just lsa7 as default. ????????\/<br>totally nssa: lsa1,2, ??????<\/p>\n\n\n\n<p>-Stub: not flooding lsa4,5 by ABR. ABR inject default route (in junos needs to be done manually)<br>no virtual-links<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>set protocols ospf area 1 stub [default-metric 10 (this only in ABR to advertise default route)] All other routers just need stub<br>interface xx<\/p>\n<\/blockquote>\n\n\n\n<p>-totally stub= stub + &#8220;no-summaries&#8221;: lsa1,2 and just one lsa3 (default route &#8211; manual config)<br>no virtual links<\/p>\n\n\n\n<p>only in ABR of Totally Stub your configure this. Other routers just need &#8220;stub&#8221;<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>set protocols ospf area 1 stub no-summaries [default-metric 10]<br>interface xx<\/p>\n<\/blockquote>\n\n\n\n<p>** E-bit must match for OSPF adj to form<\/p>\n\n\n\n<p>-NSSA: asbr injecs LSA7 in NSSA. ABR transforms lsa7 into lsa5 in are0. nssa receives a default route (no-summaries) (as lsa7!) from ABR.<br>no virtual-links<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>set protocols ospf area 1 nssa (in all routers) [default-lsa default-metric 10 (only in ABR! as lsa7)]<br>[no-summaries &#8211; with above -&gt; uses lsa3 as default &#8211; only ABR]<br>interface xx<\/p>\n<\/blockquote>\n\n\n\n<p>no-nssa-abr: if ABR connected to several NSSA, and want to disable export lsa7 into nssa<\/p>\n\n\n\n<p>** if several ABR in same are, the highest RID, floods LSA from areaX to area0<\/p>\n\n\n\n<p>-Totally NSSA: stub + no-summaries. ABR doesnt inject lsa3 from area0. ASBR injects lsa7 into NSSA. ABR converts lsa7-&gt;5 into area0<br>no virtual-links<\/p>\n\n\n\n<p>-route summarization: done in ABR,summarize lsa1,2 as a lsa3 into area0. Because ABR forwars lsa1,2 from areaX to area0.<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>set protocols ospf area 1 area-range IP\/20 [strict (no type3 is generated for this summary in area0)]<br>interface xxx.0<\/p>\n<\/blockquote>\n\n\n\n<ul class=\"wp-block-list\">\n<li>for NSSA, the ABR summarize all lsa7 as one lsa5 into area0<\/li>\n<\/ul>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>set protocols ospf area 1 nssa area-range IP\/20 [strict]<br>interface xxx.0<\/p>\n<\/blockquote>\n\n\n\n<h2 class=\"wp-block-heading\">Multi-Area Adj<\/h2>\n\n\n\n<p>in ABR. each multi-area adj is a lsa1 p2p. No lsa3 advertised over multi-area adj. one adj is primary (only one!), and the other secondary<\/p>\n\n\n\n<p>set protocols ospf area 0 interface ge-0\/0\/0.0<br>area 10 interface ge-0\/0\/0.0 secondary<\/p>\n\n\n\n<p>show ospf interface<br>interf State Area<br>ge-0\/0\/0.0 BDR 0<br>ge-0\/0\/0.0 pTp 10<\/p>\n\n\n\n<p>show ospf neighbor -&gt; shows 2 adj in ge-0\/0\/0.0 !!<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Virtual-Link<\/h2>\n\n\n\n<p>control-plane only. between ABR<\/p>\n\n\n\n<p>set protocols ospf area 0 virtual-link neighbor-id RID-R1 transit-area 0.0.0.10<br>interface ge-0\/0\/0.0 interface-type p2p<\/p>\n\n\n\n<p>show ospf interface\/neighbor -&gt; vl-xxxx<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">External reachability ?????<\/h2>\n\n\n\n<p>deafult export policy: reject<\/p>\n\n\n\n<p>set policy-options policy-statement redis-static term static from protocol static then external type 1 accept<br>set protocols ospf export redis-static<\/p>\n\n\n\n<p>prefix-limits: 32b &#8212; when reached, routers gets &#8220;overload&#8221; change metric to all prefixes<br>set protocols ospf prefix-export-limit x<\/p>\n\n\n\n<p>ospf mutual redistribution !!!<\/p>\n\n\n\n<p>ospf import policu !!!!!<\/p>\n\n\n\n<p>LSDB: show ospf database<br>Tree DB: show ospf route<br>inet.0: show route protocol ospf<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">Troubleshooting OSPF<\/h1>\n\n\n\n<h2 class=\"wp-block-heading\">adj issues<\/h2>\n\n\n\n<p>down,<br>init: neighbo discover<br>2way: idem<br>exstart exchan loading: lsdb sync<br>full:<\/p>\n\n\n\n<p>init to 2way issus: interface type match, network mask, hello\/dead interval, area type, area number, auth, RID different, fw issue<br>2way stuck: priority both 0?, same IP?, MTU?<\/p>\n\n\n\n<p>show ospf interface X detail<br>show ospf statistics | find errors<br>set protocols ospf traceoptos flag error detail, hello detail<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">lsdb issues<\/h2>\n\n\n\n<p>duplicate RID -&gt; continuos SPF runs<br>broken area0: use virtual-links<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">routing issues<\/h2>\n\n\n\n<p>suboptimal<br>instability<\/p>\n\n\n\n<p>show route protocol ospf: computed routes and attributes<br>show ospf route<br>show ospf database<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">IS-IS<\/h1>\n\n\n\n<p>by ISO (OSPF by IETF &#8211; TCP\/IP)<br>Connectionless Network Service CLNS \/ CNLO. Single AS<br>PDUs = ISIS packets<br>ES = End System = host<br>IS = routers<br>L1: route within an area or towards L2 system<br>L2: route between areas and towards other ASs<br>L1\/L2 (ABR): sets the attached bit in the L1 PDUs = it can reach L2<br>L1 routers create default route for InterArea prefixes, witch points to the closest L1\/L2 router<\/p>\n\n\n\n<p>Net = 49.xxxx.yyyy.yyyy.yyyy.zz<br>area sys id selector<br>(lo.ip) 00<\/p>\n\n\n\n<p>L2 routers connect areass. L1 router dosnt connect to another area. L2 routers are BB<\/p>\n\n\n\n<p>LS PDU format<br>id lenght: 6b<br>pdu type: 18=l1 20=l2<br>max area address = 3b<br>2xversion!<br>Variable: PDU headers and TLV<br>pdu length, remaining lifetime, lsp id (unique!: system id + circuit id + lsp number), seq nu, checksum, IS type bits, TLVs (variable)<br>ciruit id &#8211; 0x01 for lo and p2p<br>LS flooding: files remaining lifetime: 3b: default: 20minutes<br>ATT bit: attachment bit &#8211; it IS connected to another area<br>OL bit: overload bit &#8211; if LSDB is overloaded (in maintenance mode)<br>IS type: l1 = -0x1 \/ l1l2 = 0x3<\/p>\n\n\n\n<p>ISIS Messages:<br>hello: neighbor discovery, build, maintain adj: LAN hello (L1, type15 &#8211; l2 &#8211; type16), p2p hello. Hello reg 3s default<br>circuit type (l1,l2,l1l2), source ID (sysid), hold time, pdu length, priority (for DIS election), LAN ID (sysid or dis + 1b)<br>LS PDU: sent as result of network change, during adj formation, response to seq nu pdu.<br>identify adj, describe state adj, describe reachable address<br>PSNP: Partial Sep Num PDU. Maintain LSDB sync. ack in p2p, request copy lsp on broadcast. contains specific header for lsp acked or req-ed<br>CSNP: Complete Seq Num PDU. periodically in p2p. only by dis in broadcast. header info for all lsp<\/p>\n\n\n\n<p>TLV: type, length, value<br>tlv1: area address (of l0). Sent via l1 and l2 i<br>tlv2: IS neighbor metrics. delay\/expense\/error metric: S bit =1 , I\/E and metric bits = 0.<br>tlv10: authentication<br>tlv22: extended IS reach (TE). It has SubTLV<br>tlv128: ipv4 prefix, mask, metrics from the local router<br>tlv129: protocols supported (ipv4,6)<br>tlv130: ip external info (coming from policies)<br>tlv132: ip interface address (<br>tlv134: TE IP RID<br>tlc135: ext ip reachability ( for TE). for larger metric values<br>tlv137: dynamic hostname mapping<\/p>\n\n\n\n<p>tlv232: ipv6 support<br>tlv236: ipv6 support<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">ADJ<\/h2>\n\n\n\n<p>l1 router never adj with l2 router<br>l1 adj, same area ID<br>l2 adj, diff area ID<br>DIS election: 0 (never)-127 priority (higher better). for l1 and l2 (can be the same). In hello pdu<br>no backup DIS. there is preemption. non-DIS created adl with all others.<br>pseudo-node: DIS acts as representative and advertises it to all attached router (broadcast network). Pseudo-node hast cost 0<\/p>\n\n\n\n<p>set interfacces ge-0\/0\/1 unit 0 family inet address IP<br>iso<br>lo unit 0 family inet address IP1<br>iso address 49.area_ip.00<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>by default all interface are l1\/l2<\/li>\n\n\n\n<li>default metric is 10 (for lo is 0)<\/li>\n<\/ul>\n\n\n\n<p>set protocols isis interface ge-0\/0\/1.0 level 1 disable [metric x]<br>lo.0 level 2 disable<br>reference-bandiwth 1g<\/p>\n\n\n\n<p>show isis interface [detail]<br>show isis adjacency [detail] (SNPA = mac of next hop)<br>show isis spf log [detail]<br>show isis statistics<br>show isis route<br>show isis database extensive<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">ISIS flooding<\/h2>\n\n\n\n<p>LS PDU flooding scocpes: L1 stay in its area. L1L2 routes inject L2 in different areas<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>show isis database -&gt; there is a lsdb for l1 and another for l2<br>you can see the DIS in the output -&gt; router_ID.02-00<\/p>\n<\/blockquote>\n\n\n\n<p>SPF algo: LSDB -&gt; candidate DB -&gt; tree DB -&gt; RIB<\/p>\n\n\n\n<p>set protocols isis spf-delay (def 200ms) delay between back-to-back SPFs<\/p>\n\n\n\n<p>Partial Route Calculation = PRC &#8211; enabled by default and can&#8217;t be disabled<\/p>\n\n\n\n<p>isis floods LSPDUs to all neighbors by default =&gt; no great for mesh topologies -&gt; create mesh-group to avoid the flooding<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">isis wide metrics<\/h2>\n\n\n\n<p>tlv2,128,130 uses 6b -&gt; max metric=63<br>tlv22,135 -&gt; large metric: 16 777 215 (32b)<\/p>\n\n\n\n<p>set protocols isis level x wide-metrics-only<\/p>\n\n\n\n<p>auth: only in hello. l1, l2 or interface. none, simple, md5.<\/p>\n\n\n\n<p>overload bit: for maintenance. can be scheduled time<\/p>\n\n\n\n<p>csnp interval: DIS sends CSNPs on a LAN every 10s.<\/p>\n\n\n\n<p>user-defined import policies are not allowed<br>export: ok (beware of routing loops when multiple redistribution points exist<\/p>\n\n\n\n<p>l1l2 isis multilevel area = ospf nssa with no summaries<br>*l1l2 border is a natural route boundary<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>l2 routes are not advertised into l1 by default<\/li>\n\n\n\n<li>external l1 routes are not advertised to l2 by default -> route leaking to modify this. Using &#8220;wide-metrics-only&#8221; eliminates internal\/external distinction<br>set policy-options policy-statement external-l1-summary term X from protocol aggregate route-filter IP\/22 exact<br>to level 2<br>then accept<br>term y from route-filter IP\/22 longer<br>to level 2<br>then reject l1l2 attached routers set the attached-bit in their l1 LSPDU\n<ul class=\"wp-block-list\">\n<li>l1 routers install a locally generated 0\/0 def route to the closest l2 attached router (disable with ignore-attached-bit)<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n\n\n<p>default interface enabled for l1\/l2.<br>loopback is always passiv, no need to disable anything<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>l1 links: between the same area<br>l2 links: between differnt areas<br>attached bit = generate default<br>route leaking and summarization: 1) create agg route, 2) create policy 3) export policy into isis<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Troubleshooting<\/h2>\n\n\n\n<h2 class=\"wp-block-heading\">adj<\/h2>\n\n\n\n<p>family iso, level mismatch, ip subnet mismatch (overlap is ok), MTU 1492 and match (init state stuck!!), auth, passive, p2p vs broadcast, same system-id cause issues! -&gt; frequent spf runs!<\/p>\n\n\n\n<p>down<br>new: sent hello<br>two-way: received hello<br>init: LSDB sync<br>up<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">routing<\/h2>\n\n\n\n<p>narrow vs wide metric, lo0 advertised, route summerization (int vs ext), route leaking,<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>show isis interface<br>statistics<br>overview<br>adjacency<br>hostname<br>spf log<br>database [extensive] | find TLVs<br>level x hostname extensive | match PREFIX\/MASK<\/p>\n\n\n\n<p>set protocols isis traceoptions file isis flap error detail flag hello send receive detail<\/p>\n<\/blockquote>\n\n\n\n<h1 class=\"wp-block-heading\">BGP<\/h1>\n\n\n\n<p>path vector protocol<br>ibgp: full-mesh, no changes anything (nh)<br>ebgp: changes aspath and nh<\/p>\n\n\n\n<p>4096b max<br>19b min<\/p>\n\n\n\n<p>idle: all refused<br>connect: wait for tcp to complete<br>active: initiates tcp<br>opensent: tcp completed, waits for open message<br>openconfirm: waits for a keepalive (moves to establs) or notif message (moves to idle)<br>established: exchange update, notification, keepalive<\/p>\n\n\n\n<p>bgp update: nlri, origin, aspath, NH, additional<\/p>\n\n\n\n<p>hold = 3xkeep\/hello (def.30) -&gt; 90s<br>notification: when error is deteccted<br>refresh: inform peer to resend all routes<\/p>\n\n\n\n<p>hidden routes: reject by import policy, nh issues (fix: next-hop-self or igp passive in external link), as-path issus<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>show route hidden extensive<\/p>\n<\/blockquote>\n\n\n\n<h2 class=\"wp-block-heading\">path selection<\/h2>\n\n\n\n<p>nh exist, +LP, -ASpath, -Origin, -MED, ebgp&gt;ibgp, -IGP metric, -cluster , -rid, -peer_ip<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">LB<\/h2>\n\n\n\n<p>multipath -&gt; ignores rid and peer-id<br>ebgp: multihop if not directly connected !! (ttl def = 64!)<\/p>\n\n\n\n<p>set policy-option policy-statement LB then load-balance per-packet<br>set routing-option forwarding-table export LB<br>hash-key family inet XXX (default only l3)<\/p>\n\n\n\n<p>show route forwarding-table matching IP\/MASK<\/p>\n\n\n\n<p>set routing-options router-id IP-lo<br>autonomous-system ASN<\/p>\n\n\n\n<p>GTMS: BGP Generalized TTL Security Mechanism: used in BGP single hop. drops any packet lower than max ttl<br>needs to create firewall policy and apply input interface!!<\/p>\n\n\n\n<p>GR: graceful restart. negotiated between peers<br>End-of-RIB markers sent for each NLRI. Notifies the neighbor that all current routing info was sent<br>Local router defers path selection alg until the marker is received<\/p>\n\n\n\n<p>set routing-options graceful-restart<br>autonomous-system ASN loops X<br>allow IP_RANGE -&gt; not needed to set each neighbor manually<\/p>\n\n\n\n<p>as-override<br>local-as [x private]<br>remove-private<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Policy<\/h2>\n\n\n\n<p>RIB-in: before applying policies. rejected are showing with &#8220;hidden&#8221;.<br>show route receive-protocol bgp PEER_IP<br>RIB-local (inet.0): after routing best path decision. only single best bgp path. only active are advertised. you can advertise more than best with &#8216;add-path&#8217; (good in RR!!!). &#8216;advertise-inactive&#8217; to advertise the best bgp although is not best in rib (ie: ospf\/isis to same destination is better)<br>show route protocol bgp source-gateway PEER-IP<br>RIB-out: after export policy<br>show route advertise-protocol bgp PEER_IP<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Attributes<\/h2>\n\n\n\n<p>WK-mandatory: in every bgp update, undertstood by all &#8211; ASpath, Origin, NH<br>WK-discre: not in every bgp update, undertstood by all &#8211; LP<br>Opt-trans: transmitted even if not understood (communities)<br>Opt-notrans: no transmite even if not understood (MED)<\/p>\n\n\n\n<p>LP: def 100. only iBGP. set exit AS. Cold potato: keep traffic in your network as long as possible. Hot potato: handover traffic to carriers asap<\/p>\n\n\n\n<p>MED: set entry AS, among same AS peer<\/p>\n\n\n\n<p>ASPATH: junos, before advertising, if neighbor AS is already in ASPATH, it drops advertisiment<br>2B: priv 64512-65534<br>4B: xx.yy (old: 0.y) priv: 1.y &#8211; 65535.65535<\/p>\n\n\n\n<p>[] = standard ASPATH<br>{} = AS set &#8211; group os AS where order is not important<br>() = confederantion<\/p>\n\n\n\n<p>Aggregation: ??<br>CE) show route (without any manipulation)<br>AS path 65001 (65002 65003) I Aggregator: 65001 (as of the aggregator) nh_ip from pe<\/p>\n\n\n\n<p>PE) set routing-optoins aggregate route 192.168.0.0\/23 as-path atomic-aggreate =&gt; removes the as from the contributing paths in the aggreate (ie: 192.168.0.0\/24 from other ASn) -&gt; the output says &#8220;atomic&#8221;<br>PE) set routing-options aggregate route 192.168.0.0\/23 as-path aggregator 65002 10.0.1.1 =&gt; cha<\/p>\n\n\n\n<p>regex in aspath<br>term: asn or asn path ( . == single asn !!!)<br>operator: | = or ie: 1024|1025<br>&#8211; = range ie: 1024-2685<br>. = any asn<br>() = empty as path<br>^ = start<br>$ = end<br>? = 0 or 1<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>= 1 or +<\/li>\n\n\n\n<li>= 0 or +<br>{m,n} at least m repetions, at most n repetiions<\/li>\n<\/ul>\n\n\n\n<p>set policy-options as-path NAME regex<br>as-path-group -&gt; define list of regex evaluated as logical OR<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>show route receive-protocol bgp IP aspath-regex &#8220;.* ASN&#8221;<\/p>\n<\/blockquote>\n\n\n\n<p>Origin: WK-mandatory<br>installed by the originating. I (Internal &#8211; learned by IGP &#8211; 0), E (External &#8211; from EGP &#8211; 1 ), ? (Incomplete=2) I &gt; E &gt; ?<br>anything in inet.0 is Internal<\/p>\n\n\n\n<p>MED: optional-nontran =&gt; Med is not passed between ASs. Less med is better<br>affects inbound traffic from other AS (several links with same neighbor AS !!!!)<br>routes redistrib into bgp, will have MED = metric of original route<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>set protocols bgp path-selecction &#8220;always-compare-med&#8221; -&gt; compare MED for the same prefix coming from different ASs<br>set protocols bgp group X neighbor IP metric-out Y ( yY = MED value)<\/p>\n<\/blockquote>\n\n\n\n<p>Communities: opt-trans<br>wellknow communities have global meaning.<br>no-export: routes must be distributed within the confederation or AS, but not further<br>no-advertise: routers must not be advertised to other bgp peers<br>no-export-subconfed: routes must not be advertised to eBGP confined to sub-AS<br>informational, action, LP, other: communities<br>4b: 2b=asn + 2b=value (AS:number)<br>extendended:<br>4b asn: as.as:number or asL:number<br>&#8220;<em>:<\/em>&#8221; = all communities regex<\/p>\n\n\n\n<p>nontransit AS only advertise local-routes<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>set policy-options community COMM_NAME members COMMUNITY\/regex (multiple communities is with AND !!)<br>set policy-options policy-statement TEST term X then community add\/delete\/set COMM_NAME<\/p>\n<\/blockquote>\n\n\n\n<p>regex in community are character based !!! (different form AS path that match a whole ASN)<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>show route community *:20 [terse|detail]<br>show route community-name COMM_NAME [detail]<\/p>\n<\/blockquote>\n\n\n\n<p>[a-z] = range<br>(a,b,z) = list values<br>&#8220;((56)|(78)):<em>&#8221; &#8211; AS is 56 or 78 &#8211; ie: 56:100, 78:65000 &#8220;56:(2.<\/em>)&#8221; &#8211; AS is 56 and value starts with 2 &#8211; ie: 56:234, 56:2, 56:222<br>&#8220;<em>:(.<\/em>[579])&#8221; &#8211; Any AS and values ends with either 5,7, or 9 &#8211; ie: 213:5, 78:2347, 34:65009<br>&#8220;((56)|(78)):(2.*[2-8])&#8221; &#8211; AS is 56 or 78, value starts with 2 and ends with any value between 2-8 &#8211; 56:22, 56:21197, 78:2678<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Route-Reflector rfc4456<\/h2>\n\n\n\n<p>ibgp full-mesh &lt;- not added as-path for loop preventaion -&gt; escale issue n2 problem<br>route-reflector: can readvertise ibgp prefixes -&gt; loop prevention: cluster-list (similar to as-path) and originator-id (1st router to inject route in RR network)<\/p>\n\n\n\n<p>set protocols bgp group int-peers type interal local-addres IP cluster IP neighbor X neighbor Y<\/p>\n\n\n\n<p>If you have 2xRR: shall you use the same cluster-id for both or different?<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>same cluster-id -> reduces number routes stored<\/li>\n\n\n\n<li>diff cluster-id -> duplicated info -> more spacce but more resilience<\/li>\n<\/ul>\n\n\n\n<p>clients do only ibgp to RR<\/p>\n\n\n\n<p>full-mesh between RR !!! (normal ibgp, just need cluster-id)<\/p>\n\n\n\n<p>&#8220;no-client-reflect&#8221; in RR: stop unnecesary adverts<\/p>\n\n\n\n<p>*be sure RR only change NH for ebgp peers<\/p>\n\n\n\n<p>off-path: better since virtual-RR<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Optimal RR (ORR)<\/h2>\n\n\n\n<p>Juniper supports only ORR optimal BGP path selection based on client perspective use OSPF\/ISIS &#8211; virtual only<\/p>\n\n\n\n<p>suboptimal RR solutions<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>hierarchical RR: RR close to clients but limits where to deploy<\/li>\n\n\n\n<li>&#8220;add-path&#8221;: reduces benefit of RR as additional route info is introduced -> more BGP update churns<\/li>\n\n\n\n<li>VRF + unique RDs per peering router<\/li>\n\n\n\n<li>use tunnels<\/li>\n\n\n\n<li>use ORR: RR anywhere, solves hot potato, no changes in BGP RR clients, can worh with add-path.<\/li>\n<\/ul>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>set protocols bgp group NAME optimal-route-reflectoin ipg-primary IPv4 (from one of the clients so its IGP metric is used for selecting best path)<\/p>\n<\/blockquote>\n\n\n\n<p>rfc3345 oscillation<br>solutions: 1 always compare med &gt; set protocols bgp path-selection always-compare-med<br>2 add-apth &gt; set protocols bgp family inet unicast add-path receive; send prefix-policy NAME path-count 6s<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Confederation<\/h2>\n\n\n\n<p>considered legacy!<br>limitations: no possilbe to migrate to\/from a confederation setup withou a complete bgp shutdown<br>no scalable in regard to services and AF<br>each sub-as still need full-mesh ibgp, private asn<br>between sub-as, ebgp.<br>confederation as-path: it appears as a single iBGP as-path<\/p>\n\n\n\n<p>set routing-options autonomous-system 65000<br>confederation 201 members [ 65000 \u2026 65004 ]<\/p>\n\n\n\n<p>needs multihop!<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">BGP FLOWSPEC<\/h1>\n\n\n\n<p>amplification attacks: memcached (10k-50k), ntp monlist (556), CHARGEN (358), DNS (28-54), SSDP (30)<\/p>\n\n\n\n<p>uRPF: against IP spoofing.<br>strict: interface packet is received must be the best and active path to the source prefix.<br>loose: source address must match a prefix in the routing table (accomodates asym routing)<\/p>\n\n\n\n<p>RTBH<br>Destination-based RTBH: customer communicates to ISP. ISP, via iBGP import policy on edge PE, drops traffic heading to the destination IP<br>bw is restored when attack is targeted to a single IP or prefix<br>negative: knocks victim offline, force emergency IP change.<\/p>\n\n\n\n<p>Source-based RTBH: attacked source IP is advertised to ISP via BGP (blackhole community), ISP uses it with uRPF to dropp traffic at edge.<br>negative: src addr often not known or too numerous, or behind CGNAT or they are public services (DNS,NTP,LDAP, etc)<\/p>\n\n\n\n<p>BGP FLOWSPEC: rc5575, afi 1 safi 133 = ipv4, afi 1 safi 134 = vpnv4<br>afi 2 safi 134 = ipv6, afi 2 safi 134 = vpnv6<\/p>\n\n\n\n<p>1- dst prefix 7 icmp-type<br>2- src prefix 8 icmp-code<br>3 ip protocol 9 tcp-flags<br>4 src or dst port 10 packet-lenght<br>5 dst port 11 dscp<br>6 src port 12 fragment encoding<\/p>\n\n\n\n<p>bgp-community 0x8006 traffic-rate<br>0x8007 traffic-action<br>0x8008 redirect<br>0x8009 traffic-marking<\/p>\n\n\n\n<p>order processing<br>1 compare left-most components of each NLRI<br>2 if types differ, lowest type by numeric value is used, if same, then values within that component are compared<br>3 for ip prefix values (type 1,2,3) the lowest IP is chosen, and if the IP addresses are the same, the most specific prefix is used<br>4 for all other types, the binary string of content is compared to determine the order<\/p>\n\n\n\n<p>validation<br>1 originator of flow spec matches the originator of best-match unicast route for destination prefix embedded in flow spec<br>2 there are no more-specific unicast routes that have benn received from a different neighbor aS than the best-match unicast router from 1)<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>this validation can be disabled: customer calls instead of having BGP<\/li>\n<\/ul>\n\n\n\n<p>config:<br>family inet unicast + flow peering with ISP<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>advertise prefix<\/li>\n\n\n\n<li>config flow spec under routing-options<br>policy<\/li>\n<\/ul>\n\n\n\n<p>CUSTOMER<\/p>\n\n\n\n<p>set protocols bgp group SP type external export TO-SP peer-as ASN neigbor IP family inet unicast flow<\/p>\n\n\n\n<p>set routing-options flow route DNS match protocol udp port 53 packet-length 100-65535 destination DESt\/32 then discard<br>term-order standard<\/p>\n\n\n\n<p>set policy-options policy-statement TO-SP term flow-to-SP from rib inetflow.0 then accept<br>term CUSTOMER-ROUTES from route-filter DEST\/24 exact then accept<br>term REJECT then reject<\/p>\n\n\n\n<p>SP<\/p>\n\n\n\n<p>set protocol bgp group Customer import Customer-in peer-as X neighbor IPY family inet unicast flow prefix-limit maximum 2<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>               group IBGP local-adress Z family inet unicast flow neigbor A1 neighbor A2....<\/code><\/pre>\n\n\n\n<p>set policy-options policy-statement Customer-in term 1 from rib inetflow.0 route-filter DEST\/24 prefix-lenght-range \/32-\/32<br>then community add CUST-FS-COMM accept<br>term 2 from route-filter DESt\/24 exact then accept<br>term 3 then reject<br>community CUST-FS-COMM members 100:9999<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>           *For other PEs:\n           set routing-options\n                 rib  inetflow.0 maximum-prefixes 10000 threshold 90\n                 flow term-order standar<\/code><\/pre>\n\n\n\n<p>Case-2: customer doesnt do BGP, calls NOC. SP needs RR:<\/p>\n\n\n\n<p>RR:<\/p>\n\n\n\n<p>set protocols bgp group RR-CLIENT-FLOWSPEC import NO-ROUTES-IN export FLOW-ROUTES-OUT type internal local-address X family inet flow cluster X neighbor a,b,c<\/p>\n\n\n\n<p>set routing-options flow route DNS match protocol UDP port 53 packet-lenght 100-65535 destination DEST\/32 then discard<br>term-order standard<\/p>\n\n\n\n<p>set policy-options policy-statement FLOW-ROUTES-OUT term 1 from rib inetflow.0 then community add INTERNAL-FS accept<br>term 2 then accept<br>policy-statement NO-ROUTES-IN term 1 then reject<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>                 community INTERAL-FS members 100:1000<\/code><\/pre>\n\n\n\n<p>For other PEs:<\/p>\n\n\n\n<p>set protocols bgp group RR-CLIENT-FLOWSPEC import FLOWSPEC-RR-IN type internal local-address X family inet flow no-validate FLOWSPEC-RR-IN<\/p>\n\n\n\n<p>set policy-options policy-statement FLOW-ROUTES-RR-IN term 1 from rib inetflow.0 route-filter 0.0.0\/0 prefix-length-range \/32-\/32 then accept<br>term 2 then reject<\/p>\n\n\n\n<p>set routing-options rib inetflow.0 maximum-prefixes 1000<br>flow term-order standard<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>show bgp summary<br>show route table inetflow.0 extensive [hidden] -&gt; Fictitious indicates there is no BGP next-hop in the route<br>show route flow validation detail -&gt; check &#8220;match validation&#8221;<br>show firewall -&gt; <strong>flowspec_default_inet<\/strong> applied to all interfaces<\/p>\n<\/blockquote>\n\n\n\n<p>LAB<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">BGP TROUBLESHOOTING SP<\/h1>\n\n\n\n<p>peering session establishment troubleshooting:<br>tcp states for bgp: idle (init state, no route to send tcp syn), connect (wait for tcp to complete, tcp sent), active (tcp timout occurred)<\/p>\n\n\n\n<p>ibgp: igp dooesnt have loopbackc, missing local src ip. Test: ping loopback_dst source loopback_src, mtu<\/p>\n\n\n\n<p>ebgp: multihop, mtu<\/p>\n\n\n\n<p>routing issues:bgp import policty accepts all routes by default. NH not reachable. aggregating missing contributing<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>show bgp summary<br>show bgp group<br>show bgp neighbor IP<br>show system connections inet extensive | find P<br>set protocols bgp traceoptions file X size 10m files 2 flag packets details flap general flag open<br>show log X<br>monitor start X<br>show route advertising-protocol bgp IP [extensive: bgo communities, asparth-prepend]-&gt; routes after export policies<br>received -&gt; routes befor import policies<\/p>\n<\/blockquote>\n\n\n\n<p>show route protocol bgp source-gateway BGP-NEIGHBOR-IP -&gt; routes after import policy<\/p>\n\n\n\n<p>show route protocol bgp active-path<\/p>\n\n\n\n<p>[terse &lt; brig &lt; no_option &lt; detail &lt; extensive ]]<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">Policy Troubleshooting<\/h1>\n\n\n\n<p>import policy: before RIB<br>export policy: after RIB and before reaching neighbor<br>fw export policy: from RIB to FIB (ie: LB)<\/p>\n\n\n\n<p>RTBH: Remote triggered black hole: can discard legitimate traffic -&gt; better: FlowSpec<\/p>\n\n\n\n<p>common match conditions: protocol, route-filter and PL, NH and interfac<\/p>\n\n\n\n<p>import\/export policies: order is important, left to right<\/p>\n\n\n\n<p>defaults:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>    Import       Export<\/code><\/pre>\n\n\n\n<p>BGP accept accept<br>ISIS accept reject (but ISIS peer accept)<br>OSPF accept LSA reject (but OSPF peer accept)<br>RIP accept reject<\/p>\n\n\n\n<p>expresions: be careful!!!, can be unpredictable if policies only modify attribtures and don&#8217;t accept\/reject the route!!!<br>ie: export ( policy-one &amp;&amp; !policy-two)<\/p>\n\n\n\n<p>regex only for ASPATH (minium value is a ASN) and communities (minimun value is a character)<\/p>\n\n\n\n<p>community set (replace all values with a new onne) &lt;&gt; community add (keep current values and add new one)<\/p>\n\n\n\n<p>no-export: not leave AS (so to iBGP is fine)<br>no-advertise: no iBGP, no eBGP<br>no-export-subconfed: not leave confederation sub-as.<\/p>\n\n\n\n<p>show route forwarding table -&gt; &#8220;ulst&#8221; list of unicast NH for LB<br>show policy forwarding-policy (no very useful)<br>test policy (no very useful)<br>traceoptions flap policy: powerful but use with care! add &#8220;trace&#8221; in any &#8220;then&#8221; term. remove when done!!!!<\/p>\n\n\n\n<p>show ospf database external advertising-router ROUTER | match PREFIX<br>show isis database external ROUTER | match PREFIX<\/p>\n\n\n\n<p>set policy-options as-path-group X as-path P1 65051*<br>as-path P2 65052*<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>               as-path Y \"65500 .*\"\n\n               policy-statement send-customers term T1 from as-path-group X then accept\n               policy-statement no-transit     term T2 from as-path Y then reject<\/code><\/pre>\n\n\n\n<p>LAB<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">BGP Route Damping<\/h1>\n\n\n\n<p>rfc 2439 &#8211; bgp route flap damping<\/p>\n\n\n\n<p>figure of merit = points decay = 0 when learned. Increased when flaps (1000) or attributes changes<br>points decay = reduce value at certain rate = &#8216;half-life&#8217; (reduced penalty points by half: def: 15 min)<br>points above &#8216;suppress&#8217; (def: 3000) threshold -&gt; route is damped<br>points drop below &#8216;reuse&#8217;s (def: 750) threshold -&gt; route is used<br>&#8216;max-suppress&#8217;: longest time to suppress a route. def: 60 min<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>set policy-options damping NAME-DAMP half-life minutes max-suppress minutes reuse number suppress number<br>dont-damp disable (not calculate a merit figure for routes = no damping)<\/p>\n\n\n\n<p>set policy-options policy-statement C1 then damping dont-damp<br>C2 term t1 from route-filter NET\/x or longer then damping dont-damp accept<br>t2 then damping NAME-DAMP<\/p>\n\n\n\n<p>set protocols bgp damping<br>import POLCICY-IN<\/p>\n\n\n\n<p>show route damping history extensive<br>decayed<br>suppressed<\/p>\n\n\n\n<p>clear bgp damping &#8211;&gt; figure of merit=0 for all routes<\/p>\n<\/blockquote>\n\n\n\n<p>=========================================<br>Junos Layer 2 VPNs On-Demand<br>=========================================<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">REFRESHER L2VPN<\/h2>\n\n\n\n<p>ipsec vpn (full-mesh, partial, hub-spoke), sd-wan, mpls-vpn. Trade-offs<\/p>\n\n\n\n<p>PE: connect to CEs, bgp to other PEs, ingress\/egress LSP<br>P: LSP transit, fw only based on labels, PHP, bgp-free<br>lsp: ldp (igp), rsvp (manual), sr, bgp-lu<br>transport label (outer &#8211; advertisedd by ldp\/rsvp, changes hop-by-hop), vpn label (inner &#8211; advertised by bgp PEs, doesnt chnage)<\/p>\n\n\n\n<p>mpls.0 table &#8211; just labels (transport and vpn)<\/p>\n\n\n\n<p>l2vpn = virtual switch. label stack: labels are placed between SP ethernet fram (top) and customer ethernet frame (sandwiched)<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">L2VPN flavours<\/h2>\n\n\n\n<p>l2vpns: virtual-wires or virtual-switch<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">pseudowire: CEs think they are directly connected<\/h2>\n\n\n\n<p>logical pe-ce = attachment circuit !!!<br>method-1: one single logical unit accepts all traffic<br>method-2: multiple logical units for multiple pseudowires = vlan-tag identifies pseudowire (hub-spoke)<br>no need to MAC learning<\/p>\n\n\n\n<p>5 types:<br>l2vpn: bgp autodiscovers PEs and signals vpn (address family l2vpn, longer config)<br>l2circuit: ldp signals the vpn, neighbord manually defined (address family l2circuit, shorter config)<br>fec-129: bgp autodiscoverd PEs, ldp signals vpn. bpg overloadd\u2026<br>circuit-cross-connect: 2xrsvp (one in each direction), 1 label, doesnt scale (family ccc)<br>bgp-signaled evpn-vpws: evpn without mac-learning (newer)<\/p>\n\n\n\n<p>L2VPN &lt;&gt; l2vpn<br>L2VPN: bpg-signaled pseudowires in Junos (kompella)<br>l2vpn: all types of mpls vpn at l2.<\/p>\n\n\n\n<p>L2Circuit = Layer2 Circuit = ldp-signaled pseudowires (martini)<\/p>\n\n\n\n<p>vpws: virtual-private wire service<br>vpls: virtual private lan service, overlay model<br>pe: learns mac address, unknow mac flooding, irb can be places inside vpls<br>trade-offs: multihoming can do active\/active, vrrp, mac learning<\/p>\n\n\n\n<p>evpn: mac learning via bgp, multihming ok (no stp!), no need vrrp<\/p>\n\n\n\n<p>&#8220;encapsulation flexible-ethernet-services&#8221; you can use all types of vpn in one physical interface<\/p>\n\n\n\n<p>be aware of l2 stretching! -&gt; stretch failure domain<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">L2VPN or BGP-signaled pseudowires (kompella) rfc6624<\/h2>\n\n\n\n<p>AC = Attachment Circuit, can have several pseudowires. 1 pseudo-wire = 1 p2p vpn<\/p>\n\n\n\n<p>PE interface to CE: configures as<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Ethernet encap: one AC. all incoming frames to to one remote site. vlan tags are consired part of the payload<\/li>\n\n\n\n<li>Ethernet-vlan encap -> multiple AC. vlan is not part of payload -> each AC is bound to one remote interface<\/li>\n<\/ul>\n\n\n\n<p>RT: bgp ext community. identify vpn membership target:ASN:number<br>Site-ID: unique number for each end of the L2VPN. Used to calculate vpn label<br>Label-Block: can advertise a range of vpn labels for multiple AC at the same time (efficiency): label base, label size, label offset<\/p>\n\n\n\n<p>RD: just make advertisements unique<br>typo 0: 2byASN:4byNumber:IPPrefix<br>type 1: 4byLo0:2byNumber:IPPrefix -&gt; great for LB and fast failover. Because eachc PE advertise the prefx with its LO in thhe RD so the RR will see always different vpnv4 prefixes.<br>type 2: 4byASN:2byNumber:IPPrefix<\/p>\n\n\n\n<p>L2VPN prefix is just two fiels: RD + local Site-ID ie: 192.168.1.2:222:2<br>&#8212;&#8212;&#8212;&#8212;&#8212; &#8211;<br>RD Site-ID<\/p>\n\n\n\n<p>bgp L2VPN update: RT, Encap, RD, Site-ID, LabelBase\/Size\/Offset<br>bgp.l2vpn.0 -&gt; instance_name.l2vpn.0<\/p>\n\n\n\n<p>PE pseudowires dont do mac-learning (BGP does that)<\/p>\n\n\n\n<p>Layer2 Info: BGP extended community: Encap Type (5=raw(all), 4=ether-vlan), layer-mtu.<\/p>\n\n\n\n<p>NLRI: AFI=25 =Layer2 VPN, SAFI=65=vpls!!! (although is a bgp-signaled L2VPN!)<br>RD, CE-ID, Label Block offset, size, base<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">L2VPN Config<\/h2>\n\n\n\n<p>pre-requisites<br>IGP in backbone, 2xLSP between PEs, &#8220;family l2vpn signaling&#8221; between PEs\/RR<\/p>\n\n\n\n<p>&#8212;- ethernet-mode<\/p>\n\n\n\n<p>PE:CE-facing interface<br>set interface ge-0\/0\/0 encapsulation ethernet-ccc =&gt; AC is in&#8221;Ethernet Mode&#8221; pseduo-wire (all tags are part of payload)<br>unit 0<\/p>\n\n\n\n<p>PE config<br>set routing-instances L2VPN-NAME instance type l2vpn interface ge-0\/0\/9.0 route-distinguier LoIP:xxx vrf-target target:ASN:xxx<br>protocols l2vpn encapsulation-type ethernet<br>site NAME site-identifier 1 interface ge-0\/0\/9.0<br>*remote site-id is implicit: if local is 1, remote is 2 and viceversa<\/p>\n\n\n\n<p>&#8212;&#8211;ethernet-vlan mode<\/p>\n\n\n\n<p>PE:CE-facing interface<br>set interface ge-0\/0\/0 encapsulation extended-vlan-ccc<br>vlan-tagging<br>unit 100 vlan-id 100 family ccc<br>unit 200 vlan-id 200 family ccc<br>or<\/p>\n\n\n\n<p>set interface ge-0\/0\/0 encapsulation flexible-ethernet-services =&gt; when you have different services apart from L2VPN in the interface<br>flexible-vlan-tagging<br>unit 100 vlan-id 100 encapsulation vlan-ccc =&gt; pseudo-wire<br>unit 200 vlan-id 200 family inet address IP\/24 =&gt; ipv4<\/p>\n\n\n\n<p>PE config<br>set routing-instances L2VPN-NAME instance type l2vpn interface ge-0\/0\/9.100 route-distinguier LoIP:xxx vrf-target target:ASN:xxx<br>protocols l2vpn encapsulation-type ethernet-vlan<br>site NAME site-identifier 1 interface ge-0\/0\/9.100<br>*remote site-id is implicit: if local is 1, remote is 2 and viceversa<\/p>\n\n\n\n<p>&#8212;&#8211; verification<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>show route table bgp.l2vpn.0 detail -&gt; prefix =&gt; RD : remote site_id : offset \/ 96 (96 is the lenght of the NLRI and can be ignored)<br>INSTANCE_NAME.l2vpn.0<\/p>\n\n\n\n<p>show l2vpn connections instances INSTANCE_NAME [extensive show logs]<br>show route table mpls.0 lable LABEL_from_above_command<br>ccc ge-0\/0\/9.0 detail -&gt; show how PE process incoming traffic in this AC<\/p>\n<\/blockquote>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p>L2 Header ether-type: 0x0800 ipv4, 0x086dd ipv6,<br>802.1q header: tag protocol id (TPID): 0x8100 = single-vlan frame \/ 0x9100 = double-tag frame (QinQ)<br>* ethernet-ccc (ethernet-mode) any TPID is accpeted<br>* extendended-vlan-ccc (ethernet-vlan) only allows 0x8100 \/ 0x9100<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">L2VPN Troubleshooting<\/h2>\n\n\n\n<p>no LSP to remote PE<br>show l2vpn connections instance XXX -&gt; no connections found<\/p>\n\n\n\n<p>no l2vpn signaling in iBGP<br>show l2vpn connections instance XXX -&gt; no connections found<\/p>\n\n\n\n<p>customer interface encapsulaton dont match<br>show l2vpn connections instance XXX -&gt; encapsulation mismatch (EM)<\/p>\n\n\n\n<p>customer interface vlan tags dont match<br>show l2vpn connections instance XXX -&gt; doesnt show any issue. vlan tag are not exchanged!<br>check interface config<\/p>\n\n\n\n<p>incorrect customer interface in instance<br>show l2vpn connections instance XXX -&gt; LD: local site signaled is down \/ or RD: remote site is down<\/p>\n\n\n\n<p>choosing incorrect site-id<br>show l2vpn connections instance XXX -&gt; OR: out of range (range = range of labels in the label base, site-id is used to calculate the vpn label)<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">L2VPN Site-ID, Label Base, Overprovisioning<\/h2>\n\n\n\n<p>Site-IDs: hub-spoke<br>Label Block: one routing-instance, one bgp adv with one block labels -&gt; remote site can calculate label from the block based on site-id<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>show l2vpn connections instance XXX extensive -&gt; Label-base, connection-site = remote-site-id, offset,<\/p>\n<\/blockquote>\n\n\n\n<p>vpn-label = label-base + (remote-site-id &#8211; offset) -&gt; incoming label expected (what remote PE needs to use)<br>*labels are only significant to the originating router<\/p>\n\n\n\n<p>overprovisioning: add more AC that needed for future growth<\/p>\n\n\n\n<p>PE-HUB<br>set interface ge-0\/0\/9 vlan-tagging<br>encapsulation extended-vlan-ccc<br>unit 200 vlan-id 200 family ccc<br>unit 500 vlan-id 500 family ccc<\/p>\n\n\n\n<p>**explicit remote-site-id<br>set routing-instances XXX instance-type l2vpn<br>interface ge-0\/0\/9.200<br>.500<br>routing-distinguisher LoIP:111<br>vrf-target target:ASN:111<br>protocols l2vpn encapsulation-type ethernet-vlan<br>site ONE<br>site-identifier 1<br>interface ge-0\/0\/9.200 remote-site-id 4<br>site EIGHT<br>site-identifier 8<br>interface ge-0\/0\/9.500 remote-site-id 3<\/p>\n\n\n\n<p>offset=local-site-id<br>range=number of interfaces configured?<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>show l2vpn connections instance XXX extensive<\/p>\n<\/blockquote>\n\n\n\n<p>**implicit remote-site-id, it is infered base on the order the interfaces are added into the site config. Difficult to see errors!!!! simple to configure<br>set routing-instances XXX instance-type l2vpn<br>interface ge-0\/0\/9.200<br>.300<br>routing-distinguisher LoIP:111<br>vrf-target target:ASN:111<br>protocols l2vpn encapsulation-type ethernet-vlan<br>site ONE<br>site-identifier 1<br>interface ge-0\/0\/9.200 -&gt; remote-site 2 (becaue loca-site is 1)<br>interface ge-0\/0\/9.500 -&gt; remote-site 3<br>\u2026<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">L2VPN Advanced concepts<\/h2>\n\n\n\n<h2 class=\"wp-block-heading\">Multihoming<\/h2>\n\n\n\n<p>sure primary and backup connections with bgp. the backup will use LP=1. primary LP=65535<\/p>\n\n\n\n<p>remote PE;<br>show route table INSTANCE.l2id.0 detail -&gt; BGP status after path selection proces: you an see both paths<\/p>\n\n\n\n<p>primary PE:<br>show l2vpn connections instance XXX -&gt; you will see the connection from the backup PE with state &#8220;RN&#8221; because the primary PE is the DF (designated fw)<\/p>\n\n\n\n<p>backup PE<br>show l2vpn connections -&gt; connections are &#8220;LN&#8221; local site not designated (AC is shutdown), because primary PE is DF.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Martini Encap<\/h2>\n\n\n\n<p>Martini circuit = LDP-signaled pseudowire.<br>Martini Encap = how to send l2 traffic via MPLS pseudowire -&gt; &#8220;control word&#8221; between mpls label and l2 customer header<\/p>\n\n\n\n<p>Ethernet control word = 4bits=0 + 12bits=0 + Seq Num = 16 bits<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Normalization<\/h2>\n\n\n\n<p>swapping vlan tags<br>set interface ge-0\/0\/8 vlan-tagging encapsulation flexible-ethernet-services<br>unit 200 encapsulation vlan-ccc<br>vlan-id 200<br>input-vlan-map swap vlan-id 100<br>outout-vlan-map swap<br>show interfaces ge-0\/0\/8.200 -&gt; it shows the in\/out swap labels)<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">OOB RR<\/h2>\n\n\n\n<p>RR needs LSPs to resolve L2VPN prefixs, but as it is OOB, it can&#8217;t resolve the NH with LSPs (inet3.0)<br>sol: use inet.0 -&gt; set routing-options resolution rib bgp.l2vpn.0 resolution-ribs inet.0<\/p>\n\n\n\n<p>set routing-options route-distinguisher-id PE_LO_IP<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">RT constraint<\/h2>\n\n\n\n<p>PE tells neighbors the RT that is interested in (using &#8220;family route-target&#8221;). Then VPN prefixes are sent second.<\/p>\n\n\n\n<p>show bgp summary -&gt; &#8220;bgp.rtarget.0&#8221; = the address family has been negotiated<\/p>\n\n\n\n<p>show route table bgp.rtarget.0<br>advertising_ASN:RT\/96 (ie: 64512:64512:111\/96)<\/p>\n\n\n\n<p>in RR:<br>set protocols bgp \u2026 family route-target advertise-default = &#8220;sends me everything&#8221;<\/p>\n\n\n\n<p>from RR-client<br>show route table bgp.rtarget.0<br>0:0:0\/0 &#8211;&gt; default RT that says send everything to RR<\/p>\n\n\n\n<p>needs each PE and RR:<br>set routing-options resolution rib bgp.rtarget.0 resolution-ribs inet.0<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">L2Circuit LDP signaled Pseuowires (Martini)<\/h2>\n\n\n\n<p>bpg (kompella) and ldp (martini) both use AC, martini encap (control word), data plane is identical<\/p>\n\n\n\n<p>easy to config, trade-offs:<br>manual targeted ldp sessions, no auto-discovery (like bgp)<\/p>\n\n\n\n<p>set protocols ldp interface lo0.0 (update fw to allow tcp\/dp 646)<\/p>\n\n\n\n<p>set interfacces ge-0\/0\/8 encapsulation ethernet-ccc unit 0 (ethernet encap = accept all regardless vlan tag) &#8212; identical to L2VPN<\/p>\n\n\n\n<p>set interfacces ge-0\/0\/9 vlan-tagging encapsulation flexible-ethernet-services<br>unit 100 encapsulation vlan-ccc vlan-id 100 (ethernet-vlan encap = each vlan tag is a pesudowire) &#8212; identical to L2VPN<\/p>\n\n\n\n<p>set protocols l2circuit neighbor Remote-PE-Lo0.IP interface ge-0\/0\/8.0 virtual-circuit-id XXX<\/p>\n\n\n\n<p>set protocols l2circuit neighbor Remomte-Pe-Lo0.IP interface ge-0\/0\/9.100 virtual-circuit-id YYY<\/p>\n\n\n\n<p>show ldp session\/neighbor\/database<br>show l2circuit connections [neigbor IP]<\/p>\n\n\n\n<p>FEC = Fw Equivalence Class = set of traffic forwarded the same way using MPLS = the traffic goes down the same lsp = remote PE Lo0<\/p>\n\n\n\n<p>ldp l2circuit fec type = 128<\/p>\n\n\n\n<p>ldp advertise: fec type, control word, ethernet mode, PW id (circuit id)v lan, mtu, vpn lable<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">L2Circuit troubleshooting<\/h2>\n\n\n\n<p>show l2circuit connections -&gt; OL = no outgoing label -&gt; it is not receiving a label from the remote PE<br>VC-Dn = problem with pseueowire -&gt; check ldp<br>EM = encapsulation mismatch: encapsulation, circuit-id mismatch<br>NP = hw not present -&gt; customer-id is wrong or interface missing ethernet-ccc or vlan-ccc<\/p>\n\n\n\n<p>pseudowire status tlv -&gt; only report problems with local customer interface<br>set protocols l2circuit neighbor remote-pe-loIP interface ge-0\/0\/8.0 pseudowire-status-tlv<\/p>\n\n\n\n<p>fw filter for ldp udp\/tcp 646<br>show ldp session\/neighbor<\/p>\n\n\n\n<p>advertised FEC containes the inbound vlan after PE has manipulated the frame (if required)<\/p>\n\n\n\n<p>PE-2<br>set interfaces ge-0\/0\/9 vlan-tagging encapsulation flexible-ethernet-services<br>unit 100 encapsulation vlan-ccc<br>vlan-id 200 !!!!<\/p>\n\n\n\n<p>PE-1<br>set interfaces ge-0\/0\/9 vlan-tagging encapsulation flexible-ethernet-services<br>unit 100 encapsulation vlan-ccc<br>vlan-id 100<br>input-vlan-map swap vlan-id 200<br>output-vlan-map swap<\/p>\n\n\n\n<p>set protocols l2circuit traceoptions file FILE.txt flag connections detail fec detail<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">L2Circuit Advanced<\/h2>\n\n\n\n<p>vccv: virtual circuit connectivity verification: PE generate traffic to remote PE via pseudowire<br>each L2Circuit negotiates its own vccv options, sent in FEC (bgp)<br>cv: connectivity verification: icmp ping, lsp ping (udp 3503), bdf ip\/udp<br>cc: control channel, somehow needs to avoid PHP. use special control word, inserts a special router label above the pseudowire label<\/p>\n\n\n\n<p>set protocols l2circuit neighbor remote-pe-lo0 interface ge-0\/0\/8.0 virtual-circuit-id X<br>pseudowire-status-tlv<br>oam ping-interval 30 ping-multiplier 3 bfd-liveness-detection minimum-interval 1000 multi 5<\/p>\n\n\n\n<p>show bfd sessions -&gt; dest address is 127.0.0.1 !!! (different from standard bfd)<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">multihoming<\/h2>\n\n\n\n<p>the actual primary\/backcup config is done in the remote-PE !!! the multihoming PEs (local) dont talk to each other!<br>set protocols l2circuit neighbor remote-pe-lo0 interface ge-0\/0\/7.0 virtual-circuit-id X backcup-neibhor remote-pe-backcup-lo0<br>* by default: no preemption, you can modify that with &#8220;revert-time x&#8221;<\/p>\n\n\n\n<p>show l2circuit connections inteface ge-0\/0\/7.0 -&gt; BK: backup connection in remote-PE. the back-up PE will show the l2circuit as down because it hasn&#8217;t received a label from the remote-pe<\/p>\n\n\n\n<p>** local-switching: two sites connected to the same PE, no need of l2circuit pseudowire<br>set protocols l2circuit local-switching interface ge-0\/0\/8.0 end-interface ge-0\/0\/7.0<\/p>\n\n\n\n<p>show l2circuit connecctions<\/p>\n\n\n\n<p>** stitching pseudowires (merging companies) need interworking interface iw0 (ie L2VPN+L2Circuit<br>set interfaces iw0 unti 0 encapsulation vlan-ccc mtu 1514 vlan-id 610 peer-unit 1<br>unit 1 encapsulation vlan-ccc mtu 1514 vlan-id 610 peer-unit 0<br>set protocols l2iw<\/p>\n\n\n\n<p>set routnig-instances VPN1 instance-type l2vpn interface iw0.0 route-distinguisher lo0:1 vrf-target target:asn:1<br>protocols l2vpn encapsulation-type ethernet-vlan<br>site VPNA site-identifier 2 interface iw0.0 remote-site-id 1<\/p>\n\n\n\n<p>set protocols l2circuit neighbor remote-pe-lo0 interface iw0.1 virtual-circuit-id 1<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">FEC129 Pseudowire (no standard): auto-discover pseudowires<\/h2>\n\n\n\n<p>L2Circuit uses FEC type 128: explicit remote PE config, ldp signals the pseudowire, needs virtual-circuit-id<\/p>\n\n\n\n<p>FEC 129: uses BGP to autodiscovery, so no explicit remote PE config needed, ldp signals the pseudowire. mix of L2Circuit and L2VPN<\/p>\n\n\n\n<p>nowadays there is no notable adv to fec129<\/p>\n\n\n\n<p>AGI: Attachment Group Id = virtual-circuit-id = vpn id -&gt; l2vpn-id:ASN:umber (it is a extendedd bgp community)<br>SAII: surce attachment individual id = source site-id<br>TAII: target . . . = target site-id<br>same as L2VPN site-ids<\/p>\n\n\n\n<p>PE autodiscover is identical as L2VPN (rt, rd, local-site-id)<br>data plane: ldp uses FEC129, AGI, SAII and TAII<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>pe-ce interface config is identical to L2VPN. Enable LDP in Lo0, allow firewall<\/li>\n<\/ul>\n\n\n\n<p>set protocols bgp group INT type internal<br>local-address lo0<br>family l2vpn auto-discovery-only !!!<br>neihbor remote-pe-lo0<\/p>\n\n\n\n<p>set routing-instances TEST instance-type l2vpn<br>inteface ge-0\/0\/8.0<br>interface ge-0\/0\/9.100<br>route-distinguisher Lo0:num<br>l2vpn-id l2vpn-id:ASN:xxx <strong>*<\/strong><br>vrf-target target:ASN:xxx<br>protocols l2vpn site SITE1 source-attachment-identifier 1<br>interface ge-0\/0\/8.0 target-attachment-identfier 2<br>SITE2 source-attachment-identfier 2<br>interface ge-0\/0\/9.100 target-attachment-identifier 4<\/p>\n\n\n\n<p>show route receive-protocol bgp remote-pe-lo0 [detail]<br>under bgp.l2vpn.0 and INSTNACE.l2vpn.0<br>NLRI = RD:source-attachmen-id\/96<\/p>\n\n\n\n<p>show ldp database<\/p>\n\n\n\n<p>show l2vpn connections -&gt; l2vpn-id and target-attachment-id means it is fec129!!!<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">VPLS Intro &#8211; Virtual Private Lan Service<\/h2>\n\n\n\n<p>VPWS &#8211; virtual private wire service<br>pseudo-wire: no mac-learning, p2p, 1 ac per pseudowire<br>VPLS: SP acts as as switches LAN for customer<br>MAC learning like a switch<br>several psuedo-wires<br>signal: bgp (l2vpn), ldp (l2circuit), fec129<\/p>\n\n\n\n<p>known MAC<br>unknow MAC: avoid loop -&gt; if a PE received an unknow MAC from a remote PE, it only floods into the local CE<br>-replications can be problematic when having many PE and CE<br>-multi-homed?<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>irb: one PE is the gw, cons: traffic from remote PE has to cross the whole BB, if PE with irb goes down -> outage -> sol: use VRRP between PEs<\/li>\n<\/ul>\n\n\n\n<p>signalling:<br>bgp-signalled &#8211; L2vpn &#8211; kompella: autodiscovery (with RT), RR make scalable, block of labels: 1 bgp adv can signal every pseduowire in a vpls to all remote PEs, each site has Site-ID, rfc 4761<\/p>\n\n\n\n<p>ldp-signalled &#8211; martini: routing instenace, virtual circuits = vpls-id. configuration of remote PE per VPLS (no autodiscover), targeted LDP-sessions, no RR.<\/p>\n\n\n\n<p>fec-129: can use bgp or ldp, rfc 6074<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">VPLS BGP config<\/h2>\n\n\n\n<p>PE-CE<br>1) flexible just in case you use differnent encapsulations<\/p>\n\n\n\n<p>set intnerfaces ge-0\/0\/8 flexible-vlan-taging<br>encapsulation flexible-ethernet-services<br>unit 300 encapsulation vlan-vpls<br>vlan-id 300<\/p>\n\n\n\n<p>2) lock entire phy interface for only vpls<\/p>\n\n\n\n<p>set intnerfaces ge-0\/0\/8 flexible-vlan-taging<br>encapsulation extendend-vlan-vpls<br>unit 300 family vpls<br>vlan-id 300<\/p>\n\n\n\n<p>PE<br>set protocols bgp group INT type internal local-address LO-IP<br>family l2vpn signaling<br>neighbor remote-PE-LO-or-RR**<\/p>\n\n\n\n<p>** RR out-of-band of MPLS path -&gt; it can&#8217;t resolve prefixes -&gt;sol: resolve VPN prefixes in inet.0 instead of inet.3<br>** RT family -&gt; avoid unnecessary RT<\/p>\n\n\n\n<p>set routing-instances VPLS instance-type vpls<br>interface ge-0\/0\/8.300<br>route-distinguisher lo:12345<br>vrf-target target:asn:12345<br>protocols vpls no-tunnel-servics -&gt; if you dont have a PIC with tunnel services **<br>label-block-size x (def=8)<br>site ONE site-identifier 1 &#8211;&gt; this implies is a VPLS BGP<br>interface ge-0\/0\/8.300<\/p>\n\n\n\n<p>** with tunnel-services<br>vt-1\/2\/1.0<br>without tunnel-services<br>lsi.1242343 (label-switch-interface)<\/p>\n\n\n\n<p>verification<br>show bgp summary -&gt; bgp.l2vpn.0 (all advertisements)<br>VPLS.l2vpn.0<\/p>\n\n\n\n<p>show route table bgp.l2vpn.0 match-prefix &#8220;PREFIX:RD:*&#8221; detail (!!! prefix:rd:remot_site:offset !!!)<\/p>\n\n\n\n<p>show vpls connections instance VPLS [extensive -&gt; see label-base, logs, etc] -&gt; verify control-plane<\/p>\n\n\n\n<p>show vpls mac-table instance VPLS -&gt; verify data-plane<\/p>\n\n\n\n<p>advertise blocl labels in bpg l2vpn? one label for each binding of a local interface to a remote interface<br>-&gt; vpn label = label base + (remote-site-id &#8211; offset)<br>** in vpls, vpn label is not bound to a local customer interface !!! -&gt; second look-up<br>** by default, bgp assing blocks of 8 labels per-vpls<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">VPLS LDP config and FEC129<\/h2>\n\n\n\n<p>= BGP: routing instace vpls, customer interface into vpls, protocols vpls into instance, optonal: no-tunnel-services<br>!=BGP: ldp in lo.0, manualy specify each neighbor PE (for each vpls), choose vpls-id (similar to virtual-circuit-id), no RT, no RD, no Site-ID<\/p>\n\n\n\n<p>set protocols ldp interface lo0.0 + FW filter for LDP<\/p>\n\n\n\n<p>set routing-instances VPLS instance-type vpls<br>interface ge-0\/0\/0.100<br>protocols vpls no-tunnels-services<br>vpls-id XXX<br>neighbor lo-PE1<\/p>\n\n\n\n<p>show ldp database<br>show vpls connections instance VPLS -&gt; VPLS-Id =&gt; LDP signaled!<\/p>\n\n\n\n<p>= fec-129 pseudowire: routing-instance, RT, RD and l2vpn-id<br>!= no needed explicit source\/target attachment identifiers (SAII\/TAII) &#8212; they are automatically generated (based on remote lo-pe<\/p>\n\n\n\n<p>set protocols ldp interface lo0.0 + Fw filter for LDP<\/p>\n\n\n\n<p>set protocols bgp group EXAM type internal<br>local-address LO-IP<br>family l2vpn auto-discovery-only<br>neighbor LO-PE2<\/p>\n\n\n\n<p>set routing-instance VPLS instance-type vpls<br>interface ge-0\/0\/0.100<br>route-distinguisher LO:xxx<br>l2vpn-id l2vpn-id:asn:xxxx -&gt; FEC129 !!!<br>vrf-target target:ASN:xxxx<br>protocols vpls no-tunnel-services<\/p>\n\n\n\n<p>show rorute receive-protocol bgp PE2-LO<\/p>\n\n\n\n<p>show vpls connections instance VPS -&gt; L2vpn-id =&gt; FEC129 !!!<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">VPLS: default vlan mode<\/h2>\n\n\n\n<p>4 vlan options in vpls:<br>-default vlan: one mac table or all interfaces regardless of the VLAN tag<br>=&gt; an interface in a bridge domain receives ALL broadcast traffic with the original sender;s VLAN tag (even if the CE is in a different vlan! -&gt; CE will drop it though)<br>-vlan-aware: separated mac tables for each unique vlan configued on a interface<br>-vlan-normalizing: one mac table for the whole vpls, vlan tags automatically swapped<br>-no-vlan: one mac table for the whole vpls, vlan tags automatically popped.swpapped<\/p>\n\n\n\n<p>set interfaces ge-0\/0\/7 flexible-vlan-tagging<br>encapsuation flexible-ethernet-services<br>unit 200 encapsulation vlan-vpls<br>vlan-id 200<\/p>\n\n\n\n<p>set interfaces ge-0\/0\/8 flexible-vlan-tagging<br>encapsuation flexible-ethernet-services<br>unit 100 encapsulation vlan-vpls<br>vlan-id 100<\/p>\n\n\n\n<p>bridge domain: like advanced vlan, one broadcast domain but not tied to a vlan number<\/p>\n\n\n\n<p>show vpls mac-table instance VPLS -&gt; VLAN: NA =&gt; default vlan mode<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">VPLS VLAN normalization, vlan-aware, dual-stack vlans<\/h2>\n\n\n\n<p>vlan-aware: one MAC table per vlan. All inside one VPLS instance. NOTE: can&#8217;t be used if VPLS contains IRB interfaces !!! (you need to use vlan-normalization instead)<br>set routing-instances VPLS vlan-id all -&gt; that&#8217;s it! (in every PE in the VPLS)<br>show vpls mac-table instance VPLS -&gt; for the same routing-instance NAME you will see severl bridgin domain per VLAN<\/p>\n\n\n\n<p>vlan-normalization: Any host can reach any host no matter the vlan they are in -&gt; choose random vlan number for entire VPLS -&gt; swap in\/out vlan-tag<br>set routing-instances VPLS vlan-id 200 (in all PEs in VPLS)<br>show interfaces ge-0\/0\/0.100 &#8211;&gt; VLAN-Tag (xxx) In(swap .200) Out(swap .100) \u2026<br>show vpls mac-table instance VPLS<\/p>\n\n\n\n<p>no-vlan mode: instance of using a random vlan-tag like in vlan-normalization, here, the vlan-tag is removed\/poped. Same goal as vlan-normalization<br>set routing-instances VPLS vlan-id none (in all PEs in VPLS) You may lose CoS info because 802.1q header contains it<br>show interfaces ge-0\/0\/0.100 &#8211;&gt; VLAN-Tag (xxx) In(pop) Out(push .100) \u2026<br>show vpls mac-table instance VPLS -&gt; Bridging domain: VLAN: none<\/p>\n\n\n\n<p>dual-stack: QinQ &#8211; C-Tag: customer tag \/ S-Tag: service tag (identifies customer). It follows the default vlan mode =&gt; 1 bridge domain, 1 broadcast domain, doesnt care about VLAN. Both inner and outer Vlan-tag need to match for host-to-host communication<br>set routing-instances VPLS vlan-id all -&gt; that&#8217;s it! (in every PE in the VPLS)<br>set interface ge-0\/0\/0.100 encapsulation vlan-vpls<br>vlan-tags outer 2000 inner 200<br>show interfaces ge-0\/0\/0.100 &#8211;&gt; VLAN-Tag ( S-tag C-tag) In(pop) Out(push .2000) \u2026<\/p>\n\n\n\n<p>*set routing-instances VPLS vlan-id inner-all -&gt; QinQ with vlan-aware (in every PE in the VPLS)<br>*set routing-instances VPLS vlan-id X -&gt; QinQ with vlan normalization (in every PE in the VPLS) -&gt; S-tag poped, C-tag normalized<br>*set routing-instances VPLS vlan-id outer-tag X inner-tag Y -&gt; QinQ with vlan normalization for outer and inner (in every PE in the VPLS)<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">VPLS Adv features and Troubleshooting<\/h2>\n\n\n\n<p>Automated BGP VPLS Site-Id deployment<br>set routing-instance VPLS protocols vpls site X automatic-site-id -&gt; PE listen to discover other Site-IDs, chooses one, listen again 30s to double-check is not in use<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>resolving-conflicts: &#8220;Unassigned&#8221; control flag (A flag = Automatic) in BGP path-attr extended-comm<br>1- manual site-id are preffered (Automatic site-ids have the A flag control bit set =1)<br>2- auto advertisements are better than auto-claims<br>3- highest LP<br>4- lowest BGP NH<br>show vpls connections<\/li>\n<\/ul>\n\n\n\n<p>MAC limiting and flood protection:<br>depends on hw: 5120 macs per vpls. 1024 macs per attachment-circuit. When MAC is over limit: New MACs are not lerned, traffic to those new MACs is flooded<br>set routing-instances VPLS protocols vpls mac-table-size X [packet-action drop]<br>set routing-instances VPLS protocols vpls interface-mac-limit Y [packet-action drop] (by default exceed MAC is not dropped)<\/p>\n\n\n\n<p>set firewall family vpls filter FLOOD-CONTROL term police-BU then policer POLICER-200K accept<br>set firewall policer POLICER-200k if exceeding bandwidth-limit 200k bust-size-limit 15k then discard<br>set routing-instances VPLS forwarding-options family vpls flood input FLOOD-CONTROL<br>show vpls statistics instance VPLS<\/p>\n\n\n\n<p>MAC flap protection (for multihoming or redundant links)<br>shutdown physical CE-facing interface if MAC flaps. pseudowire is never shutdown<br>set protocols l2-learning global-mac-move threshold-time 3 (for MACs learned for more than 300s)<br>threshold-count 6 (how many times a MAC can flap in threshold time)<br>statistical-approach-wait-time 3 (for MAC learned less than 300s)<br>[interface-recovery-time 300] by default CE-facing interface is shutdown<br>[cooloff-time 1] if MAC flaps between 3+ interfaces. by default Junos waits 30s befor shutddwon addtional interfaces<br>[virtual-mac MAC] list of MAC to exclude from MAC flapping protection like VRRP<\/p>\n\n\n\n<p>set routing-instances VPLS protocols vpls enable-mac-move-action<\/p>\n\n\n\n<p>VPLS, IRB and VRRP config<br>set interfaces irb.300 family inet address IP vrrp-group 10 virtual-address VIP priority 110 -&gt; each PE will have different priority !!!!<br>set routing-instance VPLS instance-type vpls<br>vlan-id 300<br>interface ge-0\/0\/0.300<br>routing-interface irb.300 (irb can be in vpls and l3vpn)<br>show vpls connections extensive -&gt; shows if there is an IRB in VPLS<\/p>\n\n\n\n<p>ingress-replication may saturate bw (in ring topology) -&gt; use multicast LSP for flooding efficiency (p2mp lsp) -&gt; in ring topology, ingreess PE only send traffic twice.<br>set routing-instances VPLS provider-tunnel rsvp-te label-switched-path-template default-template =&gt; enable p2mp lsp!! only in BGP-signaled VPLS!<br>show rsvp session -&gt; p2mp lsp name convention: DstPE_LOip:RD(loIP:xxx):vpls:routing-instance-name. Only one label!!!<br>show route table mpls.0 lable XXX<br>(lsi = label switch interface &#8211; virtual interface created so MAC addresses can be associated with a particular pseudowire in VPLS)<\/p>\n\n\n\n<p>bgp-ldp vpls interworking (at stiching point)<br>set routing-instances INTERW instance-type vpls<br>vrf-target target:ASN:xxx<br>route-distinguisher LOIP:xxx<br>protocols vpls site BORDER site-identifier 2<br>mesh-group LDP-SIGNALED vpls-id 123 (this is the key config)<br>neighbor LO-IP-PE-peer<\/p>\n\n\n\n<p>Troubleshooting<br>*In L2VPNs, there is a single pseudowire for a mapping between local attachment circuit and a remote attachment circuit<br>In BGP VPLS, there is a single pseudowire for a local site to a remote site, and there is a any2any mapping of local interface to remote interface<br>A PE makes a pseudowire for each local site, to each remote site -&gt; this can create loops for BU traffic -&gt; solution: just use one pseudowire that is shared by the local sites<\/p>\n\n\n\n<p>show vpls connections instance VPLS -&gt; output for the second+ local-site shows status = LM and no connections -&gt; can be confusing, but is fine, it is using the first site.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>if you forget no-tunnel-services knob -> you need Tunnel Service PIC -> show vpls connection instante VPLS -> shows NP error<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">VPLS Multihoming (loop prevention)<\/h2>\n\n\n\n<h2 class=\"wp-block-heading\">BGP-VPLS<\/h2>\n\n\n\n<p>1) like BGP L2VPN, set one PE as primary and other as backup. The remote PE will only single a pseudowire to the primary PE. The backup PE shutdowns its local cust interface<br>PE primary<br>set routing-instance VPLS interface ge-0\/0\/0.300<br>route-distinguisher LO:12345<br>protocols vpls site FOUR multi-homing<br>site-identifier 4<br>site-preference primary -&gt; LP=65535<br>interface ge-0\/0\/0.300<\/p>\n\n\n\n<p>PE backup<br>set routing-instance VPLS interface ge-0\/0\/0.300<br>route-distinguisher LO:12345<br>protocols vpls site FOUR multi-homing<br>site-identifier 4<br>site-preference backuo -&gt; LP=1<br>interface ge-0\/0\/0.300<br>show vpls connections instance VPLS -&gt; status LN = local site not designated = you are the backup, lost DF election -&gt; no getting tunnels to other VPLS sites<\/p>\n\n\n\n<p>PE remote<br>show route table VPLS.l2vpn.0 -&gt; you will see the diff LP!<br>show vpls connections instance VPLS -&gt; you will only see the pseudowire to the primary PE<\/p>\n\n\n\n<p>2) Multihome + singlehome in same PE.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>when PE has multiple sites, the lowest site-id signals the pesudowire, and all other sites share it.<\/li>\n\n\n\n<li>CRITICAL: multihome site has the highest site-id when we have single-home and multi-home. So the single home site pseusowire is always signaled. DF election will avoid the loop for multihome PE multihome + singlehome<br>set routing-instance VPLS interface ge-0\/0\/0.300<br>interface ge-0\/0.1.200<br>route-distinguisher LO:12345<br>protocols vpls site TWO site-identifer 2 -> this pseudowire will come-up<br>interface ge-0\/0\/1.200<br>FOUR multi-homing<br>site-identifier 4 -> this pseudowire will not come-up, will use site-2<br>site-preference primary -> LP=65535<br>interface ge-0\/0\/0.300 PE remote<br>show vpls connections instances VPLS -> for Site 2, you will see Up but for Site 4, you will see RM (remote-site-ID not minimum designated) 3) Best site: overrides the default election of signaling the pseudowire with the lowest site-id<ul><li>site-id with no interfaces -> pseudowire will come up !!!<\/li><\/ul>So to avoid down-time (only 1 pseudowire active, if its site goes down, need to signal a new one) when having multi-home + single-home sites in a PE<br>=> use best-site with a dummy site-id that has no interfaces!!! => you will have a pseudowire always up between PEs no matter which site is up or down in the PE. So each PE has a dummy site-id. PE multihome + singlehome + dummy site<br>set routing-instance VPLS interface ge-0\/0\/0.300<br>interface ge-0\/0.1.200<br>route-distinguisher LO:12345<br>protocols vpls site TWO site-identifer 2<br>interface ge-0\/0\/1.200<br>FOUR multi-homing<br>site-identifier 4<br>site-preference primary<br>interface ge-0\/0\/0.300<br>NINE_NINE_ONE site-identifer 991<br>best-site -> this pseudowire will be always up and shared by the other sites in the PE<br>mac-flush PE remote<br>show vpls connections instance VPLS -> only your dummy local-site will have connections up or RB (for the multihome not best-site), the other local-site will show connections as LB = Local site not best-site best-site is advertised via control-flaps in the L2 info BGP community:<br>it uses:<br>down-bit: signals if a CE is up or down<br>flush-bit: flushes MAC addresses<br>best-site bit: bit for the best site, not officially assigned!!!<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">LDP-VPLS<\/h2>\n\n\n\n<p>1) Like L2Circuit multihoming. All config is in the remote PE, and not in the PEs connected to the multihomed site.<\/p>\n\n\n\n<p>PE remote<br>set routing-instances VPLS \u2026<br>protocols vpls vpls-id 123<br>neighbor LO-PE2 revert-time 5<br>backup-neihbor lO-PE3 standby<\/p>\n\n\n\n<p>2) VERY OPTIONAL: running STP with a customer -&gt; creates a new instance<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>set routing-instances VPLS-MSTP\n                          instance-type layer-control !!!!\n                          interface ge-0\/0\/1.100\n                          interface ge-0\/0\/2.100 \n                          protocols mstp configuration-name SITE1\n                                          revision-level 1\n                                          interface ge-0\/0\/1\n                                          interface ge-0\/0\/2\n                                          msti 1 vlan 1-4094<\/code><\/pre>\n\n\n\n<p>show spanning-tree mstp configuration routing-insatance VPLS-MSTP<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">LAB: LDP-VPLS, BGP-VPLS.<\/h2>\n\n\n\n<h2 class=\"wp-block-heading\">EVPN INTRO (RFC 7432)<\/h2>\n\n\n\n<p>vpls disadvantage: MAC learning via Data plane (flood and learn: inefficient, inconsistent, fw filter difficult), multi-homing requires to shutdonw CE interfaces to avoid loop (no active-active), only one active RIB at a time, 3 signalling methods<\/p>\n\n\n\n<p>evpn overview: uses BGP: adv\/withdraw\/move MAC, multi-home, irb<br>BGP RT to autodiscovery, no flood-and-learn. remote MACs learnt via control-plane &lt;- PE snoop ARPs to learn MAC-IP and advertise via bgp PE can answer local ARP request for remote MACs = ARP supression allow\/reject MAC -&gt; routing policy.<br>MAC mobility protection:<\/p>\n\n\n\n<p>Ethernet Segment: set of links connect to the same customer device. Multi-home links are advertised in BGP -&gt; key to avoid loops: ESI: ethernet Segment Id (ESI of all zeros = single-home)<\/p>\n\n\n\n<p>active-active IRBs: no need of VRRP<\/p>\n\n\n\n<p>MPLS dataplane is not mandatory, it can use VXLAN -&gt; add VXLAN header: vni = vxlan id<\/p>\n\n\n\n<p>AFI=25<br>sAFI=80=evpn<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">EVPN Using BGP to Advertise MACs and to Flood Traffic<\/h2>\n\n\n\n<p>EVPN Instance = EVI = &#8220;vrf&#8221;<br>EVPN Types<br>type1: ethernet auto-discovery route<br>type2: mac\/ip advertisement route &lt;- arp snooping: it sends 2xtype2: one with MAC only and other with MAC\/IP<br>type3: inclusive multicast ethernet tag route (BUM traffic)<br>type4: ethernet segment route<\/p>\n\n\n\n<p>ethernet tag = vlan-id<\/p>\n\n\n\n<p>Type2: MAC or MACIP<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>in VPLS, each PE has a pseudowire to each other PE -> each pseudowire has a unique VPN label -> this enables data plane learning<\/li>\n\n\n\n<li>in EVPN, no data plane learning -> Type2 can use same label for all remote PEs -> all devices in an EVI share a common VPN label for know MACs<br>MAC, Vlan tag and VPN label is enough<\/li>\n<\/ul>\n\n\n\n<p>Type3: request flood traffic from remote PEs. Use L3VPN Multicacst concepts. PE join inclusive-tree for each bridge domain in an EVI<br>contains PMSI attribute -&gt; that is a path attribute inthe BGP update message. It has a unique MPLS label (different from typ2). Tunnel type is Ingress Replication (sending PE replicates the flood packet for each remote PE, instead of using multicast)<br>type3 content is quite short. most things are in the PMSI section<\/p>\n\n\n\n<p>*EVI has at least two labels: one for known macs for &#8220;all&#8221; bridge domains and<br>one for flood traffic &#8220;per&#8221; bridge domain (ie 4 bridge domains -&gt; 4 unique vpn labels)<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">EVPN Configuring a Single-Homed VLAN-Based EVI<\/h2>\n\n\n\n<p>requisites:<br>ISIS\/OSPF all PEs-RR<br>MPLS LSP between PEs (RR can be oob of the mpls path -&gt; must do: set routing-options resolution rib bgp.evpn.0 resolution-ribs inet.0 (RR must resolve NH in inet0 instead of inet3 because it is not in the MPLS path)<br>FW filters: bpg, igp, ldp\/rsvp<br>LB: set policy-options policy-statement LB then load-balance per-packet<br>set routing-options forwarding-table export LB<\/p>\n\n\n\n<p>set protocols bgp group INTERNAL family evpn signaling &#8211;&gt; mandatory<br>inet-vpn unicast &#8211;&gt; optional for L3VPN!<\/p>\n\n\n\n<p>vlan-based EVI: instance-type evpn<br>only one vlan-id<br>one single bridge domain with automatic vlan normalization (it doesnt matter what vlan tag you configure on the various customer-facing interfaces)<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>set routing-instance BLUE instance-type evpn\n                          vlan-id 90\n                          inteface ge-0\/0\/0.90\n                          route-distinguisher LO:90\n                          vrf-target target:ASN:90\n                          protocols evpn\n\/\/ MX l2 interface\nset  interface ge-0\/0\/0 flexible-vlan-tagging\n                        encapsuation flexible-ethernet-services\n                        unit 90 encapsulation vlan-bridge\n                                vlan-id 90\n                                family-bridge\n\nshow bgp summary\n\nshow route table bgp.evpn.0 match-prefix \"2:RD:*\"\n  2:RD(lo:vlan)::ethe-tag(vlan-id)::(mac|mac::ip)\/304\n  3:RD(lo:vlan)::ethe-tag(vlan-id)::sender-pe-lo\/248\n\nshow evpn instance BLUE extensive (very long!)\n\nshow evpn database\n\nshow evpn mac-table (for vlan-based evi \/ instance-type evpn)\n\nshow bridge mac-table (for vlan-aware evi \/ instance-type virtual-switch)    <\/code><\/pre>\n\n\n\n<p>vlan-aware EVI: instance-type virtual-switch<br>as many bridge domains as you like<br>each bridge domain is aware of the vlans it hosts<\/p>\n\n\n\n<p>IM = inclusive multicast<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">EVPN Configuring a Single-Homed VLAN-aware bundle EVI<\/h2>\n\n\n\n<p>vlan-aware evi -&gt; each vlan gets its own named bridge domain in the routing instance.<\/p>\n\n\n\n<p>set routing-instance GREEN instance-type virtual-switch<br>interface ge-0\/0\/0.1245<br>interface ge-0\/0\/1.3525<br>route-distinguisher lo:aaa<br>vrf-target target:asn:aaa<br>protocols evpn extended-vlan-list [ 50 60 70 ]<br>bridge-domains v50 vlan-id 50<br>v60 vlan-id 60<br>v70 vlan-id 70<\/p>\n\n\n\n<p>set interface ge-0\/0\/0 flexible-vlan-tagging<br>encapsulation flexible-ethernet-service<br>unit 1245 family bridge interface-mode trunk<br>vlan-id-list [ 50 60 70 ]<\/p>\n\n\n\n<p>show evpn instance extensive GREEN -&gt; see several bridge domains. One single vpn label for all MACs in all bridge-domain. each vlan has its own label for BUM (IM)<\/p>\n\n\n\n<p>show route table bgp.evpn.0 match-prefix &#8220;3:lo-pe:*:&#8221;<\/p>\n\n\n\n<p>show evpn database instance GREEN<\/p>\n\n\n\n<p>show bridge mac-table instance GREEN<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">EVPN Multihoming Configuration and Type 4 Routes (Ethernet Segment: advertise PEs in a ES, and choose DF) Prevent loops when traffic comes from remote PE<\/h2>\n\n\n\n<p>CE links are in bundle ae to different PEs. All active links.<\/p>\n\n\n\n<p>CE<br>set chassis aggregated-devices ethernet device-count 1<\/p>\n\n\n\n<p>set interfaces ge-0\/0\/0 gigether-options 802.3ad ae0 -&gt;to PE1<br>set interfaces ge-0\/0\/1 gigether-options 802.3ad ae0 -&gt;to PE2<\/p>\n\n\n\n<p>set interface ae0 flexible-vlan-tagging<br>mac xx:xx:xx:00:02:30 (optional)<br>aggregated-ether-options lacp active<br>unit 11 vlan-id 11<br>family-inet address IP\/24<\/p>\n\n\n\n<p>** eachc unit is in a different VRF<\/p>\n\n\n\n<p>PE<br>set chassis aggregated-devices ethernet device-count 1<\/p>\n\n\n\n<p>set interfaces ge-0\/0\/0 gigether-options 802.3ad ae0 -&gt;to CE1<\/p>\n\n\n\n<p>set interface ae0 flexible-vlan-tagging -&gt; each unit can use single or stacked tagging<br>encapsulation flexible-ethernet-services -&gt; each unit can use any service: vpls, evpn, etc<br>aggregated-ether-options lacp system-id xx:xx:xx:xx:xx:xx (same in both PEs!)<br>esi 00:xx:xx:xx:xx:xx:xx:xx:xx:xx all-active (same in both PEs) (if ESI all zero -&gt; single-home)<br>unit 90 encapsulation vlan-bridge<br>vlan-id 90<br>family bridge<br>unit 1234 family bridge interface-mode trunk<br>vlan-id-list 11-14<\/p>\n\n\n\n<p>** eachc unit is in a different VRF<\/p>\n\n\n\n<p>show evpn instance extensive NAME -&gt; check for the aeX and ESI<br>show evpn instance NAME designated-forwarder<br>show route table bgp.evpn.0 match-prefix &#8220;4:*&#8221; [detail] -&gt; 4::ESI:PE_loIP\/296<\/p>\n\n\n\n<p>type4 ethernet segment -&gt; avoid loop in multihoming (similar to type1!!!)<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>accepted only by PEs on the same ES -> discover other PEs on the segment + elect DF (designated fw) for segment =? auto-generated RT for the segment (ES Import -> and creates a hidden import policy to accept that RT) ->PEs in the same segment, accept it, the other PEs, ignore it.<\/li>\n<\/ul>\n\n\n\n<p>type of loops: &#8211; remote PE1 send BUM to both multihomed PE-2\/3 -&gt; fixed with DF in segment = DF only PE that forwards recevied BUM from remote-PE to local-CE<br>multihomed CE send BUM to both PE2\/3 ech EVI has A DF<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">EVPN Multihoming Features Using Type 1 Routes (Ethernet Auto-Discovery: accepted by every PE in the VPN, not just the ES) Prevent loops when traffic comes from local-CE<\/h2>\n\n\n\n<p>(COMPLEX!!!)<\/p>\n\n\n\n<p>two types: type1 ethernet auto-discovery **Per-ES: one single type1 is sent for the entire ES =&gt; all other PEs learnt about the ES automatically<br>3 pieces: advertise RT of each EVI in ES, special ESI MPLS Label community to avoid loops (all-active=0, be careful with 20b vs 24b), ESI and MPLS Label = 0 (the actual label is the ESI MPLS label) !!!<br>two functions: Mass MAC withdrawal: PE withdraws its type1 per-ES when the CE-link goes down. So remote PE uses other type1 for that segment. This is quicker than sendng one type2 withdraw for each MAC in the segment.<br>Loop prevention: PE-3 received BUM from CE, it sends to PE-2 (that is in ES), but PE-2 doesnt send the BUM to the CE because the ESI in the type1, it sends it to other different ESI (= split horizon filtering). Keep in mind that there are 3 labels here: bottom = ESI label, medium = VPN label, top = Transport label.<br>**Per-EVI: multiple type1 sent, one per EVPN instance in ES: MPLS Label != 0 !!!!<br>twp functions: Enable remote-PEs to LB to all-active ESI = aliasing (if the receiver PE doesnt now the MAC, still can forward it)<br>faster failover in single-active ESI = backup path<br>You need both type1 AD<br>1st: type AD per-ES: remote-PE know about the ES exists<br>2nd: type AD per-EVI: remote-PE can send traffic to devices connected to ESI<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>show evpn instance extensive NAME<br>show evpn database instance GREEN -&gt; if &#8220;Active Source&#8221; = ESI -&gt; it can LB<\/p>\n<\/blockquote>\n\n\n\n<h2 class=\"wp-block-heading\">EVPN MAC Mobility and IRB Interfaces<\/h2>\n\n\n\n<p>enabled by default<\/p>\n\n\n\n<p>Typ2 + &#8220;mobility mobility&#8221; community = static flag + seq nu (same seq -&gt; tie braker is PE with lowest IP) +<\/p>\n\n\n\n<p>show route table bgp.evpn.0 match-prefix 2:(RD:lo:x)::vlan::MAC:21\/304 detail<\/p>\n\n\n\n<p>default mac flap protection: 4 moves in 3 minutes -&gt; 5th moved is blocked = PE will not advertise type2 -&gt; manual clearing<\/p>\n\n\n\n<p>clear evpn duplicate-mac-suppresion<br>show evpn database extensive mac-address MAC instance EXAMPLE<br>set routing-instance EXAMPLE protocols evpn duplicate-mac-detection detection-threshol 4 detection-window 180 auto-recovery-time 300 (default 0 -&gt; manual recovery)<\/p>\n\n\n\n<p>Every PE can host an active IRB. 3 options<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>automatic gateway mac-ip sync: each IRB has unique IP\/MAC. Advertised via type2 + &#8220;Default Gatway&#8221; community. Network syncs automatically PE1<br>set interfaces irb unit 50 family inet address 10.50.0.1\/24 mac 00:00:10:50:00:01<br>set routing-instancces GREEM bridge-domains v50 routing-interface irb.50<br>protocols evpn default-gateway advertise (default)<br>PE2<br>set interfaces irb unit 50 family inet address 10.50.0.2\/24 mac 00:00:10:50:00:02<br>idem show route table bgp.evpn.0 match-prefix 2:(RD:lo:x)::vlan::MACirb::IPirb detail<br>show bridge evpn peer-gateway-macs -> list of all automatic-gateways MACs received<br>show evpn instance extensive trade-off: migrated VMs lose their gw IF the original PE goes down<\/li>\n\n\n\n<li>manual gateway mac-ip sync: eachc IRB has same IP\/MAC. No bgp advertise. Manual sync PEx<br>set interfac irb unit 50 family inet address 10.50.0.1\/24 mac 00:00:10:50:00:01<br>set routing-instances GREEN protocols evpn default-gateway do-not-advetise<br>bridge-domains v50 routing-interface irb.50 show evpn instance GREEN extensive (no default gw MAC advertisement !!!) trade-off: mgmt is limited because all PE irb have the same IP<\/li>\n\n\n\n<li>Virtual gateway (most famous): each IRB has two IP: 1 unique for mgmt (system MAC) and a shared IP for default gw (VRRP MAC) PE1<br>set interfaces irb unit 50 family inet address 10.50.0.1\/24 virtual-gateway-adress 10.50.0.254<br>set routing-instance GREEM protocos evpn default-gateway no-gateway-community -> type2 is generated for irb unique IP but withtou cmmunity<br>bridge-domains v50 routing-interface irb.50<br>PE2<br>set interfaces irb unit 50 family inet address 10.50.0.2\/24 virtual-gateway-adress 10.50.0.254<br>idem trade-off: a bit more complex, use more IPs and MAC table increases<\/li>\n<\/ul>\n\n\n\n<p>LAB:<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">EVPN Integration with L3VPNs (COMPLEX !!!! chained composite next hop -&gt; efficiency in PFE: can rewrite big ammount of entries when NH (PE failover\/changes)<\/h2>\n\n\n\n<p>CCNH is mandatory for EVPN: enables MAC rewrite and label actions between Vlans<\/p>\n\n\n\n<p>l3vpn -&gt; type: vrf \/ family: inet-vpn unicast<\/p>\n\n\n\n<p>set routing-instances GREEN instance-type vrf<br>interface irb.50<br>route-distinguisher LO:xxx vrf-target target:asn:xxx vrf-table-lable (one-label for entire vrf)<\/p>\n\n\n\n<p>irb can be in l3vpn (l3) and evpn (l2)<\/p>\n\n\n\n<p>By default PE advertise for directled connected host (from the irb) -&gt; l3vpn \/32 to remote PE, so dont follow the \/24 irb advertised by all other PEs and can go directly to the PE advertisnig the \/32 &#8212; IMPORTANT !!!!<\/p>\n\n\n\n<p>PE advertises 1x EVPN Type2 MAC for each IP leartn in the irb<br>1x EVPN type2 MAC+IP idem<br>1x l3vpn \/32 (useful for PE that dont talk evpn)<\/p>\n\n\n\n<p>remote PE that receives evpn type2 mac+ip CREATES l3pvn route in l3vpn table with preference 7 (because contains a lot of frame manipulation) and then uses evpn instead of l3vpn =&gt; useful for moving frames between vlans !!!!<\/p>\n\n\n\n<p>show route table GREEN_L3.inet.0 10.60.0.11 protocol evpn detail -&gt; &#8220;Ethernet header rewrite&#8221;<br>detail -&gt; &#8220;Composite Next Hop&#8221;<\/p>\n\n\n\n<p>set routing-instances GREEN protocols evpn remote-ip-host-routes -&gt; creates local l3vpn host route entries for remote IPs<\/p>\n\n\n\n<p>extra:<br>evpn-vpws (virtual private wire services) evpn signals pseudo-wires, no mac learning. only type1\/4 (no type2), active\/active multihoming<br>evpn-etree: hub-spoke, prevent spoke-to-spoke, no need for routing-policies or asym RTs<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Inter-AS MPLS VPNs (complex but interesting, I think i understand it)<\/h2>\n\n\n\n<p>three methods: A<br>A: treat the other AS like a regular customer site so it is added to the VRF. No unique config required. Trade-off: extensive config to maintain (routes and MAC to learn)<br>From AS1, the ASBR from AS2 is like a CE, and viceversa. No MPLS between the devices, just VLAN multiplexing<\/p>\n\n\n\n<p>B: each ASBR exchange BGP VPN (and labels) via eBGP (good when both AS belongs to the same org). No LSP between ASBRs. because it is eBGP, all bgp vpn are advertised and accepted. No need of vrfs. VPN labels are swapped at both ASBRs. Good: no need of vrfs in ASBR, simple is you are happy to run MPLS between both networks. Trade-off: ASBRs must learn every single VPN adv and generate a new vpn label -&gt; strong CP and large LFIB<\/p>\n\n\n\n<p>C: family bgp-label-unicast, create LSPs between AS. More complex but more scalable. PEs from each AS peer each other: eBGP + exchange vpn labels and prefixes =&gt; Loopbacks from each AS need to be exchanged, LSP between ASNs !!-&gt; BGP-LU fixes it.<br>Good: no vrfs in ASBR, no large LFIB in ASBR<br>trade-off: complicated, increase label stackc<\/p>\n\n\n\n<p>bgp-lu: advertise regular IPs with a transport!!! MPLS label. Between ASBRs only:<br>There are three LSP, one inside AS1, other between ASBRs and other in AS2.<br>PEs (inter AS!!) talk &#8220;family l2vpn signaling + eBGP!!&#8221;.<br>PES and its ASBR talk &#8220;family inet labeled-unicast + iBGP!!!&#8221;<br>ASBRs talk &#8220;family inet labeled-unicast + eBGP!!&#8221;<br>three label stack: top: transport to ASBR<br>middle: bgp-lu label processed by ASBR, and then swapped to send it to neigbbor ASBR<br>bottom: vpn label.<\/p>\n\n\n\n<p>PE1 (AS1)<br>set routing-instances L2VPN-1 instance-type l2vpn<br>interface ge-0\/0\/6.620<br>route-distinguisher lo:asn<br>vrf-target target:asn:xxx<br>protocols l2vpn encapsulation-type ethernet-vlan<br>site CE1 site-identifier 1<br>interface ge-0\/0\/6.620 remote-site-id 2<br>set protocols bgp group INTERNAL type internal (no export policies!)<br>local-address lo<br>family inet labeled-unicast resolve-vpn (copies bpg-lu from inet.0 to inet.3 -&gt; PE1 can use PE2-lo to resolve vpn prefixes)<br>neighbor ASBR-1-lo<br>EXTERNAL type external (to remote PEs in AS2)<br>multihop<br>local-address lo<br>family l2vpn signaling<br>peer-as AS2<br>neighbor PE2-AS2-lo<\/p>\n\n\n\n<p>show route received-protocol bgp ASBR-1-LO &#8211;&gt; you will see the PE2-AS2-LO in inet.0 and inet.3 !!!<br>PE2-AS2-LO &#8211;&gt; you wil see bgp.l2vpn.0 and L2VPN-1.l2vpn.0 prefixes !!!<br>table mpls.0 -&gt; you will see three labels to PE2-AS2<br>show l2vpn connections<\/p>\n\n\n\n<p>ASBR1 ** normally from eBGP to iBGP you need to change NH because iBGP peers dont know the eBGP NH\u2026<br>set protocols bgp group INTERNAL type internal ** when new label is generated, NH is changed !!! for that reason dont need next-hop-self here!<br>local-address lo<br>family inet labeled unicast<br>neighbor PE1-lo<br>EXTERNAL type external<br>family inet labeled unicast<br>export AS1-PE-LO-EXPORT<br>peer AS2<br>neighbor ASBR2-physical-ip<\/p>\n\n\n\n<p>set protocols mpls traffic-engineering mpls-formarding &#8211;&gt; copies LSPs into inet.0 BUT only use for forwarding. IGP still used for CP.<br>interface all<\/p>\n\n\n\n<p>*Carrier-of-Carried (CoC) VPNs: Small SP is in two distant locations (with different ASn), and uses a large SP to connect both locations. Inter-AS MPLS but using another SP with option-C =&gt; BGP-LU between ASBRs and PEs.<br>BGP-LU ibgp: cust-pe1 &lt;&gt; cut-asbr1<br>BGP-LU ebgp: cust-asbr1 &lt;&gt; coc-asbr1<br>BGP-LU ibgp: coc-asbr1 &lt;&gt; coc-asbr2<br>BGP-LU ebgp: coc-asbr2 &lt;&gt; cust-asbr2<br>BGP-LU ibgp: cust-asbr2 &lt;&gt; cust-pe2<\/p>\n\n\n\n<p>BGP-L2VPN ebgp: cust-pe1 &lt;&gt; cust-pe2<\/p>\n\n\n\n<p>LSP cust-pe1 &lt;&gt; cust-asbr1<br>LSP coc-asbr1 &lt;&gt; coc-asbr2<br>LSP cust-asbr &lt;&gt; cust-pe2<\/p>\n\n\n\n<p>CUST-PE1 (AS1)<br>set routing-instances L2VPN-1 instance-type l2vpn<br>interface ge-0\/0\/6.620<br>route-distinguisher lo:asn<br>vrf-target target:asn:xxx<br>protocols l2vpn encapsulation-type ethernet-vlan<br>site CE1 site-identifier 1<br>interface ge-0\/0\/6.620 remote-site-id 2<br>set protocols bgp group CUST-AS2 type external<br>multihop<br>local-address lo<br>family l2vpn signalinb<br>peer-as AS2<br>neighbor CUST-PE2-lo<br>INTERNAL type internal<br>local-address cust-pe1-lo<br>family inet labeled-unicast resolve-vpn (copies bgp-lu from inet.0 to inet.3)<br>neighbor cust-asbr1-lo<\/p>\n\n\n\n<p>show route received-protocol bpg CUST-ASBR1-LO -&gt; in inet.0 and inet.3 (because resolve-vpn and NH changed!) learn CUST-PE2-LO<br>CUST-PE2-LO -&gt; bgp.l2vpn.0 and L2VPN-1.l2vpn.0<br>show l2vpn connections<\/p>\n\n\n\n<p>CUST-ASBR1<br>set protocols bgp group COC-SP type external<br>family inet labeled unicast<br>export CUST-PE-LO-EXPORT<br>peer-as COC-ASN<br>neighbor coc-asbr1-phy-ip<br>INTERNAL type internal<br>local-address cust-asbr1-lo<br>family inet labeled-unicast)<br>neighbor cust-pe1-lo<\/p>\n\n\n\n<p>COC-ASBR1: ** no need of export policy and no need of &#8220;resolve-vpn&#8221; because COC carrier has no visibility of CUST VPNs<br>** no need of NH-self like in option-C because when advertising a new label, NH is updated automcatically ebgp-&gt;ibgp<br>** in real world, the COC puts CUST into a L3VPN to keep separation.<br>set protocols bgp group CUST type external<br>family inet labeled unicast<br>peer-as CUST<br>neighbor cust-asbr1-phy-ip<br>INTERNAL type internal<br>local-address coc-asbr1-lo<br>family inet labeled-unicast<br>neighbor coc-asbr2-lo<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Circuit Cross-Connect (ccc)<\/h2>\n\n\n\n<p>No MAC learning (frames are simply forwarded). It can stitch two RSVP LSPs<\/p>\n\n\n\n<p>** pseudowire: donwside: 2xRSVP LSP, one in each direction, only dedicated to the CCC vpn -&gt; increase RSVP state if you have many ccc<br>upside: just one label<\/p>\n\n\n\n<p>pe1:<br>set protocols connetions remote-interface-switch CCC1 interface ge-0\/0\/9.300<br>transmit-lsp LSP_CEA-to_CEB<br>receive-lsp LSP_CEB-to_CEA<br>pe2:<br>set protocols connetions remote-interface-switch CCC1 interface ge-0\/0\/8.300<br>transmit-lsp LSP_CEB-to_CEA<br>receive-lsp LSP_CEA-to_CEB<\/p>\n\n\n\n<p>** you need to define the LSP !!!<\/p>\n\n\n\n<p>show connections remote-interface-switch CCC1<\/p>\n\n\n\n<p>** Local switching: connecting two ports in the same device<\/p>\n\n\n\n<p>set interfaces ge-0\/0\/8 flexible-vlan-tagging<br>encapsulation extended-vlan-ccc<br>unit 300 vlan-id 300<br>unit 300 family ccc<br>9 idem<\/p>\n\n\n\n<p>set protocols connections interface-switch 008_to_009 interface ge-0\/0\/8.300<br>interface ge-0\/0\/9.300<\/p>\n\n\n\n<p>show connections interface-switch 008_to_009<\/p>\n\n\n\n<p>** LSP stitching:<\/p>\n\n\n\n<p>abr:<br>set protocols connections lsp-switch pe1-to-pe2 transmit-lsp abr-to-pe2<br>receive-lsp pe1-to-abr<br>pe2-to-pe1 transmit-lsp abr-to-pe1<br>receive-lsp pe2-to-abr<br>** you need to define the LSP !!!<\/p>\n\n\n\n<p>show route table mpls.0 lable xxxs<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Multisegment Pseudowires: RFC 6073<\/h2>\n\n\n\n<p>pseudowire need to cross between different AS = Inter-AS option B but! ABRs take part in the vpn<\/p>\n\n\n\n<p>T-PE: Terminating PE = PE hosts the customer-facicn interface = PE terminates the pseudowire<br>S-PE: Switching PE = PE that stitches two segments (ABR)<\/p>\n\n\n\n<p>SS-PW: single-segment pseudowire: the &#8220;normal&#8221; one. vpn label is not changed between T-PEs<br>MS-PW: multi-segment pseudowire: set of pw segments that function as a single p2p pw. VPN label changes<\/p>\n\n\n\n<p>junos uses FEC129 for MS-PW.<br>BGP autodiscover the router at the other end of the segment.<br>T-PE only needs to see the next S-PE in the path<br>LDP exchange VPN label for the specific segment: S-PEs swap vpn labels between segments<br>LSP between S-PEs (ABRs)<br>family l2vpn autodiscovery-mspw: 3xLSP: T-PEX1 &lt;&gt; S-PEX2 (ibgp), S-PEX2 &lt;&gt; S-PEY2 (ebgp), S-PEY2 &lt;&gt; T-PEY1 (ibgp)<\/p>\n\n\n\n<p>T-PEX1<br>set routing-instances MS1 instance-type l2vpn<br>interface ge-0\/0\/9.0<br>route-distinguisher LO:200<br>l2vpn-id l2vpn-id:ASN:200<br>vrf-target target:ASN:200<br>protocols l2vpn site CE1 source-attachment-identifier 200:200:1 =&gt; Type 2 AII !!!<br>interface ge-0\/0\/9.0 target-attachment-identifier 200:200:2<br>pseudowire-status-tlv<br>set protocols bgp group INT type internal<br>local-address LO<br>family l2vpn auto-discovery-mspw<br>neigbor LO-S-PEX2<\/p>\n\n\n\n<p>show route table mpls.0<br>show l2vpn connections extensive &#8211;&gt; l2vpn-id = FEC129 + segments<\/p>\n\n\n\n<p>S-PEX2<br>set protocols bgp group INT type internal<br>local-address LO<br>family l2vpn auto-discovery-mspw<br>export NH-SELF<br>neighbor LO-T-PEX1<br>group EXT type external<br>multihop ttl 1<br>local-address LO-S-PEX2<br>family l2vpn auto-discovery-mspw<br>peer-as AS2<br>neighbor LO-S-PEY2<\/p>\n\n\n\n<p>static route to LO-S-PEY2 nh phy-int<\/p>\n\n\n\n<p>set protocols ldp interface ge-TO-T-PEX1.0<br>lo.0<br>rsvp interface ge-To-S-PEY2<br>mpls label-switched-path TO-S-PEY2 to LO-S-PEY2, no-cspf<br>interface ge-TO-T-PEX1 ??<br>interface ge-TO-S-PEY2 ??<\/p>\n\n\n\n<p>show route receive-protocol bgp LO-T-PEX1 &#8211;&gt; MS-PW has two new tables: bgp.l2vpn.1 and ldp.l2vpn.1<br>LO-S-PEY2<\/p>\n\n\n\n<p>**LAB: Inter-AS Option-C and MS-PW ***<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">VPLS Hub and Spoke Topologies<\/h2>\n\n\n\n<p>preventing vpls local switching (two CEs connected to same PE) -&gt; config in all spoke PEs: set routing-instance VPLS_HS no-local-switching<\/p>\n\n\n\n<p>3 methods<br>** asymmetric RT: by deault all PEs in the VPLS use the same RT<br>H&amp;S: Hub PE sends RT1 to Spoke PEs<br>Spoke PEs send RT2 to Hub PE, onl accepted by Hub PE!<br>HUB PE<br>set policy-options community Hub2Spoke members target:ASN:123<br>Spoke2Hub members target:ASN:456<br>policy-statement ADVERT-H2S term h2s then community add Hub2Spoke, accept<br>RECEIVE-S2H term accept-spoke from community Spoke2Hub then accept<br>reject then reject<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code> set routing-instances VPLS_HS vrf-import RECEIVE-S2H\n                               vrf-export ADVERT-H2S\n\n show vpls connections instance VPLS_HS --&gt; nothing new here<\/code><\/pre>\n\n\n\n<p>SPOKE PE<br>set policy-options community Hub2Spoke members target:ASN:123<br>Spoke2Hub members target:ASN:456<br>policy-statement ADVERT-S2H term s2h then community add Spoke2Hub, accept<br>RECEIVE-H2S term accept-hub from community Hub2Spoke then accept<br>reject then reject<br>set routing-instances VPLS_HS vrf-import RECEIVE-H2S<br>vrf-export ADVERT-S2H<br>no-local-switching<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code> show vpls connections instance VPLS_HS --&gt; connection-site: only to Hub PE<\/code><\/pre>\n\n\n\n<p>** site-range with BGP VPLS. use site-range 1 in all spoKe PEs. All spoke PEs have site-id higher than site-range. No routing policies.<br>Hub PE has site-id 1.<\/p>\n\n\n\n<p>SPOKE-PE<br>set routing-instances VPLS_HS instance-type vpls<br>no-local-switching<br>vrf-target target:asn:123<br>protocols vpls site-range 1<br>no-tunnel-services<br>site N20<br>site-identifier 20<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code> show vpls connections instances VPLS_HS -&gt; the connections to other PE spkes are in OR=Out of range !!!<\/code><\/pre>\n\n\n\n<p>** Hub-spoke LDP VPLS = hierarchical VPLS: Hub is VPLS, Spokes are L2Circuit (no MAC learning)<br>spoke-PE = MTU-s = multitenant unit switch<br>hub-PE = PE-rs = PE routing and switching (RFC 4762)<\/p>\n\n\n\n<p>HUB (vlan-aware -&gt; accepts all vlans)<br>set routing-instances VPLS_HS instance-type vpls<br>vlan-id all<br>interface ge-0\/0\/8.0<br>protocols vpls no-tunnel-service<br>vpls-id 1234<br>neighbor PE1-S-lo<br>neighbor PE2-S-lo<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>set interface ge-0\/0\/8 (CE) encapsulation ethernet-vpls unit 0 famiy vpls\n\nshow vpls connections instances VPLS_HS\nshow vpls mac-table instance VPLS_HS\n\n***if you want spoke2spoke via hub: create mesh group in HUb \nset routing-instances VPLS_HS instance-type vpls\n                              vlan-id all\n                              interface ge-0\/0\/8.0\n                              protocols vpls no-tunnel-service\n                                             mesh-group L2-circuits &lt;----\n                                               vpls-id 1234\n                                               local-switching &lt;------\n                                               neighbor PE1-S-lo\n                                               neighbor PE2-S-lo<\/code><\/pre>\n\n\n\n<p>SPOKE<br>set protocols l2circuit neighbor PE1-S-lo interface ge-0\/0\/8.0 virtcual-circuit-id 1234 (matches vpls-id in HUB !!!!)<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>set interface ge-0\/0\/8 (CE) encapsulation ethernet-ccc unit 0\n\nshow l2circuit connections<\/code><\/pre>\n\n\n\n<p>=========================================<br>Junos Layer 3 VPNs On-Demand<br>=========================================<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Refresher VPNs and MPLS: LDP (automatic LSP via IGP), RSVP (manual LSP but with TE). LSP between PEs. LSP are unidirect<\/h2>\n\n\n\n<h2 class=\"wp-block-heading\">Layer 3 VPNs Overview<\/h2>\n\n\n\n<p>RD type0: 2B ASN + 4B number<br>type1: 4B IP (PE-lo) + 2B number (best for CE multihome because a RR would see two different vpnv4)<br>type2: 4B ASN + 2B number<\/p>\n\n\n\n<p>Mask (1B) + MPLS Label (3B) + RD( type (2B) + Admin (var + Number (var)) + ipv4 (4B)<\/p>\n\n\n\n<p>vpnv4 afi=1 safi=128<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Layer 3 VPNs Operation Characteristics<\/h2>\n\n\n\n<p>policy-based routing<br>RT: vrf-target<br>inner label: advertised by BGP (vrf lable)<br>outer label: advertised by LDP, RSVP. (transport label)<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Layer 3 VPN Configuration<\/h2>\n\n\n\n<p>IGP for PE\/P Lo<br>isis or ospf<\/p>\n\n\n\n<p>iBPG between PEs Lo + family inet-vpn unicast (show bgp neighbor LO)<br>set protocols bgp group IBGP type internal<br>family inet-vpn unicast<br>local-address LO<br>neighbor PEx-LO<\/p>\n\n\n\n<p>LDP\/RSVP + LSP between PEs<br>set interfaces X unit 0 family mpls<br>set protocols mpls interface X<br>set protocols ldp interface X<br>lo0<br>show mpls interface<br>show ldp interface<\/p>\n\n\n\n<p>tables:<br>inet.0 &#8211; igp and bgp<br>inet.3 &#8211; rsvp\/ldp routes used to resolve BGP nh<br>mpls.0 &#8211; all labels + actions<br>bgp.l3vpn.0 &#8211; all vpnv4 received from remote PEs. NH resolved using inet.3<br>.inet.0 &#8211;<\/p>\n\n\n\n<p>set routing-instances VPNA instance-type vrf<br>interface ge-1\/0\/4.0 (PE-CE)<br>route-distinguisher LO:xxx<br>vrf-target target:asn:xxx (should match remote-PE) \/\/ you can use vrf-import\/export policies<br>protocols bgp group G1 type external<br>peer ASG1<br>neighbir CE-IP<br>import IMPORT-G1<br>**routing-option autonomous-system ASX indepedent-domain (optional: customer attributes preserved using ATTRSET)<br>**as-override: when CEs are in the same ASN<\/p>\n\n\n\n<p>set routing-options route-distinguisher LO -&gt; automatically creates type1 RD for each VRF***<\/p>\n\n\n\n<p>site-of-origin SoO &#8211; CE is multihome and as-override is required. -&gt; avoid loops between multihome CEs! use vrf-import\/export<br>set policy-options community SoO members origin:LO:yyy<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Layer 3 VPN Verification<\/h2>\n\n\n\n<p>show route table<br>show route table bgp.l3vpn.0<br>show route receive\/advertised-route<br>show route forwarding-table vpn VPN<\/p>\n\n\n\n<p>vrf-table-label:<br>by default: egress PE label allocaton is per NH. IP header is not evaluated for fw in egree PE<br>vrf-table-label: egrees PE label is per VRF, IP header is used for fw after popping mpls label<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">OSPF as the PE-to-CE Protocol (rfc4577)<\/h2>\n\n\n\n<p>BGP by default accepts\/sends everything (if no import\/export)<br>OSPF needs a export policy !!! (bgp doesnt automaticallu redistribute to ospf)<\/p>\n\n\n\n<p>set routing-instances VPNA instance-type vrf<br>interface ge-0\/0\/9.0<br>route-distinguisher lo:123<br>vrf-target target:asn:123<br>protocols ospf area 0.0.0.0 interface ge-0\/0\/9.0<br>export CUST_BGP_TO_OSPF (this creates LSA-5 external!)<\/p>\n\n\n\n<p>show ospf neighbor instance VPNA<\/p>\n\n\n\n<p>lsa1 router<br>lsa2 network: when in multiaccess network, only advertise 1 connection to &#8220;pseudonode&#8221;, not to each other.<br>lsa1\/2 stay in the area<br>lsa3 summary: generated by ABR, and stays within an area. Other ABR regenerate the lsa3<br>lsa5 external: generated by ASBR, ABR doesnt change it.<\/p>\n\n\n\n<p>PEs are always area0, although not explicit. PEs dont talk OSPF between then, they do BGP<\/p>\n\n\n\n<p>type1\/3 are exported by default as l3vpn type3 by PEs -&gt; two bgp communities: route-type and domain-id<br>route-type: rte-type:area:lsa_type:lsa5_external(1=ext-type2,0=ext-type1)<br>domain-id: if source and remote domain-id are different -&gt; PE generates lsa5. By default domain-id=null=0.0.0.0<br>equal -&gt; PE generates lsa3<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">OSPF Optimal Routing (DN bit) ***<\/h2>\n\n\n\n<p>avoid loops -&gt; DN bit + VPN external route-tag (legacy for lsa5)<br>*PE sets DN bit on any lsa3\/5 generates &#8211;&gt; LSA with this bit are never readvertisd back to the vpn<br>*vpn route-tag only used for legacy devices can&#8217;t set DN in lsa5 -&gt; vpn route-tag=32b based on SP ASN<br>set routing-instances VPNA protocols ospf domain-vpn-tag XXXX (only if 4B-ASN!)<br>no-domain-vpn-tag (disable vpn-tag and DN bit!)<\/p>\n\n\n\n<p>sham-links: multihop OSPF neighbor between PEs. requires a unique Lo in customer VRF. Like a virtual-link. PEs can exchange lsa1<\/p>\n\n\n\n<p>set interface lo0 unit &#8220;1&#8221;!!! family inet address IP1\/32<br>set routing-instance VPNA interface lo0.1<br>protocols ospf area 0.0.0.0 interface lo0.1<br>area 0.0.0.0 sham-link-remote PE3-lo0.1-IP metric 10<br>sham-link local IP1<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Route Leaking **<\/h2>\n\n\n\n<p>sharing routes between vrf tables in same PE<br>**auto-export: PE analyzes vrf-import\/expor policies and vrf-target and copies VPN routes that match that<br>set routing-instances VPNA vrt-target target:asn:123 !!! the same RT in both VRFs!<br>routing-options auto-export<br>VPNB vrf-target target:asn:123 !!!<br>routing-options auto-export<\/p>\n\n\n\n<p>**rib-groups:<br>set routing-options rib-groups A2B import-rib [ VPNA.inet.0 VPNB.inet.0 ]<br>B2A import-rib [ VPNB.inet.0 VPNA.inet.0 ]<br>set routing-instances VPNA routing-options interface-routes rib-group inet A2B<br>protocols bgp group EXT family inet unicast rib-group A2B<br>VPNb routing-options interface-routes rib.group inet B2A<br>protocols bgp group EXT family inet unicast rib-group B2A<\/p>\n\n\n\n<p>if you want to keep shared vrf routes from other PEs -&gt; create policy<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Hub-and-Spoke Topologies<\/h2>\n\n\n\n<p>2 VRFs: Spoke and Hub VRF. Hub CE connected to both. Issues with looping using BGP<br>CE spokes advertise prefixes with spoke-RT<br>CE Hub leanrs that and readvertise with hub-RT to spoke sites<\/p>\n\n\n\n<p>spoke-PE<br>set routing-instances VPNA instance-type vrf<br>interface ge-0\/0\/0.0<br>route-distinguisher lo0:xx<br>vrf-import VPNA-import !!!<br>vrf-export VPNA-export !!!<br>protocols bgp group EXT type external<br>peer-as HUB<br>as-override<br>neighbor HUB-lo0<\/p>\n\n\n\n<p>set policy-options policy-statement VPNA-import term 1 from protocol bgp, community hub then accept<br>2 then reject<br>VPNA-export term 1 from protocol [bgp static direct] then community add spoke, accept<br>2 then reject<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>                community hub members target:ASN:100\n                          spoke memebers target:ASN:101<\/code><\/pre>\n\n\n\n<p>Hub-PE<br>set interfaces ge-0\/0\/0 vlan-tagging unit 0 vlan-id 100 \/\/ SPOKE<br>family inet adress 10.0.29.1\/24<br>unit 1 vlan-id 101 \/\/ HUB<br>family inet address 10.0.30.1\/24<\/p>\n\n\n\n<p>set routing-instances HUB instance-type vrf<br>routing-options autonomouns-system loops 2 !!!!<br>interface ge-0\/0\/0.1<br>route-distinguisher lo0:xx<br>vrf-import null !!!<br>vrf-export hub-out !!!<br>protocols bgp group EXT type external<br>peer-as SPOKE<br>as-override<br>neighbor spoke-PE-lo0<br>SPOKE instance-type vrf<br>routing-options autonomouns-system loops 2 !!!!<br>interface ge-0\/0\/0.0<br>route-distinguisher lo0:xx<br>vrf-import spoke-in !!!<br>vrf-export null !!!<br>protocols bgp group EXT type external<br>peer-as SPOKE<br>as-override !!!!<br>neighbor spoke-PE-lo0<\/p>\n\n\n\n<p>set policy-options policy-statement spoke-in term 1 from protocol bgp, community spoke then accept<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>                                 hub-out term 1 from protocol bgp then community add hub, accept\n\n                                 null term 1 then reject\n\n                community hub members target:ASN:100\n                          spoke memebers target:ASN:101<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Layer 3 VPN CoS (need to repeat, it didnt follow)<\/h2>\n\n\n\n<p>recommended rewrite EXP bits in each LSR, same policies in eachc PE<br>firewall filter<\/p>\n\n\n\n<p>ingress PE<br>set firewall family inet filter exp-class term 1 from source IP\/16 then forwarding-class assured-forwarding<br>loss-priority high<br>2 then accept<br>set interface ge-0\/0\/2 unit 0 family inet filter input exp-class (interface to CE)<br>address ip\/30<\/p>\n\n\n\n<p>set class-of-service classifiers exp VPN-class forwarding-class assured-forwarding loss-priority high code-point 101<br>best-effort loss-priority low code-point 000<br>expedite-forwarding loss-priority high code-point 111<br>network-control loss-priority high code-point 001<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>                  schedulers af transmit-rate percent 50\n                                priority high\n                             be transmit-rate remainder\n                                priority low\n                             ef transmit-rate percent 20\n                                pririty high\n                             nc transmit-rate percent 10\n                                pririty high\n\n                  scheduler-maps VPN-map forwarding-class assured-forwarding scheduler af\n                                         forwarding-class best-effort scheduler be\n                                         forwarding-class expedited-forwarding scheduler ef\n                                         forwarding-class network-control scheduler nc\n\n                  rewrite-rules exp VPN-rewrite forwarding-class assured-forwarding loss-priority high code-point 101\n                                                                 best-effor loss-priority low code-point 000\n                                                                 expedited-forwarding loss-priority high code-point 111\n                                                                 network-control loss-priority high code-point 001 \n\n                  interfaces ge-0\/0\/0 unit 0 classifiers exp VPN-class (link to another PE\/P!!)\n                                             rewrite-rules exp VPN-rewrite<\/code><\/pre>\n\n\n\n<p>set protocols mpls explicit-null &#8211;&gt; we dont want PHP -&gt; EXP bits lost for egreess PE<\/p>\n\n\n\n<p>vpn prefix mapping:<br>set policy-options policy-statement MAP term 1 from community GOLD then install-nexthop lsp PE1_PE2, accept<br>2 from community SILBER then install-nexthop lsp PE1_PE3, accept<\/p>\n\n\n\n<p>set routing-options forwarding-table expor MAP<\/p>\n\n\n\n<p>show route forwarding-table vpn VPN-A<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Layer 3 VPN Protection Mechanisms<\/h2>\n\n\n\n<p>*BGP PIC Edge: PIC = Prefix Independence Convergence -&gt; install vpn route in fw table as backup -&gt; faster convergence during PE failover<\/p>\n\n\n\n<p>configured in ingress PEs<br>set policy-options policy-statement LB then load-balance per-packet<br>set routing-options forwarding-table export LB<br>set routing-instances CUST1 instance-type vrf<br>routing-options protect core -&gt; PIC enabled!<br>\u2026<br>show route extensive table CUST1.inet.0 IP\/24 &#8211;&gt; &#8220;indirect next hop&#8221; weight=0x1 (active) 0x4000 (backcup)<br>show route forwarding-table table CUST1 destination IP\/24 &#8211;? idr xxx matches the &#8220;indirect nex hop&#8221; index<\/p>\n\n\n\n<p>*Provider Edge Link Protection: at ingress PE. only for external peers<\/p>\n\n\n\n<p>configured in ingress PEs and only if best path is already installed in fw table.<br>set policy-options policy-statement LB then load-balance per-packet<br>set routing-options forwarding-table export LB<br>set routing-instances CUST1 instance-type vrf<br>routing-options protect core &#8211;&gt; it seems it needs PIC too???<br>protocols bgp group EBGP type external<br>family inet unicast protection -&gt; enabled!!!<br>show route IP &#8211;&gt; see &#8220;Multipath&#8221; two bgp NH<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Layer 3 VPN Scaling<\/h2>\n\n\n\n<p>rfc 4364: create multiple BGP RR for VPN routes, BGP route refresh (supported by default), RT filtering<br>RR: on a P or device not part of MPLS fw path.<br>must resolve the advertised NH of PEs -&gt;<br>not recommened: LSP from RR to all PEs.<br>static default route in inet.3<br>*best: route resolution RIB: set routing-options resolution rib bgp.l3vpn.0 resolution-ribs inet.0<br>no needed VRFs, just VPN address-family<\/p>\n\n\n\n<p>scaling guidelines: num VRF tables (RE dependent), routes per device (hw dependent)<br>vrf localization: chained composite NH feature: sets of routes sharing same destination to a common fw NH<br>core-facing interfaces: set chassis fpc 3 vpn-localization vpn-core-facing-default -&gt; install VRF routes with NH in FPC<br>network-services enhanced-ip<br>ce-facing interfaces: set routing-instances VPNA routing-options localizaton fib -&gt; determines FPC that interfac belongs<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>                  show route vpn-localization &#91;vpn VPNA]<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">BGP Route Target Filtering<\/h2>\n\n\n\n<p>in all PE and RR. You need &#8220;route resolution RIB&#8221; (as above section) in all PE\/RR.<br>set protocols bgp group PE type internal<br>family route-target (afi=1, safi=132) &#8211;&gt; created bgp.rtarget.0 table !! (show bgp summary)<br>\u2026<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Layer 3 VPNs and Internet Access (LAB: RR, RT filter, LDP tunnelling and Internet VPN !!!) ***<\/h2>\n\n\n\n<p>Non-VRF internet access: two connections, you connect to a different or same PE. NAT in CE<\/p>\n\n\n\n<p>VRF internet access: 3 types: NAT in CE or in SP router or Hub CE. One connection to PE<br>ie NAT in CE, RIB groups in PE, routing<br>1) CE NAT config<br>set security nat source rule-set VRF-inet-access from interface ge-0\/0\/1.0<br>to interface ge-0\/0\/2.0<br>rule VRF match source-addres LAN1\/24<br>destination-add LAN2\/24<br>then source-nat off<br>rule inet-access match source-add LAN1\/24<br>destina-add defau<br>then source-nat interfce<br>2) PE RIB group<br>set routing-options interface-routes rib-group inet inet0_VPNA<br>static route CE-NAT-PUBLUC\/32 next-table VPNA.inet.0 &lt;&#8212; this is for the return traffic !!!!<br>rib-groups inet0_VPNA import-rib [ inet.0 VPNA.inet.0 ] &lt;&#8211; copy inet.0 into VPNA table<br>import-policy SELECT-ROUTES &lt;&#8211; policy states which routes to accept \/\/ optional<\/p>\n\n\n\n<p>set policy-options policy-statement SELECT-ROUTES term CORE-INTERFACES from interface ge-0\/0\/0.0 then accept<br>term DEFAULT-ROUTE from route-filter 0.0.0.0\/0 exact then accept<br>term REJECT-OTHER then reject<br>send_VPNA term 1 from protocol static<br>route-filter CE-NAT-PUBLUC\/32 exact<br>then accept<\/p>\n\n\n\n<p>set protocols bgp group GW type internal<br>export send_VPNA &lt;&#8211; GW route needs to know where to return traffic to CE<br>neighbor IP-GW famil inet unicast rib-group inet0_VPNA &lt;&#8212;- needed to accept the default route !!!!<\/p>\n\n\n\n<p>show route 0\/0 exact -&gt; in inet.0 and VPNA.inet.0 !!!<br>show route table VPNA.inet.0<br>show route CE-NAT-PUBLIC exact &#8211;&gt; it should point to table VPNA.inet.0 !!!<br>show route advertising-protocol bgp GW-IP -&gt; we need to send CE-NAT-PUBLUC to GW<br>bgp CE-NAT-PUBLIC -&gt; we need to send default and other VPN routes to CE1<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Inter-AS Layer 3 VPNs (similar to the l2vpn)<\/h2>\n\n\n\n<p>how asbr communicate?: labesl travel between AS? exchange labels? each SP runs its own IGP, how PEs between ASn discover them<br>Solutions:<\/p>\n\n\n\n<p>Option A: each SP treats each other as a CPE -&gt; each ASBR is configured wtih all VRFs and logical interfaces. No MPLS between both ASBRs<br>easy but doesnt scale well (for ASBR many VRFs!). Best options when two SPs engaged<\/p>\n\n\n\n<p>Option B: ASBRs exchange VPN labels using eBGP. No LSPs between ASBRs! No VRFS in ASBR! Best option when merging SPs<br>scale bettern than optionA, easy if you want to talk mpls between SPs. but ASBRs must learn all VPN labels and generate new one (big LFIB)<\/p>\n\n\n\n<p>Option C: PEs between SPs talk eBGP VPN -&gt; SPs needs to know Lo from the other + LSP between SPs -&gt; use BGP-LU: adv IPs with mpls label (transp)<br>ASBRs talk BPL-LU to exchange labels for each other infra lo&#8217;s =&gt; end to end LSP between PEs (LSP in SP1 + BGP-LU LSP + LSP in SP2)<br>-&gt; 3-label stack (outer transport for SPx,<br>middle bgp-lu label<br>inner vpn label)<br>good: no VRFs and no big LFIB in ASBRs<br>bad: complex. big label stack, RR more difficutl even.<\/p>\n\n\n\n<p>Config: 3 BGPs: PE1-ASBR1 ibgp LU<br>ASBR1-ASBR2 ebgp LU<br>PE1-PE2 ebgp inet-vpn unicast<br>SP1-PE1<br>set routing-instances L3VPN1 instance-type vrf, rd, rt, inteface, vrf-table-label<\/p>\n\n\n\n<p>set protocols bgp group INT type internal<br>local-address SP1-PE1-Lo<br>family inet labeled-unicast resolve-vpn -&gt; copy bgp-lu prefixes from inet.0 into inet.3<br>neighbor SP1-ASBR1-lo<br>group EXT type external<br>multihop<br>local-address SP1-PE1-lo<br>family inet-vpn unicat<br>peer-as SP2<br>neighbor SP2-PE2-lo<\/p>\n\n\n\n<p>show route received-protocol bgp SP1-ASBR1-lo -&gt; you will see SP2-PE2 lo in inet.0 (by bgp-lu) and copied to inet.3<br>show route table L3VPN1.inet.0 -&gt; you will see 3 label stack to SP2-CE2 \/24<\/p>\n\n\n\n<p>SP1-ASBR1<br>set protocols bgp group INT type internal &#8211;&gt; NO NEED NH-self, because when new label is generated, nh is updated automatically<br>local-address SP1-ASBR1-lo<br>family-inet labeled-unicast<br>neighbor SP1-PE1-lo<br>group EXT type external<br>family inet labeles-unicast<br>export INTERNALS (redistribute SP1 lo to SP2-ASBR2)<br>peer-as SP2<br>neighbor SP2-ASBR2-phy<br>mpls traffic-engineering mpls-forwarding !!!! Important: copy LSP from inet.3 to inet.0 BUT LSP only for fw, IGP for CP.<br>inteface all<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Carrier-of-Carriers VPNs (similar to l2vpn) = LAB!<\/h2>\n\n\n\n<p>SP1 in two locations (different ASNs!) but not connection. SP2 is used to connect those two locations from SP1, SP2=COC-SP<br>You can use l2vpn psedowire -&gt; not scale<br>Use CoC &#8211; Carrier-of-Carrier model -&gt; similar to Option-C (BGP-LU). COC-ASBR will learn SP1 PEs-lo. BGP-LU between PEs and ASBRs<br>bgp: new things you have to add to the already BGP config in place. There is ibgp inet-vpn unicast already in COC between ASBRs<br>sp1-pe1 &lt;&gt; sp1-asbr1: ibgp-lu<br>sp1-asbr1 &lt;&gt; coc-asbr1: ebgp-lu<br>coc-asbr1 &lt;&gt; coc-asbr2: ibgp-lu<br>coc-asbr2 &lt;&gt; sp1-asbr2: ebgp-lu<br>sp1-asbr2 &lt;&gt; sp1-pe2: ibgp-lu<br>sp1-pe1 &lt;&gt; sp1-pe2: ebgp-inet-vpn !!<\/p>\n\n\n\n<p>lsp:<br>sp1-pe1 &lt;&gt; sp1-asbr1<br>coc-asbr1 &lt;&gt; coc-asbr2<br>sp1-asbr2 &lt;&gt; sp1-pe2<\/p>\n\n\n\n<p>SP1-PE1<br>set routing-instances L3VPN1 instance-type vrf, interface, rd, rt, vrt-table-label<\/p>\n\n\n\n<p>set protocols bgp group TO-SITE2 type external (to sp1-pe2)<br>multihop<br>local-address SP1-PE1-lo<br>family inet-vpn unicast<br>peer-as SP1-SITE2<br>neighbor SP1-PE2-Lo<br>INT type internal<br>local-address SP1-PE1-lo<br>family inet labeled-unicast resolve-vpn !!! -&gt; copy bgp-lu prefixes from inet.0 into inet.3 for vpn resolution<br>neighbor SP1-ASBR1-lo<\/p>\n\n\n\n<p>show route receive-protocol bgp SP1-ASBR1-lo -&gt; inet.0 (learnt via bgp-lu) then copied to inet.3 (resolve-vpn!)<br>SP1-PE2-lo -&gt; in L3VPN1.inet.0 you will see COC ASN!<br>table L3VPN1.inet.0 -&gt; you can see 3-label stack<\/p>\n\n\n\n<p>SP1-ASBR1<br>set protocols bgp group TO-COC type external<br>family inet labeled-unicast<br>export SP1-SITE1-LO !!!!!!!!!! (just advertise all PEx-lo from SITE1 of SP1)<br>peer-as COC-ASN<br>neighbor COC-ASBR1-phy<br>INT type internal<br>local-address SP1-ASBR1-lo<br>family inet labeled-unicast<br>neighbor SP1-PE1-lo<br>COC-ASBR1<br>set protocols bgp group TO-SP1-SITE1 type external<br>family inet labeled-unicast<br>peer-as SP1-SITE1-ASN<br>neighbor SP1-ASRB1-phy<br>INT type internal<br>local-address COC-ASBR1-lo<br>family inet labeled-unicast<br>neighbor COC-ASBR2-lo<\/p>\n\n\n\n<p>** real-life: COC will have this config in a L3VPN !!! This example SP1 prefixes will be in COC inet.0 !!!!<\/p>\n\n\n\n<p>** lab uses &#8220;advertise-inactive&#8221; in all &#8220;type external + bgp-lu&#8221; bgp groups???<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Troubleshooting Layer 3 VPN &#8211; Overview<\/h2>\n\n\n\n<p>CP: PE-CE routing, BGP, label protocols<br>show route table VPN.inet.0 [protocol bgp hidden detail]<br>show bgp summary | neigbor CE-IP<br>show route advertising\/receive-protocol bgp CE-IP<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>bgp default policies: bgp routes from remote PEs are advertisd to CEs. Export policies are needed for redistributing between instances<br>&#8221; CE in same AS as PE -> as-override<br>ospf; use domain-id to redistribute vpn routes as type3 instead of type5. Sham-links<\/li>\n\n\n\n<li>ospf default policy: export policy is needed<br>show ospf database instance VPN1 advertising-router self<br>lsa-id IP detail<\/li>\n<\/ul>\n\n\n\n<p>DP: ping\/traceroute<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Additional Layer 3 VPN Troubleshooting + LAB<\/h2>\n\n\n\n<p>MPLS<br>show route table inet.3 -&gt; each PE.lo must be here. If using bgp-lu needs to use &#8220;resolve-vpn&#8221;. Maybe &#8220;traffic-enginnering mpls-forwarding&#8221; is needed too.<br>show rsvp interface\/session\/statistics<br>show ldp interface\/neighbor\/session\/statistics\/database<br>show mpls lsp<\/p>\n\n\n\n<p>BGP<br>show bgp summary | neighbor PE<br>show route table bgp.l3vpn.0 [community target:x:y]<br>show route receive\/advertised-routes bgp PE [hidden]<br>show route table inet.3 [NH from hidden route] -&gt; check if LSP to PE is up!<br>unknown RT are discarded<br>** RR must have BGP NH in inet.3 (set routing-optios resolution rib bgp.l3vpn.0 resolution-ribs inet.0<\/p>\n\n\n\n<p>DP<br>PE-CE: ping\/traceroute in routing-instance, show arp<br>PE-PE: ping\/traceroute mpls ldp|rsvp|segment-routing LSP_NAME<br>ping mpls l3vpn VRF prefix xxxx\/x [sweep]= find path MTU<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Multicast Overview<\/h2>\n\n\n\n<p>QoS is hard. Mostly for UDP<br>DR: designated router<br>IGMP: receiver and local router<br>PIM: between routers<br>Any source multicast<br>SSM source-specific multicast<br>Dense M vs Sparse Mode<br>Source-Tree = Shortest-path tree (S,G)<br>Shared-Tree or RP (rendezvous point) tree = (*,G) receiver to RP is shared-tree<\/p>\n\n\n\n<p>224\/4 (class D: 1110 )<br>224.0.0.x\/24 local net<br>232.x.x.x\/8 SSM block<br>233.(0-251).x.x GLOP based on ASN gives you an \/24s<br>234\/8 &#8211; public multicast<br>239\/8 &#8211; private ips<\/p>\n\n\n\n<p>RPF check: uses inet.0, successful checks saved in inet.1. inet.2 alternate table for RFP checks (needs RIB groups)<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Introduction to IGMP (host &lt;&gt; routers)<\/h2>\n\n\n\n<p>host sends IGMP report to signal interest in receiving specific multicat traffic. IGMP not routing protocol!<br>router sends IGMP queries to check there is interest<br>igmp v2: asm + explicit leave so router knows if stop sending traffic. router querier = lowest IP<br>igmp v3: v2 + supports ssm<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Multicast Routing Protocols<\/h2>\n\n\n\n<p>perfrom RPF check, build outgoing-interface-list (OIL), exchange multicast fw state with other routers<br>dense (implicit join, (S,G) = source-tree)<br>sparse (explicit join, use RP for source discovery or use SSM (igm3 needed), (*,G) intiallu to RP (suboptimal) then move to (S,G)<br>v2: own protocol<\/p>\n\n\n\n<p>messages:<br>hello: maintein and discover neighbor (224.13), elect DR (highest priority, highest IP is tiebraker)<br>join\/prune<br>graft-ack (dense): indicate interest in receiving traffic on previously pruned interfaces<br>assert: elect DW, shortest distance to the src<br>register (sparse) signaling between source router and RP<br>bootstrap and candidate-RP advert (sparse)<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">BGP MVPN Overview &#8211; rfc 6513 (Messy !!!!!)<\/h2>\n\n\n\n<p>two methods: dual PIM MVPNs (draft rosen &#8211; scale issues) or BGP MVPNs (doesnt require multicast config in backbone)<\/p>\n\n\n\n<p>BGP MVPN: replaces PIM with BGP: rfc 6514 for mvpn signaling. can use a RR. PMSI = P-Multcast Service Inteface<br>PMSI: tunel PE to PE to transport multicast (rsvp p2mp lsp, mldp)<br>I-PMSI: (Inclusive) multidirectional: all PEs can transmit to all other PEs<br>unidirectional: one particular PE to transmit multicast to other PEs<br>S-PMSI: (Selective) one particular PE to transmit to a subset of PEs<\/p>\n\n\n\n<p>NLRI: af1=1, safi=5 tables: bgp.mvpn.0 and .mvpn.0. PMSI Attribute: rsvp session id or ldp p2mp fec for p2mp lsps (and labels)<\/p>\n\n\n\n<p>type1: Intra-AS I-PMSI autodiscovery route. Sent by all PE routers participating in MVPN<br>type2: Inter-AS I-PMSU autodiscovery route. Sent by ASBR participating in MVPN.<br>typex:PE-RD:PE-lo<\/p>\n\n\n\n<p>typ3: S-PMSI autodiscovery route: advertised by multicast source PE in response to receiving a typ6\/7 route. (sent by root PE when creating S-PMSI)<br>3:PE-RD:C-S Mask: C-S S-PMSI: C-G mask: C-G S-PMSI: PE-lo<\/p>\n\n\n\n<p>type4: leaf autodiscovery route: originated by receiver PE in response to receiving typ3 (sent by receiver PE, to join S-PMSI)<br>4: typ3 : pe-lo<\/p>\n\n\n\n<p>type5: source active autodiscovery route: sent by PE that discovers an active MC source (propagate info on active sources)<br>5:PE-RD:c-s mask:C-S:C-G mask:C-G<\/p>\n\n\n\n<p>typ6: shared-tree route: sent by PE that receives PIM join (C-<em>, C-G) on the vrf interface. (equivalent PIM join (<\/em>,G)<br>6:upstream-PE-RD:ASN-upstream-PE:C-RP mask: C-RP IP: C-G mask: C-G<\/p>\n\n\n\n<p>type7: source-tree join route: sent by PE that receives PIM join (C-S, C-G) on vrf interface (equivalent PIM join (S,G)<br>7:upstream-PE-RD:ASN-upstream-PE:C-S mask:C-S:C-G mask:C-G<\/p>\n\n\n\n<p>p2mp lsp:<br>inclusive tree: each tree serves one MVPN. ineficient<br>selective tree: servers selected MC groups from a given MPVN<\/p>\n\n\n\n<p>I-PMSI signaling:<br>C-DR: customer DR (a CE)<br>C-RP: customer RP (a PE)<\/p>\n\n\n\n<p>RSVP.No PIM in Backbone.<br>With no receivers or source active, each PE:<br>advertises an inclusive MPVN A-D route to each other tagged with a route target and PMSI tunnel attribute (type1)<br>uses rsvp PMSI automatically builds a P2MP LSP to other PEs with itself as root and no PHP<br>uses incoming MPLS label encapsulating the MC packets<br>a p2mp lsp is signaled with a label-3 (explicit null) oin the penultime hop. A virtual tunnel interface or vrf-table-label must be configured<\/p>\n\n\n\n<p>source begins sending MC traffic<br>C-DR sends PIM register to C-RP<br>C-RP sends type5 to remote PEs<\/p>\n\n\n\n<p>using igmpv3, receivers join a source-specific group (other side of the SP network)<br>Receiver CEs send PIM (S,G) upstream to PEs. Those PEs convert PIM into type7 sent to C-RP<br>C-RP converts type7 into PIM S,G and sends to C-DR<\/p>\n\n\n\n<p>after MC fw tree is built, C-DR sends native MC to C-RP. C-RP encapsulates packet. At some point one P, duplicates packet to interested PEs.<\/p>\n\n\n\n<p>S-PMSI signaling: complex!!!<br>RSVP and LDP examples<\/p>\n\n\n\n<p>hw requirements. Tunnel services on certain routers: C-DR, C-RP, all PEs participating in customers MC network<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>this can be avoided using vrf-table-label<br>set chassis fpc1 pic0 tunnel-services bandwidth 1g<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Configuring BGP MVPNs + LAB !!!<\/h2>\n\n\n\n<p>set protocols bgp family inet-mvpn signallng<\/p>\n\n\n\n<p>set protocos mpls label-switched-path mvpn-example template, no-cspf, link-protection, p2mp<\/p>\n\n\n\n<p>&#8212;<br>RSVP<br>I-PMSI (required)<br>set routing-instances mc-pe provider-tunnel rsvp-te label-switched-path-template mvpn-example<br>vrf-table-label -&gt; disable PHP !!<br>S-PMSI<br>set routing-instances mc-pe provider-tunnel selective group 224.7.7.0\/24 wilcard-source rsvp-te label-switched-path default-template<\/p>\n\n\n\n<p>LDP<br>set protocols ldp interface ge-0\/0\/0.0<br>p2mp !!!<br>I-PMSI (required)<br>set routing-instances mc-pe provider-tunnel ldp-p2mp<br>vrf-table-label<br>S-PMSI<\/p>\n\n\n\n<p>set routing-instances mc-pe provider-tunnel selective group 224.7.7.7\/32 source lo-ip\/32 ldp-p2mp<\/p>\n\n\n\n<p>set routing-instances mc-pe protocols pim rp local address LO<br>interface alll mode sparse<br>mvpn mvpn-mode [spt-only | rpt-spt ]<\/p>\n\n\n\n<p>verification<br>1- PIM customer domain<br>show pim interface|join|source|statistics<br>show mvpn c-multcast instance-name VPN_NAME extensive<\/p>\n\n\n\n<p>2- BGP family MVPN<br>show route table VPN.mvpn.0 -&gt; check for type1,2,3,4,5,6,7<br>show pim join instance mc-pe extensive<br>show multicast route instance mc-pe extensive<br>show route forwarding-table destination 224.7.7.7 exntensive (label and inteface outout should be the same as above command(<br>show route table bgp.mvpn.0<\/p>\n\n\n\n<p>3- I-PMSI\/S-PMSI for RSVP\/LDP p2mp<br>show rsvp session<br>show ldp database<\/p>\n","protected":false},"excerpt":{"rendered":"<p>JNCIP-SPJN0-664https:\/\/www.juniper.net\/us\/en\/training\/certification\/tracks\/service-provider-routing-switching\/jncip-sp.htmlAdvanced Junos Service Provider Routing On-Demand &#8211; DONEJunos Layer 2 VPNs On-DemandJunos Layer 3 VPNs On-Demand https:\/\/jlabs.juniper.net\/vlabs =========================================Advanced Junos Service Provider Routing On-Demand========================================= OSPF for SP============ip protocol 89DR in ethernet segment: highest priority (def 128), highest RID.P2P dont need DR: save 40s wait timepacket types:hello: fomr and maintain adjDB descriptor: header info for contents of &hellip; <a href=\"https:\/\/blog.thomarite.uk\/index.php\/2026\/04\/06\/jncip-sp\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;JNCIP-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-2127","post","type-post","status-publish","format-standard","hentry","category-networks"],"_links":{"self":[{"href":"https:\/\/blog.thomarite.uk\/index.php\/wp-json\/wp\/v2\/posts\/2127","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=2127"}],"version-history":[{"count":1,"href":"https:\/\/blog.thomarite.uk\/index.php\/wp-json\/wp\/v2\/posts\/2127\/revisions"}],"predecessor-version":[{"id":2128,"href":"https:\/\/blog.thomarite.uk\/index.php\/wp-json\/wp\/v2\/posts\/2127\/revisions\/2128"}],"wp:attachment":[{"href":"https:\/\/blog.thomarite.uk\/index.php\/wp-json\/wp\/v2\/media?parent=2127"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.thomarite.uk\/index.php\/wp-json\/wp\/v2\/categories?post=2127"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.thomarite.uk\/index.php\/wp-json\/wp\/v2\/tags?post=2127"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}