In this recipe, we will outline how to configure OSPF on Juniper devices as the interior gateway protocol (IGP) in our sample network topology, along with different OSPF parameters such as OSPF link type and OSPF interface cost.
Configuring OSPF on Juniper devices
How to do it...
- Create a new Jinja2 file, ospf.j2, in the templates/junos directory, with the following data:
$ cat roles/build_router_config/templates/junos/ospf.j2
protocols {
ospf {
area {{global.ospf_area}} {
{% for intf in p2p_ip[inventory_hostname]|sort(attribute='port') %}
interface {{ intf.port }} {
interface-type p2p;
metric {{intf.cost | default(100)}};
}
{% endfor...