Files
infix/dev/routing/index.html
T

3405 lines
74 KiB
HTML

<!DOCTYPE html><html lang="en" class="no-js"><head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<meta name="description" content="Infix Documentation">
<link rel="canonical" href="https://kernelkit.github.io/infix/dev/routing/">
<link rel="prev" href="../ip/">
<link rel="next" href="../firewall/">
<link rel="icon" href="../assets/images/favicon.png">
<meta name="generator" content="mkdocs-1.6.1, mkdocs-material-9.7.6">
<title>Routing - User's Guide</title>
<link rel="stylesheet" href="../assets/stylesheets/main.484c7ddc.min.css">
<link rel="stylesheet" href="../assets/stylesheets/palette.ab4e12ef.min.css">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin="">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,300i,400,400i,700,700i%7CRoboto+Mono:400,400i,700,700i&amp;display=fallback">
<style>:root{--md-text-font:"Roboto";--md-code-font:"Roboto Mono"}</style>
<link rel="stylesheet" href="../extra.css">
<script>__md_scope=new URL("..",location),__md_hash=e=>[...e].reduce(((e,_)=>(e<<5)-e+_.charCodeAt(0)),0),__md_get=(e,_=localStorage,t=__md_scope)=>JSON.parse(_.getItem(t.pathname+"."+e)),__md_set=(e,_,t=localStorage,a=__md_scope)=>{try{t.setItem(a.pathname+"."+e,JSON.stringify(_))}catch(e){}}</script>
<link href="../assets/stylesheets/glightbox.min.css" rel="stylesheet"><script src="../assets/javascripts/glightbox.min.js"></script><style id="glightbox-style">
html.glightbox-open { overflow: initial; height: 100%; }
.gslide-title { margin-top: 0px; user-select: text; }
.gslide-desc { color: #666; user-select: text; }
.gslide-image img { background: black; }
.glightbox-clean .gslide-media { -webkit-box-shadow: none; box-shadow: none; }
.gscrollbar-fixer { padding-right: 15px; }
.gdesc-inner { font-size: 0.75rem; }
body[data-md-color-scheme="slate"] .gdesc-inner { background: var(--md-default-bg-color); }
body[data-md-color-scheme="slate"] .gslide-title { color: var(--md-default-fg-color); }
body[data-md-color-scheme="slate"] .gslide-desc { color: var(--md-default-fg-color); }
</style></head>
<body dir="ltr" data-md-color-scheme="default" data-md-color-primary="orange" data-md-color-accent="orange">
<input class="md-toggle" data-md-toggle="drawer" type="checkbox" id="__drawer" autocomplete="off">
<input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off">
<label class="md-overlay" for="__drawer"></label>
<div data-md-component="skip">
<a href="#routing" class="md-skip">
Skip to content
</a>
</div>
<div data-md-component="announce">
</div>
<div data-md-color-scheme="default" data-md-component="outdated" hidden="">
</div>
<header class="md-header md-header--shadow" data-md-component="header">
<nav class="md-header__inner md-grid" aria-label="Header">
<a href="https://www.kernelkit.org/" title="User's Guide" class="md-header__button md-logo" aria-label="User's Guide" data-md-component="logo">
<img src="../logo-plain.png" alt="logo">
</a>
<label class="md-header__button md-icon" for="__drawer">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M3 6h18v2H3zm0 5h18v2H3zm0 5h18v2H3z"></path></svg>
</label>
<div class="md-header__title" data-md-component="header-title">
<div class="md-header__ellipsis">
<div class="md-header__topic">
<span class="md-ellipsis">
User's Guide
</span>
</div>
<div class="md-header__topic" data-md-component="header-topic">
<span class="md-ellipsis">
Routing
</span>
</div>
</div>
</div>
<form class="md-header__option" data-md-component="palette">
<input class="md-option" data-md-color-media="(prefers-color-scheme: light)" data-md-color-scheme="default" data-md-color-primary="orange" data-md-color-accent="orange" aria-label="Switch to dark mode" type="radio" name="__palette" id="__palette_0">
<label class="md-header__button md-icon" title="Switch to dark mode" for="__palette_1" hidden="">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="m17.75 4.09-2.53 1.94.91 3.06-2.63-1.81-2.63 1.81.91-3.06-2.53-1.94L12.44 4l1.06-3 1.06 3zm3.5 6.91-1.64 1.25.59 1.98-1.7-1.17-1.7 1.17.59-1.98L15.75 11l2.06-.05L18.5 9l.69 1.95zm-2.28 4.95c.83-.08 1.72 1.1 1.19 1.85-.32.45-.66.87-1.08 1.27C15.17 23 8.84 23 4.94 19.07c-3.91-3.9-3.91-10.24 0-14.14.4-.4.82-.76 1.27-1.08.75-.53 1.93.36 1.85 1.19-.27 2.86.69 5.83 2.89 8.02a9.96 9.96 0 0 0 8.02 2.89m-1.64 2.02a12.08 12.08 0 0 1-7.8-3.47c-2.17-2.19-3.33-5-3.49-7.82-2.81 3.14-2.7 7.96.31 10.98 3.02 3.01 7.84 3.12 10.98.31"></path></svg>
</label>
<input class="md-option" data-md-color-media="(prefers-color-scheme: dark)" data-md-color-scheme="slate" data-md-color-primary="black" data-md-color-accent="orange" aria-label="Switch to light mode" type="radio" name="__palette" id="__palette_1">
<label class="md-header__button md-icon" title="Switch to light mode" for="__palette_0" hidden="">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 7a5 5 0 0 1 5 5 5 5 0 0 1-5 5 5 5 0 0 1-5-5 5 5 0 0 1 5-5m0 2a3 3 0 0 0-3 3 3 3 0 0 0 3 3 3 3 0 0 0 3-3 3 3 0 0 0-3-3m0-7 2.39 3.42C13.65 5.15 12.84 5 12 5s-1.65.15-2.39.42zM3.34 7l4.16-.35A7.2 7.2 0 0 0 5.94 8.5c-.44.74-.69 1.5-.83 2.29zm.02 10 1.76-3.77a7.131 7.131 0 0 0 2.38 4.14zM20.65 7l-1.77 3.79a7.02 7.02 0 0 0-2.38-4.15zm-.01 10-4.14.36c.59-.51 1.12-1.14 1.54-1.86.42-.73.69-1.5.83-2.29zM12 22l-2.41-3.44c.74.27 1.55.44 2.41.44.82 0 1.63-.17 2.37-.44z"></path></svg>
</label>
</form>
<script>var palette=__md_get("__palette");if(palette&&palette.color){if("(prefers-color-scheme)"===palette.color.media){var media=matchMedia("(prefers-color-scheme: light)"),input=document.querySelector(media.matches?"[data-md-color-media='(prefers-color-scheme: light)']":"[data-md-color-media='(prefers-color-scheme: dark)']");palette.color.media=input.getAttribute("data-md-color-media"),palette.color.scheme=input.getAttribute("data-md-color-scheme"),palette.color.primary=input.getAttribute("data-md-color-primary"),palette.color.accent=input.getAttribute("data-md-color-accent")}for(var[key,value]of Object.entries(palette.color))document.body.setAttribute("data-md-color-"+key,value)}</script>
<label class="md-header__button md-icon" for="__search">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M9.5 3A6.5 6.5 0 0 1 16 9.5c0 1.61-.59 3.09-1.56 4.23l.27.27h.79l5 5-1.5 1.5-5-5v-.79l-.27-.27A6.52 6.52 0 0 1 9.5 16 6.5 6.5 0 0 1 3 9.5 6.5 6.5 0 0 1 9.5 3m0 2C7 5 5 7 5 9.5S7 14 9.5 14 14 12 14 9.5 12 5 9.5 5"></path></svg>
</label>
<div class="md-search" data-md-component="search" role="dialog">
<label class="md-search__overlay" for="__search"></label>
<div class="md-search__inner" role="search">
<form class="md-search__form" name="search">
<input type="text" class="md-search__input" name="query" aria-label="Search" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="search-query" required="">
<label class="md-search__icon md-icon" for="__search">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M9.5 3A6.5 6.5 0 0 1 16 9.5c0 1.61-.59 3.09-1.56 4.23l.27.27h.79l5 5-1.5 1.5-5-5v-.79l-.27-.27A6.52 6.52 0 0 1 9.5 16 6.5 6.5 0 0 1 3 9.5 6.5 6.5 0 0 1 9.5 3m0 2C7 5 5 7 5 9.5S7 14 9.5 14 14 12 14 9.5 12 5 9.5 5"></path></svg>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20 11v2H8l5.5 5.5-1.42 1.42L4.16 12l7.92-7.92L13.5 5.5 8 11z"></path></svg>
</label>
<nav class="md-search__options" aria-label="Search">
<a href="javascript:void(0)" class="md-search__icon md-icon" title="Share" aria-label="Share" data-clipboard="" data-clipboard-text="" data-md-component="search-share" tabindex="-1">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M18 16.08c-.76 0-1.44.3-1.96.77L8.91 12.7c.05-.23.09-.46.09-.7s-.04-.47-.09-.7l7.05-4.11c.54.5 1.25.81 2.04.81a3 3 0 0 0 3-3 3 3 0 0 0-3-3 3 3 0 0 0-3 3c0 .24.04.47.09.7L8.04 9.81C7.5 9.31 6.79 9 6 9a3 3 0 0 0-3 3 3 3 0 0 0 3 3c.79 0 1.5-.31 2.04-.81l7.12 4.15c-.05.21-.08.43-.08.66 0 1.61 1.31 2.91 2.92 2.91s2.92-1.3 2.92-2.91A2.92 2.92 0 0 0 18 16.08"></path></svg>
</a>
<button type="reset" class="md-search__icon md-icon" title="Clear" aria-label="Clear" tabindex="-1">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"></path></svg>
</button>
</nav>
</form>
<div class="md-search__output">
<div class="md-search__scrollwrap" tabindex="0" data-md-scrollfix="">
<div class="md-search-result" data-md-component="search-result">
<div class="md-search-result__meta">
Initializing search
</div>
<ol class="md-search-result__list" role="presentation"></ol>
</div>
</div>
</div>
</div>
</div>
<div class="md-header__source">
<a href="https://github.com/kernelkit/infix/" title="Go to repository" class="md-source" data-md-component="source">
<div class="md-source__icon md-icon">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><!--! Font Awesome Free 7.1.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2025 Fonticons, Inc.--><path d="M439.6 236.1 244 40.5c-5.4-5.5-12.8-8.5-20.4-8.5s-15 3-20.4 8.4L162.5 81l51.5 51.5c27.1-9.1 52.7 16.8 43.4 43.7l49.7 49.7c34.2-11.8 61.2 31 35.5 56.7-26.5 26.5-70.2-2.9-56-37.3L240.3 199v121.9c25.3 12.5 22.3 41.8 9.1 55-6.4 6.4-15.2 10.1-24.3 10.1s-17.8-3.6-24.3-10.1c-17.6-17.6-11.1-46.9 11.2-56v-123c-20.8-8.5-24.6-30.7-18.6-45L142.6 101 8.5 235.1C3 240.6 0 247.9 0 255.5s3 15 8.5 20.4l195.6 195.7c5.4 5.4 12.7 8.4 20.4 8.4s15-3 20.4-8.4l194.7-194.7c5.4-5.4 8.4-12.8 8.4-20.4s-3-15-8.4-20.4"></path></svg>
</div>
<div class="md-source__repository">
kernelkit/infix
</div>
</a>
</div>
</nav>
</header>
<div class="md-container" data-md-component="container">
<main class="md-main" data-md-component="main">
<div class="md-main__inner md-grid">
<div class="md-sidebar md-sidebar--primary" data-md-component="sidebar" data-md-type="navigation">
<div class="md-sidebar__scrollwrap">
<div class="md-sidebar__inner">
<nav class="md-nav md-nav--primary" aria-label="Navigation" data-md-level="0">
<label class="md-nav__title" for="__drawer">
<a href="https://www.kernelkit.org/" title="User's Guide" class="md-nav__button md-logo" aria-label="User's Guide" data-md-component="logo">
<img src="../logo-plain.png" alt="logo">
</a>
User's Guide
</label>
<div class="md-nav__source">
<a href="https://github.com/kernelkit/infix/" title="Go to repository" class="md-source" data-md-component="source">
<div class="md-source__icon md-icon">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><!--! Font Awesome Free 7.1.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2025 Fonticons, Inc.--><path d="M439.6 236.1 244 40.5c-5.4-5.5-12.8-8.5-20.4-8.5s-15 3-20.4 8.4L162.5 81l51.5 51.5c27.1-9.1 52.7 16.8 43.4 43.7l49.7 49.7c34.2-11.8 61.2 31 35.5 56.7-26.5 26.5-70.2-2.9-56-37.3L240.3 199v121.9c25.3 12.5 22.3 41.8 9.1 55-6.4 6.4-15.2 10.1-24.3 10.1s-17.8-3.6-24.3-10.1c-17.6-17.6-11.1-46.9 11.2-56v-123c-20.8-8.5-24.6-30.7-18.6-45L142.6 101 8.5 235.1C3 240.6 0 247.9 0 255.5s3 15 8.5 20.4l195.6 195.7c5.4 5.4 12.7 8.4 20.4 8.4s15-3 20.4-8.4l194.7-194.7c5.4-5.4 8.4-12.8 8.4-20.4s-3-15-8.4-20.4"></path></svg>
</div>
<div class="md-source__repository">
kernelkit/infix
</div>
</a>
</div>
<ul class="md-nav__list" data-md-scrollfix="">
<li class="md-nav__item">
<a href=".." class="md-nav__link">
<span class="md-ellipsis">
Introduction
</span>
</a>
</li>
<li class="md-nav__item md-nav__item--nested">
<input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_2">
<label class="md-nav__link" for="__nav_2" id="__nav_2_label" tabindex="0">
<span class="md-ellipsis">
CLI
</span>
<span class="md-nav__icon md-icon"></span>
</label>
<nav class="md-nav" data-md-level="1" aria-labelledby="__nav_2_label" aria-expanded="false">
<label class="md-nav__title" for="__nav_2">
<span class="md-nav__icon md-icon"></span>
CLI
</label>
<ul class="md-nav__list" data-md-scrollfix="">
<li class="md-nav__item">
<a href="../cli/introduction/" class="md-nav__link">
<span class="md-ellipsis">
Introduction
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../cli/configure/" class="md-nav__link">
<span class="md-ellipsis">
Configuration
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../cli/keybindings/" class="md-nav__link">
<span class="md-ellipsis">
Keybindings
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../cli/netcalc/" class="md-nav__link">
<span class="md-ellipsis">
Network Calculator
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../cli/tcpdump/" class="md-nav__link">
<span class="md-ellipsis">
Network Monitoring
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../cli/quick/" class="md-nav__link">
<span class="md-ellipsis">
Quickstart Guide
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../cli/text-editor/" class="md-nav__link">
<span class="md-ellipsis">
Text Editor
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../cli/upgrade/" class="md-nav__link">
<span class="md-ellipsis">
Upgrading
</span>
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item">
<a href="../container/" class="md-nav__link">
<span class="md-ellipsis">
Docker Containers
</span>
</a>
</li>
<li class="md-nav__item md-nav__item--active md-nav__item--nested">
<input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_4" checked="">
<label class="md-nav__link" for="__nav_4" id="__nav_4_label" tabindex="0">
<span class="md-ellipsis">
Networking
</span>
<span class="md-nav__icon md-icon"></span>
</label>
<nav class="md-nav" data-md-level="1" aria-labelledby="__nav_4_label" aria-expanded="true">
<label class="md-nav__title" for="__nav_4">
<span class="md-nav__icon md-icon"></span>
Networking
</label>
<ul class="md-nav__list" data-md-scrollfix="">
<li class="md-nav__item">
<a href="../networking/" class="md-nav__link">
<span class="md-ellipsis">
Overview
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../iface/" class="md-nav__link">
<span class="md-ellipsis">
Common Settings
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../bridging/" class="md-nav__link">
<span class="md-ellipsis">
Bridging
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../lag/" class="md-nav__link">
<span class="md-ellipsis">
Link Aggregation
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../ethernet/" class="md-nav__link">
<span class="md-ellipsis">
Ethernet Interfaces
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../ip/" class="md-nav__link">
<span class="md-ellipsis">
IP Addressing
</span>
</a>
</li>
<li class="md-nav__item md-nav__item--active">
<input class="md-nav__toggle md-toggle" type="checkbox" id="__toc">
<label class="md-nav__link md-nav__link--active" for="__toc">
<span class="md-ellipsis">
Routing
</span>
<span class="md-nav__icon md-icon"></span>
</label>
<a href="./" class="md-nav__link md-nav__link--active">
<span class="md-ellipsis">
Routing
</span>
</a>
<nav class="md-nav md-nav--secondary" aria-label="Table of contents">
<label class="md-nav__title" for="__toc">
<span class="md-nav__icon md-icon"></span>
Table of contents
</label>
<ul class="md-nav__list" data-md-component="toc" data-md-scrollfix="">
<li class="md-nav__item">
<a href="#ipv4-static-routes" class="md-nav__link">
<span class="md-ellipsis">
IPv4 Static routes
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#ipv6-static-routes" class="md-nav__link">
<span class="md-ellipsis">
IPv6 Static routes
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#ospfv2-routing" class="md-nav__link">
<span class="md-ellipsis">
OSPFv2 Routing
</span>
</a>
<nav class="md-nav" aria-label="OSPFv2 Routing">
<ul class="md-nav__list">
<li class="md-nav__item">
<a href="#ospf-area-types" class="md-nav__link">
<span class="md-ellipsis">
OSPF area types
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#bidirectional-forwarding-detection-bfd" class="md-nav__link">
<span class="md-ellipsis">
Bidirectional Forwarding Detection (BFD)
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#ospf-interface-settings" class="md-nav__link">
<span class="md-ellipsis">
OSPF interface settings
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#point-to-multipoint" class="md-nav__link">
<span class="md-ellipsis">
Point-to-Multipoint
</span>
</a>
<nav class="md-nav" aria-label="Point-to-Multipoint">
<ul class="md-nav__list">
<li class="md-nav__item">
<a href="#hybrid-broadcast-capable-p2mp" class="md-nav__link">
<span class="md-ellipsis">
Hybrid (broadcast-capable P2MP)
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#non-broadcast-p2mp" class="md-nav__link">
<span class="md-ellipsis">
Non-broadcast P2MP
</span>
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item">
<a href="#static-neighbors" class="md-nav__link">
<span class="md-ellipsis">
Static Neighbors
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#ospf-global-settings" class="md-nav__link">
<span class="md-ellipsis">
OSPF global settings
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#debug-ospfv2" class="md-nav__link">
<span class="md-ellipsis">
Debug OSPFv2
</span>
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item">
<a href="#rip-routing" class="md-nav__link">
<span class="md-ellipsis">
RIP Routing
</span>
</a>
<nav class="md-nav" aria-label="RIP Routing">
<ul class="md-nav__list">
<li class="md-nav__item">
<a href="#rip-interface-settings" class="md-nav__link">
<span class="md-ellipsis">
RIP interface settings
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#rip-global-settings" class="md-nav__link">
<span class="md-ellipsis">
RIP global settings
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#debug-ripv2" class="md-nav__link">
<span class="md-ellipsis">
Debug RIPv2
</span>
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item">
<a href="#view-routing-table" class="md-nav__link">
<span class="md-ellipsis">
View routing table
</span>
</a>
<nav class="md-nav" aria-label="View routing table">
<ul class="md-nav__list">
<li class="md-nav__item">
<a href="#ipv4-routing-table" class="md-nav__link">
<span class="md-ellipsis">
IPv4 routing table
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#ipv6-routing-table" class="md-nav__link">
<span class="md-ellipsis">
IPv6 routing table
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#route-preference" class="md-nav__link">
<span class="md-ellipsis">
Route Preference
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#source-protocol" class="md-nav__link">
<span class="md-ellipsis">
Source protocol
</span>
</a>
</li>
</ul>
</nav>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item">
<a href="../firewall/" class="md-nav__link">
<span class="md-ellipsis">
Firewall Configuration
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../qos/" class="md-nav__link">
<span class="md-ellipsis">
Quality of Service
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../eth-counters/" class="md-nav__link">
<span class="md-ellipsis">
RMON Counters
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../tunnels/" class="md-nav__link">
<span class="md-ellipsis">
Tunneling (L2/L3)
</span>
</a>
</li>
<li class="md-nav__item md-nav__item--nested">
<input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_4_12">
<label class="md-nav__link" for="__nav_4_12" id="__nav_4_12_label" tabindex="0">
<span class="md-ellipsis">
VPN Tunnels
</span>
<span class="md-nav__icon md-icon"></span>
</label>
<nav class="md-nav" data-md-level="2" aria-labelledby="__nav_4_12_label" aria-expanded="false">
<label class="md-nav__title" for="__nav_4_12">
<span class="md-nav__icon md-icon"></span>
VPN Tunnels
</label>
<ul class="md-nav__list" data-md-scrollfix="">
<li class="md-nav__item">
<a href="../vpn/" class="md-nav__link">
<span class="md-ellipsis">
Overview
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../vpn-wireguard/" class="md-nav__link">
<span class="md-ellipsis">
WireGuard
</span>
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item">
<a href="../wifi/" class="md-nav__link">
<span class="md-ellipsis">
Wireless LAN (WiFi)
</span>
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item md-nav__item--nested">
<input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_5">
<label class="md-nav__link" for="__nav_5" id="__nav_5_label" tabindex="0">
<span class="md-ellipsis">
Services
</span>
<span class="md-nav__icon md-icon"></span>
</label>
<nav class="md-nav" data-md-level="1" aria-labelledby="__nav_5_label" aria-expanded="false">
<label class="md-nav__title" for="__nav_5">
<span class="md-nav__icon md-icon"></span>
Services
</label>
<ul class="md-nav__list" data-md-scrollfix="">
<li class="md-nav__item">
<a href="../discovery/" class="md-nav__link">
<span class="md-ellipsis">
Device Discovery
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../dhcp/" class="md-nav__link">
<span class="md-ellipsis">
DHCP Server
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../ntp/" class="md-nav__link">
<span class="md-ellipsis">
NTP Server
</span>
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item md-nav__item--nested">
<input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_6">
<label class="md-nav__link" for="__nav_6" id="__nav_6_label" tabindex="0">
<span class="md-ellipsis">
System
</span>
<span class="md-nav__icon md-icon"></span>
</label>
<nav class="md-nav" data-md-level="1" aria-labelledby="__nav_6_label" aria-expanded="false">
<label class="md-nav__title" for="__nav_6">
<span class="md-nav__icon md-icon"></span>
System
</label>
<ul class="md-nav__list" data-md-scrollfix="">
<li class="md-nav__item">
<a href="../boot/" class="md-nav__link">
<span class="md-ellipsis">
Boot Procedure
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../system/" class="md-nav__link">
<span class="md-ellipsis">
Configuration
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../nacm/" class="md-nav__link">
<span class="md-ellipsis">
Access Control (NACM)
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../hardware/" class="md-nav__link">
<span class="md-ellipsis">
Hardware Info &amp; Status
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../management/" class="md-nav__link">
<span class="md-ellipsis">
Management
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../keystore/" class="md-nav__link">
<span class="md-ellipsis">
Keystore
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../syslog/" class="md-nav__link">
<span class="md-ellipsis">
Syslog Support
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../support/" class="md-nav__link">
<span class="md-ellipsis">
Support Data
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../upgrade/" class="md-nav__link">
<span class="md-ellipsis">
Upgrade
</span>
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item md-nav__item--nested">
<input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_7">
<label class="md-nav__link" for="__nav_7" id="__nav_7_label" tabindex="0">
<span class="md-ellipsis">
Scripting
</span>
<span class="md-nav__icon md-icon"></span>
</label>
<nav class="md-nav" data-md-level="1" aria-labelledby="__nav_7_label" aria-expanded="false">
<label class="md-nav__title" for="__nav_7">
<span class="md-nav__icon md-icon"></span>
Scripting
</label>
<ul class="md-nav__list" data-md-scrollfix="">
<li class="md-nav__item">
<a href="../scripting/" class="md-nav__link">
<span class="md-ellipsis">
Introduction
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../scripting-sysrepocfg/" class="md-nav__link">
<span class="md-ellipsis">
Legacy Scripting
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../scripting-netconf/" class="md-nav__link">
<span class="md-ellipsis">
NETCONF Scripting
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../scripting-restconf/" class="md-nav__link">
<span class="md-ellipsis">
RESTCONF Scripting
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../scripting-prod/" class="md-nav__link">
<span class="md-ellipsis">
Production Testing
</span>
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item md-nav__item--nested">
<input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_8">
<label class="md-nav__link" for="__nav_8" id="__nav_8_label" tabindex="0">
<span class="md-ellipsis">
Developer's Corner
</span>
<span class="md-nav__icon md-icon"></span>
</label>
<nav class="md-nav" data-md-level="1" aria-labelledby="__nav_8_label" aria-expanded="false">
<label class="md-nav__title" for="__nav_8">
<span class="md-nav__icon md-icon"></span>
Developer's Corner
</label>
<ul class="md-nav__list" data-md-scrollfix="">
<li class="md-nav__item">
<a href="../branding/" class="md-nav__link">
<span class="md-ellipsis">
Branding &amp; Releases
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../developers-guide/" class="md-nav__link">
<span class="md-ellipsis">
Developer's Guide
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../override-package/" class="md-nav__link">
<span class="md-ellipsis">
Developing with Buildroot
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../netboot/" class="md-nav__link">
<span class="md-ellipsis">
Netboot HowTo
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../testing/" class="md-nav__link">
<span class="md-ellipsis">
Regression Testing
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../test-arch/" class="md-nav__link">
<span class="md-ellipsis">
Test System Architecture
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../virtual/" class="md-nav__link">
<span class="md-ellipsis">
Virtual Environments
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../vpd/" class="md-nav__link">
<span class="md-ellipsis">
Vital Product Data (VPD)
</span>
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item">
<a href="../license/" class="md-nav__link">
<span class="md-ellipsis">
Origin &amp; Licensing
</span>
</a>
</li>
</ul>
</nav>
</div>
</div>
</div>
<div class="md-sidebar md-sidebar--secondary" data-md-component="sidebar" data-md-type="toc">
<div class="md-sidebar__scrollwrap">
<div class="md-sidebar__inner">
<nav class="md-nav md-nav--secondary" aria-label="Table of contents">
<label class="md-nav__title" for="__toc">
<span class="md-nav__icon md-icon"></span>
Table of contents
</label>
<ul class="md-nav__list" data-md-component="toc" data-md-scrollfix="">
<li class="md-nav__item">
<a href="#ipv4-static-routes" class="md-nav__link">
<span class="md-ellipsis">
IPv4 Static routes
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#ipv6-static-routes" class="md-nav__link">
<span class="md-ellipsis">
IPv6 Static routes
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#ospfv2-routing" class="md-nav__link">
<span class="md-ellipsis">
OSPFv2 Routing
</span>
</a>
<nav class="md-nav" aria-label="OSPFv2 Routing">
<ul class="md-nav__list">
<li class="md-nav__item">
<a href="#ospf-area-types" class="md-nav__link">
<span class="md-ellipsis">
OSPF area types
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#bidirectional-forwarding-detection-bfd" class="md-nav__link">
<span class="md-ellipsis">
Bidirectional Forwarding Detection (BFD)
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#ospf-interface-settings" class="md-nav__link">
<span class="md-ellipsis">
OSPF interface settings
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#point-to-multipoint" class="md-nav__link">
<span class="md-ellipsis">
Point-to-Multipoint
</span>
</a>
<nav class="md-nav" aria-label="Point-to-Multipoint">
<ul class="md-nav__list">
<li class="md-nav__item">
<a href="#hybrid-broadcast-capable-p2mp" class="md-nav__link">
<span class="md-ellipsis">
Hybrid (broadcast-capable P2MP)
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#non-broadcast-p2mp" class="md-nav__link">
<span class="md-ellipsis">
Non-broadcast P2MP
</span>
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item">
<a href="#static-neighbors" class="md-nav__link">
<span class="md-ellipsis">
Static Neighbors
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#ospf-global-settings" class="md-nav__link">
<span class="md-ellipsis">
OSPF global settings
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#debug-ospfv2" class="md-nav__link">
<span class="md-ellipsis">
Debug OSPFv2
</span>
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item">
<a href="#rip-routing" class="md-nav__link">
<span class="md-ellipsis">
RIP Routing
</span>
</a>
<nav class="md-nav" aria-label="RIP Routing">
<ul class="md-nav__list">
<li class="md-nav__item">
<a href="#rip-interface-settings" class="md-nav__link">
<span class="md-ellipsis">
RIP interface settings
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#rip-global-settings" class="md-nav__link">
<span class="md-ellipsis">
RIP global settings
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#debug-ripv2" class="md-nav__link">
<span class="md-ellipsis">
Debug RIPv2
</span>
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item">
<a href="#view-routing-table" class="md-nav__link">
<span class="md-ellipsis">
View routing table
</span>
</a>
<nav class="md-nav" aria-label="View routing table">
<ul class="md-nav__list">
<li class="md-nav__item">
<a href="#ipv4-routing-table" class="md-nav__link">
<span class="md-ellipsis">
IPv4 routing table
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#ipv6-routing-table" class="md-nav__link">
<span class="md-ellipsis">
IPv6 routing table
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#route-preference" class="md-nav__link">
<span class="md-ellipsis">
Route Preference
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#source-protocol" class="md-nav__link">
<span class="md-ellipsis">
Source protocol
</span>
</a>
</li>
</ul>
</nav>
</li>
</ul>
</nav>
</div>
</div>
</div>
<div class="md-content" data-md-component="content">
<nav class="md-path" aria-label="Navigation">
<ol class="md-path__list">
<li class="md-path__item">
<a href=".." class="md-path__link">
<span class="md-ellipsis">
Introduction
</span>
</a>
</li>
<li class="md-path__item">
<a href="../networking/" class="md-path__link">
<span class="md-ellipsis">
Networking
</span>
</a>
</li>
</ol>
</nav>
<article class="md-content__inner md-typeset">
<h1 id="routing">Routing<a class="headerlink" href="#routing" title="Permanent link"></a></h1>
<p>Currently supported YANG models:</p>
<table>
<thead>
<tr>
<th style="text-align: left;"><strong>YANG Model</strong></th>
<th style="text-align: left;"><strong>Description</strong></th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: left;">ietf-routing</td>
<td style="text-align: left;">Base model for all other models</td>
</tr>
<tr>
<td style="text-align: left;">ietf-ipv4-unicast-routing</td>
<td style="text-align: left;">Static IPv4 unicast routing</td>
</tr>
<tr>
<td style="text-align: left;">ietf-ipv6-unicast-routing</td>
<td style="text-align: left;">Static IPv6 unicast routing</td>
</tr>
<tr>
<td style="text-align: left;">ietf-ospf</td>
<td style="text-align: left;">OSPF routing</td>
</tr>
<tr>
<td style="text-align: left;">ietf-rip</td>
<td style="text-align: left;">RIP routing</td>
</tr>
<tr>
<td style="text-align: left;">infix-routing</td>
<td style="text-align: left;">Infix deviations and extensions</td>
</tr>
</tbody>
</table>
<p>The base model, ietf-routing, is where all the other models hook in. It
is used to set configuration and read operational status (RIB tables) in
the other models.</p>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>The standard IETF routing models allows multiple instances, but Infix
currently <em>only support one instance</em> per routing protocol! In the
examples presented here, the instance name <code>default</code> is used.</p>
</div>
<h2 id="ipv4-static-routes">IPv4 Static routes<a class="headerlink" href="#ipv4-static-routes" title="Permanent link"></a></h2>
<p>The standard IETF model for static routes reside under the <code>static</code>
control plane protocol. For our examples we use the instance name
<code>default</code>, you can use any name.</p>
<p>The most common case when using a static IP setup is adding a default
route (i.e., the default gateway):</p>
<pre class="cli"><code>admin@example:/&gt; <b>configure</b>
admin@example:/config/&gt; <b>edit routing control-plane-protocol static name default ipv4</b>
admin@example:/config/routing/…/ipv4/&gt; <b>set route 0.0.0.0/0 next-hop next-hop-address 192.168.1.1</b>
admin@example:/config/routing/…/ipv4/&gt; <b>leave</b>
admin@example:/&gt;
</code></pre>
<p>For a route with destination 192.168.200.0/24 via 192.168.1.1:</p>
<pre class="cli"><code>admin@example:/&gt; <b>configure</b>
admin@example:/config/&gt; <b>edit routing control-plane-protocol static name default ipv4</b>
admin@example:/config/routing/…/ipv4/&gt; <b>set route 192.168.200.0/24 next-hop next-hop-address 192.168.1.1</b>
admin@example:/config/routing/…/ipv4/&gt; <b>leave</b>
admin@example:/&gt;
</code></pre>
<p>For a "floating" static route with destination 10.0.0.0/16 via a backup
router 192.168.1.1, using the highest possible distance:</p>
<pre class="cli"><code>admin@example:/&gt; <b>configure</b>
admin@example:/config/&gt; <b>edit routing control-plane-protocol static name default ipv4</b>
admin@example:/config/routing/…/ipv4/&gt; <b>set route 10.0.0.0/16 next-hop next-hop-address 192.168.1.1 route-preference 254</b>
admin@example:/config/routing/…/ipv4/&gt; <b>leave</b>
admin@example:/&gt;
</code></pre>
<div class="admonition tip">
<p class="admonition-title">Tip</p>
<p>Remember to enable <a href="../ip/#ipv4-forwarding">IPv4 forwarding</a> for the
interfaces you want to route between.</p>
</div>
<h2 id="ipv6-static-routes">IPv6 Static routes<a class="headerlink" href="#ipv6-static-routes" title="Permanent link"></a></h2>
<p>Default route via an IPv6 gateway:</p>
<pre class="cli"><code>admin@example:/&gt; <b>configure</b>
admin@example:/config/&gt; <b>edit routing control-plane-protocol static name default ipv6</b>
admin@example:/config/routing/…/ipv6/&gt; <b>set route ::/0 next-hop next-hop-address 2001:db8:3c4d:1::1</b>
admin@example:/config/routing/…/ipv6/&gt; <b>leave</b>
admin@example:/&gt;
</code></pre>
<p>For a route with destination 2001:db8:3c4d:200::/64 via 2001:db8:3c4d:1::1:</p>
<pre class="cli"><code>admin@example:/&gt; <b>configure</b>
admin@example:/config/&gt; <b>edit routing control-plane-protocol static name default ipv6</b>
admin@example:/config/routing/…/ipv6/&gt; <b>set route 2001:db8:3c4d:200::/64 next-hop next-hop-address 2001:db8:3c4d:1::1</b>
admin@example:/config/routing/…/ipv6/&gt; <b>leave</b>
admin@example:/&gt;
</code></pre>
<h2 id="ospfv2-routing">OSPFv2 Routing<a class="headerlink" href="#ospfv2-routing" title="Permanent link"></a></h2>
<p>The system supports OSPF dynamic routing for IPv4, i.e., OSPFv2. To
enable OSPF and set one active interface in area 0:</p>
<pre class="cli"><code>admin@example:/config/&gt; <b>edit routing control-plane-protocol ospfv2 name default ospf</b>
admin@example:/config/routing/…/ospf/&gt; <b>set area 0.0.0.0 interface e0 enabled</b>
admin@example:/config/routing/…/ospf/&gt; <b>leave</b>
admin@example:/&gt;
</code></pre>
<div class="admonition tip">
<p class="admonition-title">Tip</p>
<p>Remember to enable <a href="../ip/#ipv4-forwarding">IPv4 forwarding</a> for all the
interfaces you want to route between.</p>
</div>
<h3 id="ospf-area-types">OSPF area types<a class="headerlink" href="#ospf-area-types" title="Permanent link"></a></h3>
<p>In addition to <em>regular</em> OSPF areas, area types <em>NSSA</em> and <em>Stub</em> are
also supported. To configure an NSSA area with summary routes:</p>
<pre class="cli"><code>admin@example:/config/&gt; <b>edit routing control-plane-protocol ospfv2 name default ospf</b>
admin@example:/config/routing/…/ospf/&gt; <b>set area 0.0.0.1 area-type nssa-area</b>
admin@example:/config/routing/…/ospf/&gt; <b>set area 0.0.0.1 summary true</b>
admin@example:/config/routing/…/ospf/&gt; <b>leave</b>
admin@example:/&gt;
</code></pre>
<h3 id="bidirectional-forwarding-detection-bfd">Bidirectional Forwarding Detection (BFD)<a class="headerlink" href="#bidirectional-forwarding-detection-bfd" title="Permanent link"></a></h3>
<p>It is possible to enable BFD per OSPF interface to speed up detection of
link loss.</p>
<pre class="cli"><code>admin@example:/config/&gt; <b>edit routing control-plane-protocol ospfv2 name default ospf</b>
admin@example:/config/routing/…/ospf/&gt; <b>set area 0.0.0.0 interface e0 bfd enabled true</b>
admin@example:/config/routing/…/ospf/&gt; <b>leave</b>
admin@example:/&gt;
</code></pre>
<h3 id="ospf-interface-settings">OSPF interface settings<a class="headerlink" href="#ospf-interface-settings" title="Permanent link"></a></h3>
<p>We have already seen how to enable OSPF per interface (<em>enabled true</em>)
and BFD for OSPF per interface (<em>bfd enabled true</em>). These and other
OSPF interface settings are done in context of an OSFP area, e.g., <em>area
0.0.0.0</em>. Available commands can be listed using the <code>?</code> mark.</p>
<pre class="cli"><code>admin@example:/config/routing/…/&gt; <b>edit ospf area 0.0.0.0</b>
admin@example:/config/routing/…/ospf/area/0.0.0.0/&gt; <b>edit interface e0</b>
admin@example:/config/routing/…/ospf/area/0.0.0.0/interface/e0/&gt; <b>set ?</b>
bfd BFD interface configuration.
cost Interface's cost.
dead-interval Interval after which a neighbor is declared down
enabled Enables/disables the OSPF protocol on the interface.
hello-interval Interval between Hello packets (seconds). It must
interface-type Interface type.
passive Enables/disables a passive interface. A passive
retransmit-interval Interval between retransmitting unacknowledged Link
transmit-delay Estimated time needed to transmit Link State Update
admin@example:/config/routing/…/ospf/area/0.0.0.0/interface/e0/&gt; set
</code></pre>
<p>For example, setting the OSPF <em>interface type</em> to <em>point-to-point</em> for
an Ethernet interface can be done as follows.</p>
<pre class="cli"><code>admin@example:/config/routing/…/ospf/area/0.0.0.0/interface/e0/&gt; <b>set interface-type point-to-point</b>
admin@example:/config/routing/…/ospf/area/0.0.0.0/interface/e0/&gt;
</code></pre>
<h3 id="point-to-multipoint">Point-to-Multipoint<a class="headerlink" href="#point-to-multipoint" title="Permanent link"></a></h3>
<p>Point-to-Multipoint (P2MP) is used when multiple OSPF routers share a
common network segment but should form individual adjacencies rather
than electing a Designated Router (DR). This is common in NBMA-like
environments, DMVPN, or hub-and-spoke topologies.</p>
<p>Infix supports two P2MP variants via the <code>interface-type</code> setting:</p>
<table>
<thead>
<tr>
<th style="text-align: left;"><strong>Interface Type</strong></th>
<th style="text-align: left;"><strong>Behavior</strong></th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: left;"><code>hybrid</code></td>
<td style="text-align: left;">P2MP with multicast Hellos (broadcast-capable)</td>
</tr>
<tr>
<td style="text-align: left;"><code>point-to-multipoint</code></td>
<td style="text-align: left;">P2MP with unicast Hellos (non-broadcast)</td>
</tr>
</tbody>
</table>
<h4 id="hybrid-broadcast-capable-p2mp">Hybrid (broadcast-capable P2MP)<a class="headerlink" href="#hybrid-broadcast-capable-p2mp" title="Permanent link"></a></h4>
<p>Use <code>hybrid</code> when all neighbors on the segment can receive multicast.
Hello packets are sent to the standard OSPF multicast address (224.0.0.5)
and neighbors are discovered automatically — no manual neighbor
configuration is needed.</p>
<pre class="cli"><code>admin@example:/config/&gt; <b>edit routing control-plane-protocol ospfv2 name default ospf</b>
admin@example:/config/routing/…/ospf/&gt; <b>set area 0.0.0.0 interface e0 interface-type hybrid</b>
admin@example:/config/routing/…/ospf/&gt; <b>leave</b>
admin@example:/&gt;
</code></pre>
<h4 id="non-broadcast-p2mp">Non-broadcast P2MP<a class="headerlink" href="#non-broadcast-p2mp" title="Permanent link"></a></h4>
<p>Use <code>point-to-multipoint</code> when the network does not support multicast.
Hello packets are sent as unicast directly to each configured neighbor.
Since neighbors cannot be discovered automatically, they must be
configured explicitly using static neighbors (see below).</p>
<pre class="cli"><code>admin@example:/config/&gt; <b>edit routing control-plane-protocol ospfv2 name default ospf</b>
admin@example:/config/routing/…/ospf/&gt; <b>set area 0.0.0.0 interface e0 interface-type point-to-multipoint</b>
admin@example:/config/routing/…/ospf/&gt; <b>leave</b>
admin@example:/&gt;
</code></pre>
<h3 id="static-neighbors">Static Neighbors<a class="headerlink" href="#static-neighbors" title="Permanent link"></a></h3>
<p>When using non-broadcast interface types (such as <code>point-to-multipoint</code>),
OSPF cannot discover neighbors via multicast. Static neighbors must be
configured so the router knows where to send unicast Hello packets.</p>
<pre class="cli"><code>admin@example:/config/&gt; <b>edit routing control-plane-protocol ospfv2 name default ospf</b>
admin@example:/config/routing/…/ospf/&gt; <b>set area 0.0.0.0 interface e0 static-neighbors neighbor 10.0.123.2</b>
admin@example:/config/routing/…/ospf/&gt; <b>set area 0.0.0.0 interface e0 static-neighbors neighbor 10.0.123.3</b>
admin@example:/config/routing/…/ospf/&gt; <b>leave</b>
admin@example:/&gt;
</code></pre>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>Static neighbors are only needed for non-broadcast interface types.
With <code>hybrid</code> (or <code>broadcast</code>), neighbors are discovered automatically
via multicast.</p>
</div>
<h3 id="ospf-global-settings">OSPF global settings<a class="headerlink" href="#ospf-global-settings" title="Permanent link"></a></h3>
<p>In addition to <em>area</em> and <em>interface</em> specific settings, OSPF provides
global settings for route redistribution and OSPF router identifier.</p>
<pre class="cli"><code>admin@example:/config/&gt; <b>edit routing control-plane-protocol ospfv2 name default ospf</b>
admin@example:/config/routing/…/ospf/&gt; <b>set ?</b>
area List of OSPF areas.
default-route-advertise Distribute default route to network
explicit-router-id Defined in RFC 2328. A 32-bit number
redistribute Redistribute protocols into OSPF
admin@example:/config/routing/…/ospf/&gt; set
</code></pre>
<ul>
<li>Explicit router ID: By default the router will pick an IP address
from one of its OSPF interfaces as OSPF router ID. An explicit ID is
used to get a deterministic behavior, e.g., <code>set explicit-router-id
1.1.1.1</code>.</li>
<li>Redistribution: <code>set redistribute static</code> and <code>set redistribute connected</code>
can be used to include static or connected routes into the OSPF routing
domain. These routes are redistributed as <em>external type-2</em> (E2)
routes.</li>
<li>Advertising default route: An OSPF router can be made to distribute
a default route into the OSPF domain by command <code>set
default-route-advertise enabled</code>. This route is distributed as long
as the router itself has an <em>active</em> default route in its routing
table. By adding command <code>set default-route-advertise always</code> the
router will distribute a default route even when it lacks a default
route. The default route will be distributed as an <em>external type-2</em>
(E2) route.</li>
</ul>
<h3 id="debug-ospfv2">Debug OSPFv2<a class="headerlink" href="#debug-ospfv2" title="Permanent link"></a></h3>
<p>Using NETCONF and the YANG model <em>ietf-routing</em> it is possible to read
the OSPF routing table, neighbors and more, that may be useful for
debugging the OSPFv2 setup. The CLI has various OSPF status commands
such as <code>show ospf neighbor</code>, <code>show ospf interface</code> and <code>show ospf
routes</code>.</p>
<pre class="cli"><code>admin@example:/&gt; <b>show ospf neighbor</b>
<span class="header">Neighbor ID Pri State Up Time Dead Time Address Interface RXmtL RqstL DBsmL</span>
10.1.1.2 1 Full/- 3h46m59s 30.177s 10.1.1.2 e0:10.1.1.1 0 0 0
10.1.1.3 1 Full/- 3h46m55s 34.665s 10.1.1.3 e1:10.1.1.1 0 0 0
admin@example:/&gt;
</code></pre>
<p>For more detailed troubleshooting, OSPF debug logging can be enabled to
capture specific protocol events. Debug messages are written to the
routing log file (<code>/var/log/routing</code>).</p>
<div class="admonition warning">
<p class="admonition-title">Caution</p>
<p>Debug logging significantly increases log output and may impact
performance. Only enable debug categories needed for troubleshooting,
and disable them when done.</p>
</div>
<p>To enable specific OSPF debug categories:</p>
<pre class="cli"><code>admin@example:/&gt; <b>configure</b>
admin@example:/config/&gt; <b>edit routing control-plane-protocol ospfv2 name default ospf debug</b>
admin@example:/config/routing/…/ospf/debug/&gt; <b>set bfd true</b>
admin@example:/config/routing/…/ospf/debug/&gt; <b>set nsm true</b>
admin@example:/config/routing/…/ospf/debug/&gt; <b>leave</b>
admin@example:/&gt;
</code></pre>
<p>Available debug categories include:</p>
<ul>
<li><code>bfd</code>: BFD (Bidirectional Forwarding Detection) events</li>
<li><code>packet</code>: Detailed packet debugging (all OSPF packets)</li>
<li><code>ism</code>: Interface State Machine events</li>
<li><code>nsm</code>: Neighbor State Machine events</li>
<li><code>default-information</code>: Default route origination</li>
<li><code>nssa</code>: Not-So-Stubby Area events</li>
</ul>
<p>All debug options are disabled by default. Refer to the <code>infix-routing</code>
YANG model for the complete list of available debug options.</p>
<p>To view current debug settings:</p>
<pre class="cli"><code>admin@example:/&gt; <b>show running-config routing control-plane-protocol</b>
</code></pre>
<p>To disable all debug logging, simply delete the debug settings or set
all options back to <code>false</code>:</p>
<pre class="cli"><code>admin@example:/&gt; <b>configure</b>
admin@example:/config/&gt; <b>delete routing control-plane-protocol ospfv2 name default ospf debug</b>
admin@example:/config/&gt; <b>leave</b>
admin@example:/&gt;
</code></pre>
<h2 id="rip-routing">RIP Routing<a class="headerlink" href="#rip-routing" title="Permanent link"></a></h2>
<p>The system supports RIP dynamic routing for IPv4, i.e., RIPv2. To enable
RIP and set active interfaces:</p>
<pre class="cli"><code>admin@example:/config/&gt; <b>edit routing control-plane-protocol ripv2 name default rip</b>
admin@example:/config/routing/…/rip/&gt; <b>set interfaces interface e0</b>
admin@example:/config/routing/…/rip/&gt; <b>set interfaces interface e1</b>
admin@example:/config/routing/…/rip/&gt; <b>leave</b>
admin@example:/&gt;
</code></pre>
<div class="admonition tip">
<p class="admonition-title">Tip</p>
<p>Remember to enable <a href="../ip/#ipv4-forwarding">IPv4 forwarding</a> for all the
interfaces you want to route between.</p>
</div>
<h3 id="rip-interface-settings">RIP interface settings<a class="headerlink" href="#rip-interface-settings" title="Permanent link"></a></h3>
<p>By default, interfaces send and receive RIPv2 packets. To control the
RIP version per interface:</p>
<pre class="cli"><code>admin@example:/config/routing/…/rip/&gt; <b>edit interfaces interface e0</b>
admin@example:/config/routing/…/rip/interfaces/interface/e0/&gt; <b>set send-version 1</b>
admin@example:/config/routing/…/rip/interfaces/interface/e0/&gt; <b>set receive-version 1-2</b>
admin@example:/config/routing/…/rip/interfaces/interface/e0/&gt; <b>leave</b>
admin@example:/&gt;
</code></pre>
<p>Valid version values are <code>1</code>, <code>2</code>, or <code>1-2</code> (both versions).</p>
<p>To configure a passive interface (advertise network but don't send/receive
RIP updates):</p>
<pre class="cli"><code>admin@example:/config/routing/…/rip/&gt; <b>edit interfaces interface e0</b>
admin@example:/config/routing/…/rip/interfaces/interface/e0/&gt; <b>set passive</b>
admin@example:/config/routing/…/rip/interfaces/interface/e0/&gt; <b>leave</b>
admin@example:/&gt;
</code></pre>
<h3 id="rip-global-settings">RIP global settings<a class="headerlink" href="#rip-global-settings" title="Permanent link"></a></h3>
<p>RIP supports redistribution of connected and static routes:</p>
<pre class="cli"><code>admin@example:/config/routing/…/rip/&gt; <b>set redistribute connected</b>
admin@example:/config/routing/…/rip/&gt; <b>set redistribute static</b>
admin@example:/config/routing/…/rip/&gt; <b>leave</b>
admin@example:/&gt;
</code></pre>
<h3 id="debug-ripv2">Debug RIPv2<a class="headerlink" href="#debug-ripv2" title="Permanent link"></a></h3>
<p>The CLI provides various RIP status commands:</p>
<pre class="cli"><code>admin@example:/&gt; <b>show ip rip</b>
Default version control: send version 2, receive version 2
<span class="header"> Interface Send Recv Key-chain </span>
e0 2 2
e1 2 2
Routing for Networks:
e0
e1
Routing Information Sources:
<span class="header"> Gateway BadPackets BadRoutes Distance Last Update</span>
10.0.1.2 0 0 120 00:00:16
Distance: (default is 120)
admin@example:/&gt; <b>show ip rip neighbor</b>
<span class="header">ADDRESS BAD-PACKETS BAD-ROUTES </span>
10.0.1.2 0 0
admin@example:/&gt;
</code></pre>
<p>For more detailed troubleshooting, RIP debug logging can be enabled to
capture specific protocol events. Debug messages are written to the
routing log file (<code>/var/log/routing</code>).</p>
<div class="admonition warning">
<p class="admonition-title">Caution</p>
<p>Debug logging significantly increases log output and may impact
performance. Only enable debug categories needed for troubleshooting,
and disable them when done.</p>
</div>
<p>To enable specific RIP debug categories:</p>
<pre class="cli"><code>admin@example:/&gt; <b>configure</b>
admin@example:/config/&gt; <b>edit routing control-plane-protocol ripv2 name default rip debug</b>
admin@example:/config/routing/…/rip/debug/&gt; <b>set events true</b>
admin@example:/config/routing/…/rip/debug/&gt; <b>set packet true</b>
admin@example:/config/routing/…/rip/debug/&gt; <b>leave</b>
admin@example:/&gt;
</code></pre>
<p>Available debug categories include:</p>
<ul>
<li><code>events</code>: RIP events (sending/receiving packets, timers, interface changes)</li>
<li><code>packet</code>: Detailed packet debugging (packet dumps with origin and port)</li>
<li><code>kernel</code>: Kernel routing table updates (route add/delete, interface updates)</li>
</ul>
<p>All debug options are disabled by default. Refer to the <code>infix-routing</code>
YANG model for the complete list of available debug options.</p>
<p>To view current debug settings:</p>
<pre class="cli"><code>admin@example:/&gt; <b>show running-config routing control-plane-protocol</b>
</code></pre>
<p>To disable all debug logging, simply delete the debug settings or set
all options back to <code>false</code>:</p>
<pre class="cli"><code>admin@example:/&gt; <b>configure</b>
admin@example:/config/&gt; <b>delete routing control-plane-protocol ripv2 name default rip debug</b>
admin@example:/config/&gt; <b>leave</b>
admin@example:/&gt;
</code></pre>
<h2 id="view-routing-table">View routing table<a class="headerlink" href="#view-routing-table" title="Permanent link"></a></h2>
<p>The routing table can be inspected from the operational datastore, XPath
<code>/routing/ribs</code>, using sysrepocfg, NETCONF/RESTCONF, or using the CLI.</p>
<h3 id="ipv4-routing-table">IPv4 routing table<a class="headerlink" href="#ipv4-routing-table" title="Permanent link"></a></h3>
<p>This CLI example shows the IPv4 routing table with a few connected
routes and some routes learned from OSPF. See the next section for
an explanation of route preferences (PREF).</p>
<p>The <code>&gt;</code> at the start of a line marks a selected route (in the IETF YANG
model referred to as <em>active</em>), if there are more than one route with
the same destination the <code>*</code> marks the next-hop used and installed in
the kernel FIB (the YANG model refers to this as <em>installed</em>).</p>
<pre class="cli"><code>admin@example:/&gt; <b>show ip route</b>
<span class="header"> DESTINATION PREF NEXT-HOP PROTO UPTIME</span>
&gt;* 0.0.0.0/0 110/2 10.0.23.1 ospfv2 4h2m43s
&gt;* 10.0.0.1/32 110/4000 10.0.13.1 ospfv2 4h2m43s
10.0.0.3/32 110/0 lo ospfv2 4h2m57s
&gt;* 10.0.0.3/32 0/0 lo direct 4h2m58s
10.0.13.0/30 110/2000 e5 ospfv2 4h2m57s
&gt;* 10.0.13.0/30 0/0 e5 direct 4h2m58s
10.0.23.0/30 110/1 e6 ospfv2 4h2m57s
&gt;* 10.0.23.0/30 0/0 e6 direct 4h2m58s
192.168.3.0/24 110/1 e2 ospfv2 4h2m57s
&gt;* 192.168.3.0/24 0/0 e2 direct 4h2m58s
admin@example:/&gt;
</code></pre>
<h3 id="ipv6-routing-table">IPv6 routing table<a class="headerlink" href="#ipv6-routing-table" title="Permanent link"></a></h3>
<p>This CLI example show the IPv6 routing table.</p>
<pre class="cli"><code>admin@example:/&gt; <b>show ipv6 route</b>
<span class="header"> DESTINATION PREF NEXT-HOP PROTO UPTIME</span>
&gt;* ::/0 1/0 2001:db8:3c4d:50::1 static 0h1m20s
&gt;* 2001:db8:3c4d:50::/64 0/0 e6 direct 0h1m20s
&gt;* 2001:db8:3c4d:200::1/128 0/0 lo direct 0h1m20s
* fe80::/64 0/0 e7 direct 0h1m20s
* fe80::/64 0/0 e6 direct 0h1m20s
* fe80::/64 0/0 e5 direct 0h1m20s
* fe80::/64 0/0 e4 direct 0h1m20s
* fe80::/64 0/0 e3 direct 0h1m20s
* fe80::/64 0/0 e2 direct 0h1m20s
&gt;* fe80::/64 0/0 e1 direct 0h1m20s
admin@example:/&gt;
</code></pre>
<h3 id="route-preference">Route Preference<a class="headerlink" href="#route-preference" title="Permanent link"></a></h3>
<p>The operating system leverages FRRouting (<a href="https://frrouting.org/">Frr</a>) as routing engine
for both static and dynamic routing. Even routes injected from a DHCP
client, and IPv4 link-local (IPv4) routes, are injected into Frr to let
it weigh all routes before installing them into the kernel routing table
(sometimes referred to as FIB).</p>
<p>Routes have different weights made up from a <em>distance</em> and a <em>metric</em>.
The kernel routing table only talks about <em>metric</em>, which unfortunately
is <strong>not the same</strong> -- this is one of the reasons why the term <em>route
preference</em> is used instead. It is recommended to use the CLI, or any
of the other previously mentioned YANG based front-ends, to inspect the
routing table.</p>
<p>Default distances used (lower numeric value wins):</p>
<table>
<thead>
<tr>
<th><strong>Distance</strong></th>
<th><strong>Protocol</strong></th>
</tr>
</thead>
<tbody>
<tr>
<td>0</td>
<td>Kernel routes, i.e., connected routes</td>
</tr>
<tr>
<td>1</td>
<td>Static routes</td>
</tr>
<tr>
<td>5</td>
<td>DHCP routes</td>
</tr>
<tr>
<td>110</td>
<td>OSPF</td>
</tr>
<tr>
<td>254</td>
<td>IPv4LL (ZeroConf) device routes</td>
</tr>
<tr>
<td>255</td>
<td>Route will not be used or redistributed</td>
</tr>
</tbody>
</table>
<p>Hence, a route learned from OSPF may be overridden by a static route set
locally. By default, even a route to the same destination, but with a
different next-hop, learned from a DHCP server wins over an OSPF route.</p>
<p>The distance used for static routes and DHCP routes can be changed by
setting a different <em>routing preference</em> value.</p>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>The kernel metric is an unsigned 32-bit value, which is read by Frr as
(upper) 8 bits distance and 24 bits metric. But it does not write it
back to the kernel FIB this way, only selected routes are candidates
to be installed in the FIB by Frr.</p>
</div>
<h3 id="source-protocol">Source protocol<a class="headerlink" href="#source-protocol" title="Permanent link"></a></h3>
<p>The source protocol describes the origin of the route.</p>
<table>
<thead>
<tr>
<th style="text-align: left;"><strong>Protocol</strong></th>
<th style="text-align: left;"><strong>Description</strong></th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: left;">kernel</td>
<td style="text-align: left;">Added when setting a subnet address on an interface</td>
</tr>
<tr>
<td style="text-align: left;">static</td>
<td style="text-align: left;">User created, learned from DHCP, or IPv4LL</td>
</tr>
<tr>
<td style="text-align: left;">ospfv2</td>
<td style="text-align: left;">Routes learned from OSPFv2</td>
</tr>
</tbody>
</table>
<p>The YANG model <em>ietf-routing</em> support multiple ribs but only two are
currently supported, namely <code>ipv4</code> and <code>ipv6</code>.</p>
</article>
</div>
<script>var target=document.getElementById(location.hash.slice(1));target&&target.name&&(target.checked=target.name.startsWith("__tabbed_"))</script>
</div>
</main>
<footer class="md-footer">
<div class="md-footer-meta md-typeset">
<div class="md-footer-meta__inner md-grid">
<div class="md-copyright">
<div class="md-copyright__highlight">
Copyright © 2022-2025 The KernelKit Team
</div>
</div>
</div>
</div>
</footer>
</div>
<div class="md-dialog" data-md-component="dialog">
<div class="md-dialog__inner md-typeset"></div>
</div>
<div class="md-progress" data-md-component="progress" role="progressbar"></div>
<script id="__config" type="application/json">{"annotate": null, "base": "..", "features": ["toc.follow", "navigation.path", "navigation.instant", "navigation.instant.progress", "navigation.tracking", "navigation.indexes", "search.highlight", "search.share", "content.code.copy", "content.code.annotate", "content.footnote.tooltips"], "search": "../assets/javascripts/workers/search.2c215733.min.js", "tags": null, "translations": {"clipboard.copied": "Copied to clipboard", "clipboard.copy": "Copy to clipboard", "search.result.more.one": "1 more on this page", "search.result.more.other": "# more on this page", "search.result.none": "No matching documents", "search.result.one": "1 matching document", "search.result.other": "# matching documents", "search.result.placeholder": "Type to start searching", "search.result.term.missing": "Missing", "select.version": "Select version"}, "version": {"provider": "mike"}}</script>
<script src="../assets/javascripts/bundle.79ae519e.min.js"></script>
<script id="init-glightbox">const lightbox = GLightbox({"touchNavigation": true, "loop": false, "zoomable": true, "draggable": true, "openEffect": "zoom", "closeEffect": "zoom", "slideEffect": "slide"});
document$.subscribe(()=>{ lightbox.reload(); });
</script></body></html>