How to use a variable for OSPF interfaces?

Arnaud Gomes-do-Vale arnaud+bird at oook.fr
Fri May 2 13:37:17 CEST 2025


Hi,

I have a common block of configuration for a bunch of routers that I
would like to share in an include file. It looks basically like this:

```
ipv6 table ospf_backbone6;
protocol ospf v3 o_backbone_ipv6 {
    area 0 {
        interface "enp1s0f1.1004";
        interface "loop0" { stub yes; };
    };
    ipv6 {
        import all;
        export all;
        table ospf_backbone6;
    };
}
```

The interface is different on every router and some routers have several
(as in `interface "eth0.1004", "eth3";`), everything else is the same.

I tried the obvious:

```
define OSPF_INTF = "enp1s0f1.1004";
protocol ospf v3 o_backbone_ipv6 {
.../...
       interface OSPF_INTF;
.../...
}
```

Which BIRD definitely didn't like:

```
bird> conf check
Reading configuration from /etc/bird/bird.conf
/etc/bird/bird.conf:110:12 IP address or network constant expected
```

What did I miss?

If this matters, this is with BIRD 2.0.12 from Debian bullseye
backports. I can upgrade if needed but I don't want to if I don't have
to.

-- 
Arnaud


More information about the Bird-users mailing list