mirror of
https://github.com/vyos/vyos-documentation.git
synced 2025-10-26 08:41:46 +01:00
OSPF: update description and added WireGuard example
This commit is contained in:
parent
06ca36a89f
commit
1cee9fe391
@ -3,13 +3,22 @@
|
||||
Open Shortest Path First (OSPF)
|
||||
-------------------------------
|
||||
|
||||
IPv4
|
||||
^^^^
|
||||
Open Shortest Path First (OSPF) is a routing protocol for Internet Protocol
|
||||
(IP) networks. It uses a link state routing (LSR) algorithm and falls into the
|
||||
group of interior gateway protocols (IGPs), operating within a single autonomous
|
||||
system (AS). It is defined as OSPF Version 2 in RFC2328_ (1998) for IPv4. Updates
|
||||
for IPv6 are specified as OSPF Version 3 in RFC5340_ (2008). OSPF supports the
|
||||
Classless Inter-Domain Routing (CIDR) addressing model.
|
||||
|
||||
OSPF is a widely used IGP in large enterprise networks.
|
||||
|
||||
OSPFv2 (IPv4)
|
||||
^^^^^^^^^^^^^
|
||||
|
||||
A typical configuration using 2 nodes, redistribute loopback address and the
|
||||
node 1 sending the default route:
|
||||
|
||||
**Node 1:**
|
||||
**Node 1**
|
||||
|
||||
.. code-block:: sh
|
||||
|
||||
@ -26,7 +35,7 @@ node 1 sending the default route:
|
||||
set policy route-map CONNECT rule 10 action permit
|
||||
set policy route-map CONNECT rule 10 match interface lo
|
||||
|
||||
**Node 2:**
|
||||
**Node 2**
|
||||
|
||||
.. code-block:: sh
|
||||
|
||||
@ -40,8 +49,8 @@ node 1 sending the default route:
|
||||
set policy route-map CONNECT rule 10 action permit
|
||||
set policy route-map CONNECT rule 10 match interface lo
|
||||
|
||||
IPv6
|
||||
^^^^
|
||||
OSPFv3 (IPv6)
|
||||
^^^^^^^^^^^^^
|
||||
|
||||
A typical configuration using 2 nodes.
|
||||
|
||||
@ -63,3 +72,55 @@ A typical configuration using 2 nodes.
|
||||
set protocols ospfv3 parameters router-id 192.168.2.1
|
||||
set protocols ospfv3 redistribute connected
|
||||
|
||||
.. note:: You can not easily redistribute IPv6 routes via OSPFv3 on a WireGuard
|
||||
interface link. This requires you to configure link-local addresses manually
|
||||
on the WireGuard interfaces, see Phabricator task T1483_.
|
||||
|
||||
Example configuration for WireGuard interfaces:
|
||||
|
||||
**Node 1**
|
||||
|
||||
.. code-block:: sh
|
||||
|
||||
set interfaces wireguard wg01 address 'fe80::216:3eff:fe51:fd8c/64'
|
||||
set interfaces wireguard wg01 address '192.168.0.1/24'
|
||||
set interfaces wireguard wg01 peer ospf02 allowed-ips '::/0'
|
||||
set interfaces wireguard wg01 peer ospf02 allowed-ips '0.0.0.0/0'
|
||||
set interfaces wireguard wg01 peer ospf02 endpoint '10.1.1.101:12345'
|
||||
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'
|
||||
|
||||
**Node 2**
|
||||
|
||||
.. code-block:: sh
|
||||
|
||||
set interfaces wireguard wg01 address 'fe80::216:3eff:fe0a:7ada/64'
|
||||
set interfaces wireguard wg01 address '192.168.0.2/24'
|
||||
set interfaces wireguard wg01 peer ospf01 allowed-ips '::/0'
|
||||
set interfaces wireguard wg01 peer ospf01 allowed-ips '0.0.0.0/0'
|
||||
set interfaces wireguard wg01 peer ospf01 endpoint '10.1.1.100:12345'
|
||||
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'
|
||||
|
||||
**Status**
|
||||
|
||||
.. code-block:: sh
|
||||
|
||||
vyos@ospf01:~$ sh ipv6 ospfv3 neighbor
|
||||
Neighbor ID Pri DeadTime State/IfState Duration I/F[State]
|
||||
192.168.0.2 1 00:00:37 Full/PointToPoint 00:18:03 wg01[PointToPoint]
|
||||
|
||||
vyos@ospf02# run sh ipv6 ospfv3 neighbor
|
||||
Neighbor ID Pri DeadTime State/IfState Duration I/F[State]
|
||||
192.168.0.1 1 00:00:39 Full/PointToPoint 00:19:44 wg01[PointToPoint]
|
||||
|
||||
.. _RFC2328: https://tools.ietf.org/html/rfc2328
|
||||
.. _RFC5340: https://tools.ietf.org/html/rfc2340
|
||||
.. _T1483: https://phabricator.vyos.net/T1483
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user