How it works…

In step 1, we're simply configuring the BSD host as we would do for any normal host or gateway device. The em1 interface on the BSD host acts as intermediate transport address. The address itself isn't relevant to the actual end-application. The important address, for which we'll manage the routing, is the lo0 address on the BSD host.

In step 2, we tell the JUNOS device about the lo0 interface on the BSD box. We use an unusual static route configuration on JUNOS that you might not be used to.

Typical static route configuration

Our static route configuration

static {  route 10.255.255.220/32 {    next-hop 10.255.211.220;  }}
static {  route 10.255.255.220/32 {    next-hop 10.255.255.220;    qualified-next-hop 10.0.211.220 { preference ...

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.