diff options
Diffstat (limited to 'docs/configuration/protocols/ospf.rst')
-rw-r--r-- | docs/configuration/protocols/ospf.rst | 182 |
1 files changed, 170 insertions, 12 deletions
diff --git a/docs/configuration/protocols/ospf.rst b/docs/configuration/protocols/ospf.rst index e3f9759e..60f9c149 100644 --- a/docs/configuration/protocols/ospf.rst +++ b/docs/configuration/protocols/ospf.rst @@ -43,7 +43,8 @@ starts when the first ospf enabled interface is configured. enable ospf on interface with address 192.168.1.1/23, but it does on interface with address 192.168.1.129/25. - In some cases it may be more convenient to enable OSPF on a per interface/subnet + In some cases it may be more convenient to enable OSPF on a per + interface/subnet basis :cfgcmd:`set protocols ospf interface <interface> area <x.x.x.x | x>` .. cfgcmd:: set protocols ospf auto-cost reference-bandwidth <number> @@ -733,11 +734,85 @@ the "<metric of the router which advertised the link>/<link metric>" format. This command displays LSAs in MaxAge list. -Configuration Example ---------------------- +Examples +-------- -Below you can see a typical configuration using 2 nodes, redistribute loopback -address and the node 1 sending the default route: + +Enable OSPF +^^^^^^^^^^^ + +**Node 1** + +.. code-block:: none + + set interfaces loopback lo address 10.1.1.1/32 + set interfaces ethernet eth0 address 192.168.0.1/24 + set protocols ospf area 0 network 192.168.0.0/24 + set protocols ospf area 0 network 10.1.1.1/32 + set protocols ospf parameters router-id 10.1.1.1 + +**Node 2** + +.. code-block:: none + + set interfaces loopback lo address 10.1.1.2/32 + set interfaces ethernet eth0 address 192.168.0.2/24 + set protocols ospf area 0 network 192.168.0.0/24 + set protocols ospf area 0 network 10.1.1.2/32 + set protocols ospf parameters router-id 10.1.1.2 + + + +Here's the neighbors up: + +.. code-block:: none + + Node-1@vyos:~$ show ip ospf neighbor + + Neighbor ID Pri State Up Time Dead Time Address Interface RXmtL RqstL DBsmL + 10.1.1.2 1 Full/DR 3m43s 36.094s 192.168.0.2 eth0:192.168.0.1 0 0 0 + + + + Node-2@vyos:~$ show ip ospf neighbor + + Neighbor ID Pri State Up Time Dead Time Address Interface RXmtL RqstL DBsmL + 10.1.1.1 1 Full/Backup 3m47s 31.736s 192.168.0.1 eth0:192.168.0.2 0 0 0 + +Here's the routes: + +.. code-block:: none + + Node-1@vyos:~$ show ip route ospf + Codes: K - kernel route, C - connected, S - static, R - RIP, + O - OSPF, I - IS-IS, B - BGP, E - EIGRP, N - NHRP, + T - Table, v - VNC, V - VNC-Direct, A - Babel, F - PBR, + f - OpenFabric, + > - selected route, * - FIB route, q - queued, r - rejected, b - backup + t - trapped, o - offload failure + + O 10.1.1.1/32 [110/0] is directly connected, lo, weight 1, 00:00:14 + O>* 10.1.1.2/32 [110/1] via 192.168.0.2, eth0, weight 1, 00:00:07 + O 192.168.0.0/24 [110/1] is directly connected, eth0, weight 1, 00:03:32 + + Node-2@vyos:~$ show ip route ospf + Codes: K - kernel route, C - connected, S - static, R - RIP, + O - OSPF, I - IS-IS, B - BGP, E - EIGRP, N - NHRP, + T - Table, v - VNC, V - VNC-Direct, A - Babel, F - PBR, + f - OpenFabric, + > - selected route, * - FIB route, q - queued, r - rejected, b - backup + t - trapped, o - offload failure + + O>* 10.1.1.1/32 [110/1] via 192.168.0.1, eth0, weight 1, 00:00:11 + O 10.1.1.2/32 [110/0] is directly connected, lo, weight 1, 00:00:04 + O 192.168.0.0/24 [110/1] is directly connected, eth0, weight 1, 00:03:18 + + + + + +Enable OSPF with route redistribution of the loopback and default originate: +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ **Node 1** @@ -771,6 +846,89 @@ address and the node 1 sending the default route: set policy route-map CONNECT rule 10 match interface lo +Enable OSPF with Segment Routing (Experimental): +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +**Node 1** + +.. code-block:: none + + set interfaces loopback lo address 10.1.1.1/32 + set interfaces ethernet eth0 address 192.168.0.1/24 + set protocols ospf area 0 network '192.168.0.0/24' + set protocols ospf area 0 network '10.1.1.1/32' + set protocols ospf parameters opaque-lsa + set protocols ospf parameters router-id '10.1.1.1' + set protocols ospf segment-routing global-block high-label-value '1100' + set protocols ospf segment-routing global-block low-label-value '1000' + set protocols ospf segment-routing prefix 10.1.1.1/32 index explicit-null + set protocols ospf segment-routing prefix 10.1.1.1/32 index value '1' + +**Node 2** + +.. code-block:: none + + set interfaces loopback lo address 10.1.1.2/32 + set interfaces ethernet eth0 address 192.168.0.2/24 + set protocols ospf area 0 network '192.168.0.0/24' + set protocols ospf area 0 network '10.1.1.2/32' + set protocols ospf parameters opaque-lsa + set protocols ospf parameters router-id '10.1.1.2' + set protocols ospf segment-routing global-block high-label-value '1100' + set protocols ospf segment-routing global-block low-label-value '1000' + set protocols ospf segment-routing prefix 10.1.1.2/32 index explicit-null + set protocols ospf segment-routing prefix 10.1.1.2/32 index value '2' + + +This gives us MPLS segment routing enabled and labels for far end loopbacks: + +.. code-block:: none + + Node-1@vyos:~$ show mpls table + Inbound Label Type Nexthop Outbound Label + ----------------------------------------------------------- + 1002 SR (OSPF) 192.168.0.2 IPv4 Explicit Null <-- Node-2 loopback learned on Node-1 + 15000 SR (OSPF) 192.168.0.2 implicit-null + 15001 SR (OSPF) 192.168.0.2 implicit-null + + Node-2@vyos:~$ show mpls table + Inbound Label Type Nexthop Outbound Label + ----------------------------------------------------------- + 1001 SR (OSPF) 192.168.0.1 IPv4 Explicit Null <-- Node-1 loopback learned on Node-2 + 15000 SR (OSPF) 192.168.0.1 implicit-null + 15001 SR (OSPF) 192.168.0.1 implicit-null + +Here is the routing tables showing the MPLS segment routing label operations: + +.. code-block:: none + + Node-1@vyos:~$ show ip route ospf + Codes: K - kernel route, C - connected, S - static, R - RIP, + O - OSPF, I - IS-IS, B - BGP, E - EIGRP, N - NHRP, + T - Table, v - VNC, V - VNC-Direct, A - Babel, F - PBR, + f - OpenFabric, + > - selected route, * - FIB route, q - queued, r - rejected, b - backup + t - trapped, o - offload failure + + O 10.1.1.1/32 [110/0] is directly connected, lo, weight 1, 00:03:43 + O>* 10.1.1.2/32 [110/1] via 192.168.0.2, eth0, label IPv4 Explicit Null, weight 1, 00:03:32 + O 192.168.0.0/24 [110/1] is directly connected, eth0, weight 1, 00:03:43 + + Node-2@vyos:~$ show ip route ospf + Codes: K - kernel route, C - connected, S - static, R - RIP, + O - OSPF, I - IS-IS, B - BGP, E - EIGRP, N - NHRP, + T - Table, v - VNC, V - VNC-Direct, A - Babel, F - PBR, + f - OpenFabric, + > - selected route, * - FIB route, q - queued, r - rejected, b - backup + t - trapped, o - offload failure + + O>* 10.1.1.1/32 [110/1] via 192.168.0.1, eth0, label IPv4 Explicit Null, weight 1, 00:03:36 + O 10.1.1.2/32 [110/0] is directly connected, lo, weight 1, 00:03:51 + O 192.168.0.0/24 [110/1] is directly connected, eth0, weight 1, 00:03:51 + + + + .. _routing-ospfv3: ************* @@ -790,7 +948,7 @@ General VyOS does not have a special command to start the OSPFv3 process. The OSPFv3 process starts when the first ospf enabled interface is configured. -.. cfgcmd:: set protocols ospfv3 area <number> interface <interface> +.. cfgcmd:: set protocols ospfv3 interface <interface> area <number> This command specifies the OSPFv3 enabled interface. This command is also used to enable the OSPF process. The area number can be specified in @@ -987,7 +1145,7 @@ A typical configuration using 2 nodes. .. code-block:: none - set protocols ospfv3 area 0.0.0.0 interface eth1 + set protocols ospfv3 interface eth1 area 0.0.0.0 set protocols ospfv3 area 0.0.0.0 range 2001:db8:1::/64 set protocols ospfv3 parameters router-id 192.168.1.1 set protocols ospfv3 redistribute connected @@ -996,7 +1154,7 @@ A typical configuration using 2 nodes. .. code-block:: none - set protocols ospfv3 area 0.0.0.0 interface eth1 + set protocols ospfv3 interface eth1 area 0.0.0.0 set protocols ospfv3 area 0.0.0.0 range 2001:db8:2::/64 set protocols ospfv3 parameters router-id 192.168.2.1 set protocols ospfv3 redistribute connected @@ -1025,8 +1183,8 @@ Example configuration for WireGuard interfaces: set interfaces wireguard wg01 peer ospf02 pubkey 'ie3...=' set interfaces wireguard wg01 port '12345' set protocols ospfv3 parameters router-id 192.168.1.1 - set protocols ospfv3 area 0.0.0.0 interface 'wg01' - set protocols ospfv3 area 0.0.0.0 interface 'lo' + set protocols ospfv3 interface 'wg01' area 0.0.0.0 + set protocols ospfv3 interface 'lo' area 0.0.0.0 **Node 2** @@ -1040,8 +1198,8 @@ Example configuration for WireGuard interfaces: set interfaces wireguard wg01 peer ospf01 pubkey 'NHI...=' set interfaces wireguard wg01 port '12345' set protocols ospfv3 parameters router-id 192.168.1.2 - set protocols ospfv3 area 0.0.0.0 interface 'wg01' - set protocols ospfv3 area 0.0.0.0 interface 'lo' + set protocols ospfv3 interface 'wg01' area 0.0.0.0 + set protocols ospfv3 interface 'lo' area 0.0.0.0 **Status** |