How to do it…

First of all we'll set up the environment in the topology diagram using two routers, JUNOS, and OpenBSD, speaking OSPF on common subnets.

  1. Configure the JUNOS router with the appropriate network interfaces, em0, em1, and lo0.
     adamc@router> show configuration interfaces      em0 {         unit 0 {            family inet {              address 10.0.201.201/24;            }         }     }     em1 {         unit 0 {            family inet {              address 10.0.211.201/24;            }         }     }     lo0 {         unit 0 {            family inet {               address 10.255.255.201/32 {                    primary;                                   preferred;                             }                                       }                                       }                                        } 
  1. On the OpenBSD router, effect the same thing by configuring the /etc/hostname.if class of files, then running the netstart shell script to configure the interfaces.
       # cat /etc/hostname.em0                                      inet 10.0.201.220 255.255.255.0 10.0.201.255 description ...

Get JUNOS Automation Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.