{"id":204,"date":"2023-11-29T23:25:09","date_gmt":"2023-11-29T22:25:09","guid":{"rendered":"https:\/\/mokrane-assam.com\/?p=204"},"modified":"2026-11-29T23:30:10","modified_gmt":"2026-11-29T22:30:10","slug":"redistribution-ripv2-and-bgp-hop-counts-origin-and-loops","status":"publish","type":"post","link":"https:\/\/mokrane-assam.com\/index.php\/2023\/11\/29\/redistribution-ripv2-and-bgp-hop-counts-origin-and-loops\/","title":{"rendered":"Redistribution RIPv2 and BGP: Hop Counts, Origin, and Loops"},"content":{"rendered":"<p class=\"wp-block-paragraph\">Redistributing between RIPv2 and BGP is where a legacy distance-vector IGP meets the global path-vector protocol. Two facts dominate the whole exercise: RIP&#8217;s metric is a hop count capped at 15 \u2014 16 means unreachable \u2014 so a redistributed route needs a small, deliberate seed metric or it is dropped; and the administrative-distance order (eBGP 20, RIP 120, iBGP 200) makes two-way redistribution loop-prone exactly as it is with any IGP-BGP pair. This walks it from the basics to the expert edge cases.<\/p><h2 class=\"wp-block-heading\">1. Why redistribute RIPv2 and BGP<\/h2><p class=\"wp-block-paragraph\">RIPv2 still runs at the edges \u2014 small sites, legacy segments, simple stub networks that never justified migrating. BGP carries reachability to and from other autonomous systems. A <strong>boundary router<\/strong> speaks both and leaks selected routes across: RIP into BGP so the outside can reach those edge prefixes, BGP into RIP so the edge can reach external destinations. The discipline is the same as always \u2014 leak only what must cross, with a sane metric and a tight filter.<\/p><figure class=\"mkz-diagram\" style=\"margin:24px auto;max-width:920px\"><svg style=\"width:100%;height:auto;display:block;margin:0 auto\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" viewBox=\"0 0 920 200\" font-family=\"'Segoe UI',Roboto,Helvetica,Arial,sans-serif\" role=\"img\" aria-label=\"Why redistribute RIPv2 and BGP\"><defs><linearGradient id=\"hg\" x1=\"0\" y1=\"0\" x2=\"0\" y2=\"1\"><stop offset=\"0\" stop-color=\"#17263f\"\/><stop offset=\"1\" stop-color=\"#0f172a\"\/><\/linearGradient><marker id=\"ar\" viewBox=\"0 0 10 10\" refX=\"8\" refY=\"5\" markerWidth=\"7\" markerHeight=\"7\" orient=\"auto-start-reverse\"><path d=\"M0 0L10 5L0 10z\" fill=\"#0A66C2\"\/><\/marker><\/defs><rect x=\"0\" y=\"0\" width=\"920\" height=\"200\" rx=\"14\" fill=\"#f8fafc\" stroke=\"#e2e8f0\"\/><rect x=\"0\" y=\"0\" width=\"920\" height=\"60\" rx=\"14\" fill=\"url(#hg)\"\/><rect x=\"0\" y=\"40\" width=\"920\" height=\"20\" fill=\"#0f172a\"\/><text x=\"28\" y=\"37\" fill=\"#ffffff\" font-size=\"19\" font-weight=\"700\">Why redistribute RIPv2 and BGP<\/text><text x=\"892\" y=\"37\" text-anchor=\"end\" fill=\"#38bdf8\" font-size=\"13\" font-weight=\"600\" letter-spacing=\"1\">NET BY ME<\/text><rect x=\"60\" y=\"95\" width=\"230\" height=\"70\" rx=\"10\" fill=\"#e0f2fe\" stroke=\"#0A66C2\"\/><text x=\"175\" y=\"125\" text-anchor=\"middle\" fill=\"#0f172a\" font-size=\"13\" font-weight=\"700\">RIPv2 domain<\/text><text x=\"175\" y=\"146\" text-anchor=\"middle\" fill=\"#475569\" font-size=\"10.5\">legacy edge<\/text><rect x=\"360\" y=\"95\" width=\"200\" height=\"70\" rx=\"10\" fill=\"#0f172a\"\/><text x=\"460\" y=\"125\" text-anchor=\"middle\" fill=\"#fff\" font-size=\"12\" font-weight=\"700\">boundary router<\/text><text x=\"460\" y=\"146\" text-anchor=\"middle\" fill=\"#94a3b8\" font-size=\"10\">runs both protocols<\/text><rect x=\"630\" y=\"95\" width=\"230\" height=\"70\" rx=\"10\" fill=\"#dcfce7\" stroke=\"#166534\"\/><text x=\"745\" y=\"125\" text-anchor=\"middle\" fill=\"#166534\" font-size=\"13\" font-weight=\"700\">BGP \/ internet<\/text><text x=\"745\" y=\"146\" text-anchor=\"middle\" fill=\"#334155\" font-size=\"10.5\">external reachability<\/text><line x1=\"290\" y1=\"130\" x2=\"360\" y2=\"130\" stroke=\"#0A66C2\" stroke-width=\"2\" marker-end=\"url(#ar)\"\/><line x1=\"560\" y1=\"130\" x2=\"630\" y2=\"130\" stroke=\"#166534\" stroke-width=\"2\" marker-end=\"url(#ar)\"\/><\/svg><\/figure><h2 class=\"wp-block-heading\">2. RIP&#8217;s metric is a hop count, and 16 means dead<\/h2><p class=\"wp-block-paragraph\">Everything about redistributing into RIP comes back to one constraint: <strong>RIP&#8217;s metric is a hop count from 1 to 15, and 16 is infinity<\/strong> \u2014 an explicit &#8220;unreachable&#8221; value RIP uses to poison a route. A prefix at 15 hops is still reachable; one hop further and it is dead. This tiny range is why RIP can&#8217;t scale, and it is the reason the seed metric you choose when redistributing into RIP matters so much.<\/p><figure class=\"mkz-diagram\" style=\"margin:24px auto;max-width:920px\"><svg style=\"width:100%;height:auto;display:block;margin:0 auto\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" viewBox=\"0 0 920 190\" font-family=\"'Segoe UI',Roboto,Helvetica,Arial,sans-serif\" role=\"img\" aria-label=\"RIP hop count: 1 to 15, 16 means dead\"><defs><linearGradient id=\"hg\" x1=\"0\" y1=\"0\" x2=\"0\" y2=\"1\"><stop offset=\"0\" stop-color=\"#17263f\"\/><stop offset=\"1\" stop-color=\"#0f172a\"\/><\/linearGradient><marker id=\"ar\" viewBox=\"0 0 10 10\" refX=\"8\" refY=\"5\" markerWidth=\"7\" markerHeight=\"7\" orient=\"auto-start-reverse\"><path d=\"M0 0L10 5L0 10z\" fill=\"#0A66C2\"\/><\/marker><\/defs><rect x=\"0\" y=\"0\" width=\"920\" height=\"190\" rx=\"14\" fill=\"#f8fafc\" stroke=\"#e2e8f0\"\/><rect x=\"0\" y=\"0\" width=\"920\" height=\"60\" rx=\"14\" fill=\"url(#hg)\"\/><rect x=\"0\" y=\"40\" width=\"920\" height=\"20\" fill=\"#0f172a\"\/><text x=\"28\" y=\"37\" fill=\"#ffffff\" font-size=\"19\" font-weight=\"700\">RIP hop count: 1 to 15, 16 means dead<\/text><text x=\"892\" y=\"37\" text-anchor=\"end\" fill=\"#38bdf8\" font-size=\"13\" font-weight=\"600\" letter-spacing=\"1\">NET BY ME<\/text><rect x=\"40\" y=\"100\" width=\"46\" height=\"46\" rx=\"7\" fill=\"#dcfce7\" stroke=\"#166534\"\/><text x=\"63\" y=\"128\" text-anchor=\"middle\" fill=\"#0f172a\" font-size=\"12\" font-weight=\"700\">1<\/text><rect x=\"94\" y=\"100\" width=\"46\" height=\"46\" rx=\"7\" fill=\"#dcfce7\" stroke=\"#166534\"\/><text x=\"117\" y=\"128\" text-anchor=\"middle\" fill=\"#0f172a\" font-size=\"12\" font-weight=\"700\">2<\/text><rect x=\"148\" y=\"100\" width=\"46\" height=\"46\" rx=\"7\" fill=\"#dcfce7\" stroke=\"#166534\"\/><text x=\"171\" y=\"128\" text-anchor=\"middle\" fill=\"#0f172a\" font-size=\"12\" font-weight=\"700\">3<\/text><rect x=\"202\" y=\"100\" width=\"46\" height=\"46\" rx=\"7\" fill=\"#dcfce7\" stroke=\"#166534\"\/><text x=\"225\" y=\"128\" text-anchor=\"middle\" fill=\"#0f172a\" font-size=\"12\" font-weight=\"700\">4<\/text><rect x=\"256\" y=\"100\" width=\"46\" height=\"46\" rx=\"7\" fill=\"#dcfce7\" stroke=\"#166534\"\/><text x=\"279\" y=\"128\" text-anchor=\"middle\" fill=\"#0f172a\" font-size=\"12\" font-weight=\"700\">5<\/text><rect x=\"310\" y=\"100\" width=\"46\" height=\"46\" rx=\"7\" fill=\"#dcfce7\" stroke=\"#166534\"\/><text x=\"333\" y=\"128\" text-anchor=\"middle\" fill=\"#0f172a\" font-size=\"12\" font-weight=\"700\">6<\/text><rect x=\"364\" y=\"100\" width=\"46\" height=\"46\" rx=\"7\" fill=\"#dcfce7\" stroke=\"#166534\"\/><text x=\"387\" y=\"128\" text-anchor=\"middle\" fill=\"#0f172a\" font-size=\"12\" font-weight=\"700\">7<\/text><rect x=\"418\" y=\"100\" width=\"46\" height=\"46\" rx=\"7\" fill=\"#dcfce7\" stroke=\"#166534\"\/><text x=\"441\" y=\"128\" text-anchor=\"middle\" fill=\"#0f172a\" font-size=\"12\" font-weight=\"700\">8<\/text><rect x=\"472\" y=\"100\" width=\"46\" height=\"46\" rx=\"7\" fill=\"#dcfce7\" stroke=\"#166534\"\/><text x=\"495\" y=\"128\" text-anchor=\"middle\" fill=\"#0f172a\" font-size=\"12\" font-weight=\"700\">9<\/text><rect x=\"526\" y=\"100\" width=\"46\" height=\"46\" rx=\"7\" fill=\"#dcfce7\" stroke=\"#166534\"\/><text x=\"549\" y=\"128\" text-anchor=\"middle\" fill=\"#0f172a\" font-size=\"12\" font-weight=\"700\">10<\/text><rect x=\"580\" y=\"100\" width=\"46\" height=\"46\" rx=\"7\" fill=\"#dcfce7\" stroke=\"#166534\"\/><text x=\"603\" y=\"128\" text-anchor=\"middle\" fill=\"#0f172a\" font-size=\"12\" font-weight=\"700\">11<\/text><rect x=\"634\" y=\"100\" width=\"46\" height=\"46\" rx=\"7\" fill=\"#dcfce7\" stroke=\"#166534\"\/><text x=\"657\" y=\"128\" text-anchor=\"middle\" fill=\"#0f172a\" font-size=\"12\" font-weight=\"700\">12<\/text><rect x=\"688\" y=\"100\" width=\"46\" height=\"46\" rx=\"7\" fill=\"#dcfce7\" stroke=\"#166534\"\/><text x=\"711\" y=\"128\" text-anchor=\"middle\" fill=\"#0f172a\" font-size=\"12\" font-weight=\"700\">13<\/text><rect x=\"742\" y=\"100\" width=\"46\" height=\"46\" rx=\"7\" fill=\"#dcfce7\" stroke=\"#166534\"\/><text x=\"765\" y=\"128\" text-anchor=\"middle\" fill=\"#0f172a\" font-size=\"12\" font-weight=\"700\">14<\/text><rect x=\"796\" y=\"100\" width=\"46\" height=\"46\" rx=\"7\" fill=\"#dcfce7\" stroke=\"#166534\"\/><text x=\"819\" y=\"128\" text-anchor=\"middle\" fill=\"#0f172a\" font-size=\"12\" font-weight=\"700\">15<\/text><rect x=\"850\" y=\"100\" width=\"46\" height=\"46\" rx=\"7\" fill=\"#fef2f2\" stroke=\"#C8102E\"\/><text x=\"873\" y=\"128\" text-anchor=\"middle\" fill=\"#0f172a\" font-size=\"12\" font-weight=\"700\">16<\/text><text x=\"430\" y=\"172\" text-anchor=\"middle\" fill=\"#64748b\" font-size=\"11\">1\u201315 reachable \u00b7 16 = infinity (unreachable)<\/text><\/svg><\/figure><h2 class=\"wp-block-heading\">3. The seed-metric trap into RIP<\/h2><p class=\"wp-block-paragraph\">Redistribute into RIP without a metric and the routes are assigned <strong>infinity<\/strong> \u2014 so they are never advertised. You must set a seed metric with <code>default-metric<\/code> under the RIP process or the <code>metric<\/code> option on the redistribute statement. And set it <em>low<\/em>: the seed is the starting hop count, and every RIP hop beyond the boundary adds one, so a seed of 15 becomes 16 \u2014 unreachable \u2014 just one router away. A seed of 1 to 3 leaves room for the route to propagate across the RIP domain.<\/p><figure class=\"mkz-diagram\" style=\"margin:24px auto;max-width:920px\"><svg style=\"width:100%;height:auto;display:block;margin:0 auto\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" viewBox=\"0 0 920 200\" font-family=\"'Segoe UI',Roboto,Helvetica,Arial,sans-serif\" role=\"img\" aria-label=\"The seed-metric trap into RIP\"><defs><linearGradient id=\"hg\" x1=\"0\" y1=\"0\" x2=\"0\" y2=\"1\"><stop offset=\"0\" stop-color=\"#17263f\"\/><stop offset=\"1\" stop-color=\"#0f172a\"\/><\/linearGradient><marker id=\"ar\" viewBox=\"0 0 10 10\" refX=\"8\" refY=\"5\" markerWidth=\"7\" markerHeight=\"7\" orient=\"auto-start-reverse\"><path d=\"M0 0L10 5L0 10z\" fill=\"#0A66C2\"\/><\/marker><\/defs><rect x=\"0\" y=\"0\" width=\"920\" height=\"200\" rx=\"14\" fill=\"#f8fafc\" stroke=\"#e2e8f0\"\/><rect x=\"0\" y=\"0\" width=\"920\" height=\"60\" rx=\"14\" fill=\"url(#hg)\"\/><rect x=\"0\" y=\"40\" width=\"920\" height=\"20\" fill=\"#0f172a\"\/><text x=\"28\" y=\"37\" fill=\"#ffffff\" font-size=\"19\" font-weight=\"700\">The seed-metric trap into RIP<\/text><text x=\"892\" y=\"37\" text-anchor=\"end\" fill=\"#38bdf8\" font-size=\"13\" font-weight=\"600\" letter-spacing=\"1\">NET BY ME<\/text><rect x=\"60\" y=\"88\" width=\"360\" height=\"100\" rx=\"10\" fill=\"#fef2f2\" stroke=\"#C8102E\"\/><text x=\"240\" y=\"116\" text-anchor=\"middle\" fill=\"#9f1239\" font-size=\"13\" font-weight=\"700\">no seed metric<\/text><text x=\"240\" y=\"140\" text-anchor=\"middle\" fill=\"#475569\" font-size=\"11\">route = infinity -> not advertised<\/text><text x=\"240\" y=\"160\" text-anchor=\"middle\" fill=\"#475569\" font-size=\"11\">silently never appears<\/text><rect x=\"500\" y=\"88\" width=\"360\" height=\"100\" rx=\"10\" fill=\"#dcfce7\" stroke=\"#166534\"\/><text x=\"680\" y=\"116\" text-anchor=\"middle\" fill=\"#166534\" font-size=\"13\" font-weight=\"700\">seed 1\u20133<\/text><text x=\"680\" y=\"140\" text-anchor=\"middle\" fill=\"#475569\" font-size=\"11\">room to add hops and propagate<\/text><text x=\"680\" y=\"160\" text-anchor=\"middle\" fill=\"#475569\" font-size=\"11\">seed 15 -> dead one hop away<\/text><\/svg><\/figure><h2 class=\"wp-block-heading\">4. Into BGP, redistributed routes get origin Incomplete<\/h2><p class=\"wp-block-paragraph\">Going the other way, RIP routes redistributed into BGP are injected as BGP prefixes with the <strong>origin<\/strong> attribute set to <strong>Incomplete<\/strong> (shown as <code>?<\/code>) \u2014 the marker BGP uses for anything learned by redistribution rather than by <code>network<\/code> (IGP) or from another AS (EGP). Origin is one of BGP&#8217;s best-path tiebreakers, and Incomplete is the least-preferred of the three, so these routes can lose to an otherwise-equal path with a better origin. You can also map the RIP hop count into the <strong>MED<\/strong> to influence how neighbors choose among your advertisements.<\/p><figure class=\"mkz-diagram\" style=\"margin:24px auto;max-width:920px\"><svg style=\"width:100%;height:auto;display:block;margin:0 auto\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" viewBox=\"0 0 920 190\" font-family=\"'Segoe UI',Roboto,Helvetica,Arial,sans-serif\" role=\"img\" aria-label=\"Into BGP, redistributed routes get origin Incomplete\"><defs><linearGradient id=\"hg\" x1=\"0\" y1=\"0\" x2=\"0\" y2=\"1\"><stop offset=\"0\" stop-color=\"#17263f\"\/><stop offset=\"1\" stop-color=\"#0f172a\"\/><\/linearGradient><marker id=\"ar\" viewBox=\"0 0 10 10\" refX=\"8\" refY=\"5\" markerWidth=\"7\" markerHeight=\"7\" orient=\"auto-start-reverse\"><path d=\"M0 0L10 5L0 10z\" fill=\"#0A66C2\"\/><\/marker><\/defs><rect x=\"0\" y=\"0\" width=\"920\" height=\"190\" rx=\"14\" fill=\"#f8fafc\" stroke=\"#e2e8f0\"\/><rect x=\"0\" y=\"0\" width=\"920\" height=\"60\" rx=\"14\" fill=\"url(#hg)\"\/><rect x=\"0\" y=\"40\" width=\"920\" height=\"20\" fill=\"#0f172a\"\/><text x=\"28\" y=\"37\" fill=\"#ffffff\" font-size=\"19\" font-weight=\"700\">Into BGP, redistributed routes get origin Incomplete<\/text><text x=\"892\" y=\"37\" text-anchor=\"end\" fill=\"#38bdf8\" font-size=\"13\" font-weight=\"600\" letter-spacing=\"1\">NET BY ME<\/text><rect x=\"80\" y=\"100\" width=\"240\" height=\"56\" rx=\"10\" fill=\"#dcfce7\" stroke=\"#166534\"\/><text x=\"200\" y=\"124\" text-anchor=\"middle\" fill=\"#0f172a\" font-size=\"11.5\" font-weight=\"700\">IGP (i)<\/text><text x=\"200\" y=\"144\" text-anchor=\"middle\" fill=\"#475569\" font-size=\"10.5\">network cmd<\/text><rect x=\"350\" y=\"100\" width=\"240\" height=\"56\" rx=\"10\" fill=\"#f1f5f9\" stroke=\"#94a3b8\"\/><text x=\"470\" y=\"124\" text-anchor=\"middle\" fill=\"#0f172a\" font-size=\"11.5\" font-weight=\"700\">EGP (e)<\/text><text x=\"470\" y=\"144\" text-anchor=\"middle\" fill=\"#475569\" font-size=\"10.5\">legacy<\/text><rect x=\"620\" y=\"100\" width=\"240\" height=\"56\" rx=\"10\" fill=\"#fef2f2\" stroke=\"#C8102E\"\/><text x=\"740\" y=\"124\" text-anchor=\"middle\" fill=\"#0f172a\" font-size=\"11.5\" font-weight=\"700\">Incomplete (?)<\/text><text x=\"740\" y=\"144\" text-anchor=\"middle\" fill=\"#475569\" font-size=\"10.5\">redistributed<\/text><text x=\"460\" y=\"178\" text-anchor=\"middle\" fill=\"#64748b\" font-size=\"11\">Redistributed RIP routes carry origin Incomplete \u2014 least preferred<\/text><\/svg><\/figure><h2 class=\"wp-block-heading\">5. Setting a BGP seed metric (MED)<\/h2><p class=\"wp-block-paragraph\">BGP does not need a seed metric to advertise a redistributed route \u2014 unlike RIP, a missing metric does not drop it \u2014 but setting the <strong>MED<\/strong> deliberately is still good practice. The MED is a non-transitive hint to an adjacent AS about which of your entry points to prefer; left at the default it may not express what you intend. Map the RIP hop count into the MED, or set a fixed value, so neighbors make the entry choice you want rather than an accidental one.<\/p><figure class=\"mkz-diagram\" style=\"margin:24px auto;max-width:920px\"><svg style=\"width:100%;height:auto;display:block;margin:0 auto\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" viewBox=\"0 0 920 200\" font-family=\"'Segoe UI',Roboto,Helvetica,Arial,sans-serif\" role=\"img\" aria-label=\"Setting a BGP seed metric (MED)\"><defs><linearGradient id=\"hg\" x1=\"0\" y1=\"0\" x2=\"0\" y2=\"1\"><stop offset=\"0\" stop-color=\"#17263f\"\/><stop offset=\"1\" stop-color=\"#0f172a\"\/><\/linearGradient><marker id=\"ar\" viewBox=\"0 0 10 10\" refX=\"8\" refY=\"5\" markerWidth=\"7\" markerHeight=\"7\" orient=\"auto-start-reverse\"><path d=\"M0 0L10 5L0 10z\" fill=\"#0A66C2\"\/><\/marker><\/defs><rect x=\"0\" y=\"0\" width=\"920\" height=\"200\" rx=\"14\" fill=\"#f8fafc\" stroke=\"#e2e8f0\"\/><rect x=\"0\" y=\"0\" width=\"920\" height=\"60\" rx=\"14\" fill=\"url(#hg)\"\/><rect x=\"0\" y=\"40\" width=\"920\" height=\"20\" fill=\"#0f172a\"\/><text x=\"28\" y=\"37\" fill=\"#ffffff\" font-size=\"19\" font-weight=\"700\">Setting a BGP seed metric (MED)<\/text><text x=\"892\" y=\"37\" text-anchor=\"end\" fill=\"#38bdf8\" font-size=\"13\" font-weight=\"600\" letter-spacing=\"1\">NET BY ME<\/text><rect x=\"80\" y=\"95\" width=\"300\" height=\"70\" rx=\"10\" fill=\"#e0f2fe\" stroke=\"#0A66C2\"\/><text x=\"230\" y=\"124\" text-anchor=\"middle\" fill=\"#0f172a\" font-size=\"12\" font-weight=\"700\">into RIP<\/text><text x=\"230\" y=\"146\" text-anchor=\"middle\" fill=\"#475569\" font-size=\"10.5\">mandatory seed (hop count 1\u20133)<\/text><rect x=\"540\" y=\"95\" width=\"300\" height=\"70\" rx=\"10\" fill=\"#dcfce7\" stroke=\"#166534\"\/><text x=\"690\" y=\"124\" text-anchor=\"middle\" fill=\"#166534\" font-size=\"12\" font-weight=\"700\">into BGP<\/text><text x=\"690\" y=\"146\" text-anchor=\"middle\" fill=\"#475569\" font-size=\"10.5\">optional MED (advisory)<\/text><text x=\"460\" y=\"135\" text-anchor=\"middle\" fill=\"#64748b\" font-size=\"20\">seed<\/text><\/svg><\/figure><h2 class=\"wp-block-heading\">6. Admin distance: eBGP 20 beats RIP 120 beats iBGP 200<\/h2><p class=\"wp-block-paragraph\">When the same prefix is learned more than once, the lowest <strong>administrative distance<\/strong> wins: <strong>eBGP 20<\/strong>, <strong>RIP 120<\/strong>, <strong>iBGP 200<\/strong>. Two consequences matter. eBGP (20) beats RIP (120), so an externally-learned copy of a RIP prefix will be preferred over the native RIP route \u2014 the setup for a feedback loop. And RIP (120) beats iBGP (200), so a RIP route is preferred over an internal-BGP copy of the same prefix.<\/p><figure class=\"mkz-diagram\" style=\"margin:24px auto;max-width:920px\"><svg style=\"width:100%;height:auto;display:block;margin:0 auto\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" viewBox=\"0 0 920 190\" font-family=\"'Segoe UI',Roboto,Helvetica,Arial,sans-serif\" role=\"img\" aria-label=\"Admin distance: eBGP 20 < RIP 120 < iBGP 200\"><defs><linearGradient id=\"hg\" x1=\"0\" y1=\"0\" x2=\"0\" y2=\"1\"><stop offset=\"0\" stop-color=\"#17263f\"\/><stop offset=\"1\" stop-color=\"#0f172a\"\/><\/linearGradient><marker id=\"ar\" viewBox=\"0 0 10 10\" refX=\"8\" refY=\"5\" markerWidth=\"7\" markerHeight=\"7\" orient=\"auto-start-reverse\"><path d=\"M0 0L10 5L0 10z\" fill=\"#0A66C2\"\/><\/marker><\/defs><rect x=\"0\" y=\"0\" width=\"920\" height=\"190\" rx=\"14\" fill=\"#f8fafc\" stroke=\"#e2e8f0\"\/><rect x=\"0\" y=\"0\" width=\"920\" height=\"60\" rx=\"14\" fill=\"url(#hg)\"\/><rect x=\"0\" y=\"40\" width=\"920\" height=\"20\" fill=\"#0f172a\"\/><text x=\"28\" y=\"37\" fill=\"#ffffff\" font-size=\"19\" font-weight=\"700\">Admin distance: eBGP 20 < RIP 120 < iBGP 200<\/text><text x=\"892\" y=\"37\" text-anchor=\"end\" fill=\"#38bdf8\" font-size=\"13\" font-weight=\"600\" letter-spacing=\"1\">NET BY ME<\/text><rect x=\"50\" y=\"100\" width=\"250\" height=\"56\" rx=\"10\" fill=\"#dcfce7\" stroke=\"#166534\"\/><text x=\"175\" y=\"124\" text-anchor=\"middle\" fill=\"#0f172a\" font-size=\"11.5\" font-weight=\"700\">eBGP<\/text><text x=\"175\" y=\"144\" text-anchor=\"middle\" fill=\"#475569\" font-size=\"11\">AD 20<\/text><rect x=\"340\" y=\"100\" width=\"250\" height=\"56\" rx=\"10\" fill=\"#e0f2fe\" stroke=\"#0A66C2\"\/><text x=\"465\" y=\"124\" text-anchor=\"middle\" fill=\"#0f172a\" font-size=\"11.5\" font-weight=\"700\">RIP<\/text><text x=\"465\" y=\"144\" text-anchor=\"middle\" fill=\"#475569\" font-size=\"11\">AD 120<\/text><rect x=\"630\" y=\"100\" width=\"250\" height=\"56\" rx=\"10\" fill=\"#fef2f2\" stroke=\"#C8102E\"\/><text x=\"755\" y=\"124\" text-anchor=\"middle\" fill=\"#0f172a\" font-size=\"11.5\" font-weight=\"700\">iBGP<\/text><text x=\"755\" y=\"144\" text-anchor=\"middle\" fill=\"#475569\" font-size=\"11\">AD 200<\/text><text x=\"460\" y=\"178\" text-anchor=\"middle\" fill=\"#64748b\" font-size=\"11\">eBGP beats RIP beats iBGP<\/text><\/svg><\/figure><h2 class=\"wp-block-heading\">7. The mutual-redistribution loop<\/h2><p class=\"wp-block-paragraph\">Redistribute both ways at two boundary routers and a RIP prefix can leave RIP via BGP, cross the AS boundary, and re-enter at a second router as an <strong>eBGP<\/strong> route with AD 20 \u2014 which beats the native RIP route&#8217;s 120. That router now prefers the external copy and a loop or black hole forms. RIP&#8217;s 15-hop ceiling bounds how far a count-to-infinity can run, but it does <em>not<\/em> stop the router from preferring the wrong source; the AD asymmetry is the real problem.<\/p><figure class=\"mkz-diagram\" style=\"margin:24px auto;max-width:920px\"><svg style=\"width:100%;height:auto;display:block;margin:0 auto\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" viewBox=\"0 0 920 220\" font-family=\"'Segoe UI',Roboto,Helvetica,Arial,sans-serif\" role=\"img\" aria-label=\"The mutual-redistribution loop\"><defs><linearGradient id=\"hg\" x1=\"0\" y1=\"0\" x2=\"0\" y2=\"1\"><stop offset=\"0\" stop-color=\"#17263f\"\/><stop offset=\"1\" stop-color=\"#0f172a\"\/><\/linearGradient><marker id=\"ar\" viewBox=\"0 0 10 10\" refX=\"8\" refY=\"5\" markerWidth=\"7\" markerHeight=\"7\" orient=\"auto-start-reverse\"><path d=\"M0 0L10 5L0 10z\" fill=\"#0A66C2\"\/><\/marker><\/defs><rect x=\"0\" y=\"0\" width=\"920\" height=\"220\" rx=\"14\" fill=\"#f8fafc\" stroke=\"#e2e8f0\"\/><rect x=\"0\" y=\"0\" width=\"920\" height=\"60\" rx=\"14\" fill=\"url(#hg)\"\/><rect x=\"0\" y=\"40\" width=\"920\" height=\"20\" fill=\"#0f172a\"\/><text x=\"28\" y=\"37\" fill=\"#ffffff\" font-size=\"19\" font-weight=\"700\">The mutual-redistribution loop<\/text><text x=\"892\" y=\"37\" text-anchor=\"end\" fill=\"#38bdf8\" font-size=\"13\" font-weight=\"600\" letter-spacing=\"1\">NET BY ME<\/text><rect x=\"80\" y=\"95\" width=\"180\" height=\"56\" rx=\"10\" fill=\"#e0f2fe\" stroke=\"#0A66C2\"\/><text x=\"170\" y=\"127\" text-anchor=\"middle\" fill=\"#0f172a\" font-size=\"12\" font-weight=\"600\">boundary 1<\/text><rect x=\"660\" y=\"95\" width=\"180\" height=\"56\" rx=\"10\" fill=\"#e0f2fe\" stroke=\"#0A66C2\"\/><text x=\"750\" y=\"127\" text-anchor=\"middle\" fill=\"#0f172a\" font-size=\"12\" font-weight=\"600\">boundary 2<\/text><line x1=\"260\" y1=\"110\" x2=\"660\" y2=\"110\" stroke=\"#166534\" stroke-width=\"2\" marker-end=\"url(#ar)\"\/><text x=\"460\" y=\"102\" text-anchor=\"middle\" fill=\"#166534\" font-size=\"10.5\">RIP route -> BGP<\/text><line x1=\"660\" y1=\"140\" x2=\"260\" y2=\"140\" stroke=\"#C8102E\" stroke-width=\"2\" marker-end=\"url(#ar)\"\/><text x=\"460\" y=\"158\" text-anchor=\"middle\" fill=\"#C8102E\" font-size=\"10.5\">returns as eBGP (AD 20) and wins<\/text><text x=\"460\" y=\"192\" text-anchor=\"middle\" fill=\"#9f1239\" font-size=\"11\" font-weight=\"600\">External copy beats native RIP (120) -> loop \/ black hole<\/text><\/svg><\/figure><h2 class=\"wp-block-heading\">8. Route tags and filtering close it<\/h2><p class=\"wp-block-paragraph\">The dependable fix is <strong>route tagging<\/strong>, and RIPv2 \u2014 unlike RIPv1 \u2014 carries a route tag field precisely for this. Tag each route as it leaves its home protocol; at every boundary that redistributes <em>back<\/em>, <strong>deny any route carrying that tag<\/strong>. The route can never return to where it came from, so the loop cannot close. Pair tags with prefix filtering so only intended prefixes cross, and prefer one-way redistribution wherever the design allows.<\/p><figure class=\"mkz-diagram\" style=\"margin:24px auto;max-width:920px\"><svg style=\"width:100%;height:auto;display:block;margin:0 auto\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" viewBox=\"0 0 920 200\" font-family=\"'Segoe UI',Roboto,Helvetica,Arial,sans-serif\" role=\"img\" aria-label=\"Route tags and filtering close it\"><defs><linearGradient id=\"hg\" x1=\"0\" y1=\"0\" x2=\"0\" y2=\"1\"><stop offset=\"0\" stop-color=\"#17263f\"\/><stop offset=\"1\" stop-color=\"#0f172a\"\/><\/linearGradient><marker id=\"ar\" viewBox=\"0 0 10 10\" refX=\"8\" refY=\"5\" markerWidth=\"7\" markerHeight=\"7\" orient=\"auto-start-reverse\"><path d=\"M0 0L10 5L0 10z\" fill=\"#0A66C2\"\/><\/marker><\/defs><rect x=\"0\" y=\"0\" width=\"920\" height=\"200\" rx=\"14\" fill=\"#f8fafc\" stroke=\"#e2e8f0\"\/><rect x=\"0\" y=\"0\" width=\"920\" height=\"60\" rx=\"14\" fill=\"url(#hg)\"\/><rect x=\"0\" y=\"40\" width=\"920\" height=\"20\" fill=\"#0f172a\"\/><text x=\"28\" y=\"37\" fill=\"#ffffff\" font-size=\"19\" font-weight=\"700\">Route tags and filtering close it<\/text><text x=\"892\" y=\"37\" text-anchor=\"end\" fill=\"#38bdf8\" font-size=\"13\" font-weight=\"600\" letter-spacing=\"1\">NET BY ME<\/text><rect x=\"60\" y=\"95\" width=\"230\" height=\"70\" rx=\"10\" fill=\"#e0f2fe\" stroke=\"#0A66C2\"\/><text x=\"175\" y=\"124\" text-anchor=\"middle\" fill=\"#0f172a\" font-size=\"12\" font-weight=\"700\">RIP -> BGP<\/text><text x=\"175\" y=\"146\" text-anchor=\"middle\" fill=\"#475569\" font-size=\"10.5\">tag = 120<\/text><rect x=\"360\" y=\"95\" width=\"200\" height=\"70\" rx=\"10\" fill=\"#0f172a\"\/><text x=\"460\" y=\"124\" text-anchor=\"middle\" fill=\"#fff\" font-size=\"12\" font-weight=\"700\">BGP -> RIP<\/text><text x=\"460\" y=\"146\" text-anchor=\"middle\" fill=\"#fca5a5\" font-size=\"10\">deny tag 120<\/text><rect x=\"630\" y=\"95\" width=\"230\" height=\"70\" rx=\"10\" fill=\"#dcfce7\" stroke=\"#166534\"\/><text x=\"745\" y=\"124\" text-anchor=\"middle\" fill=\"#166534\" font-size=\"12\" font-weight=\"700\">loop broken<\/text><text x=\"745\" y=\"146\" text-anchor=\"middle\" fill=\"#334155\" font-size=\"10.5\">route cannot return<\/text><line x1=\"290\" y1=\"130\" x2=\"360\" y2=\"130\" stroke=\"#0A66C2\" stroke-width=\"2\" marker-end=\"url(#ar)\"\/><line x1=\"560\" y1=\"130\" x2=\"630\" y2=\"130\" stroke=\"#166534\" stroke-width=\"2\" marker-end=\"url(#ar)\"\/><\/svg><\/figure><h2 class=\"wp-block-heading\">Takeaways<\/h2><p class=\"wp-block-paragraph\">RIPv2-BGP redistribution lives or dies on two numbers. The hop count: set a low seed metric into RIP (infinity otherwise, and 16 is dead), leaving room to propagate. The admin distance: eBGP 20 &lt; RIP 120 &lt; iBGP 200, which makes an external copy of a RIP route beat the original and two-way redistribution loop-prone. Seed low, tag on the way out, deny the tag on the way back, filter to the intended prefixes, and prefer one-way redistribution \u2014 and the edge stays stable.<\/p>","protected":false},"excerpt":{"rendered":"<p>Redistributing between RIPv2 and BGP is where a legacy distance-vector IGP meets the global path-vector protocol. Two facts dominate the whole exercise: RIP&#8217;s metric is a hop count capped at 15 \u2014 16 means unreachable \u2014 so a redistributed route needs a small, deliberate seed metric or it is dropped; and the administrative-distance order (eBGP<\/p><\/div>\n<div class=\"blog-btn\"><a href=\"https:\/\/mokrane-assam.com\/index.php\/2023\/11\/29\/redistribution-ripv2-and-bgp-hop-counts-origin-and-loops\/\" class=\"home-blog-btn\">Read More<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[24],"tags":[],"class_list":["post-204","post","type-post","status-publish","format-standard","hentry","category-basic"],"_links":{"self":[{"href":"https:\/\/mokrane-assam.com\/index.php\/wp-json\/wp\/v2\/posts\/204","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mokrane-assam.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mokrane-assam.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mokrane-assam.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mokrane-assam.com\/index.php\/wp-json\/wp\/v2\/comments?post=204"}],"version-history":[{"count":1,"href":"https:\/\/mokrane-assam.com\/index.php\/wp-json\/wp\/v2\/posts\/204\/revisions"}],"predecessor-version":[{"id":205,"href":"https:\/\/mokrane-assam.com\/index.php\/wp-json\/wp\/v2\/posts\/204\/revisions\/205"}],"wp:attachment":[{"href":"https:\/\/mokrane-assam.com\/index.php\/wp-json\/wp\/v2\/media?parent=204"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mokrane-assam.com\/index.php\/wp-json\/wp\/v2\/categories?post=204"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mokrane-assam.com\/index.php\/wp-json\/wp\/v2\/tags?post=204"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}