mirror of
https://github.com/vyos/vyos-documentation.git
synced 2025-10-26 08:41:46 +01:00
66 lines
1.8 KiB
ReStructuredText
66 lines
1.8 KiB
ReStructuredText
.. _routing-ospf:
|
|
|
|
Open Shortest Path First (OSPF)
|
|
-------------------------------
|
|
|
|
IPv4
|
|
^^^^
|
|
|
|
A typical configuration using 2 nodes, redistribute loopback address and the
|
|
node 1 sending the default route:
|
|
|
|
**Node 1:**
|
|
|
|
.. code-block:: sh
|
|
|
|
set interfaces loopback lo address 10.1.1.1/32
|
|
set protocols ospf area 0 network 192.168.0.0/24
|
|
set protocols ospf default-information originate always
|
|
set protocols ospf default-information originate metric 10
|
|
set protocols ospf default-information originate metric-type 2
|
|
set protocols ospf log-adjacency-changes
|
|
set protocols ospf parameters router-id 10.1.1.1
|
|
set protocols ospf redistribute connected metric-type 2
|
|
set protocols ospf redistribute connected route-map CONNECT
|
|
|
|
set policy route-map CONNECT rule 10 action permit
|
|
set policy route-map CONNECT rule 10 match interface lo
|
|
|
|
**Node 2:**
|
|
|
|
.. code-block:: sh
|
|
|
|
set interfaces loopback lo address 10.2.2.2/32
|
|
set protocols ospf area 0 network 192.168.0.0/24
|
|
set protocols ospf log-adjacency-changes
|
|
set protocols ospf parameters router-id 10.2.2.2
|
|
set protocols ospf redistribute connected metric-type 2
|
|
set protocols ospf redistribute connected route-map CONNECT
|
|
|
|
set policy route-map CONNECT rule 10 action permit
|
|
set policy route-map CONNECT rule 10 match interface lo
|
|
|
|
IPv6
|
|
^^^^
|
|
|
|
A typical configuration using 2 nodes.
|
|
|
|
**Node 1:**
|
|
|
|
.. code-block:: sh
|
|
|
|
set protocols ospfv3 area 0.0.0.0 interface eth1
|
|
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
|
|
|
|
**Node 2:**
|
|
|
|
.. code-block:: sh
|
|
|
|
set protocols ospfv3 area 0.0.0.0 interface eth1
|
|
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
|
|
|