define command is not working ?
Hi, I'm trying to make the configuration more template and variable based. but I'm fighting with this .. Am I using the define command wrong? I seen few examples how to use define command .. --- log stderr all; log syslog all; define bgp_router_id = 192.168.93.104; # Override router ID router id bgp_router_id; .... --- On the line with 'router id' I've got 'syntax error'. os: debian jessie bird: 1.4.5 best regards Peter -- *Peter Hudec* Infraštruktúrny architekt phudec@cnc.sk <mailto:phduec@cnc.sk> *CNC, a.s.* Borská 6, 841 04 Bratislava Recepcia: +421 2 35 000 100 Mobil:+421 905 997 203 *www.cnc.sk* <http:///www.cnc.sk>
Hi! If I remember correctly, I tried this as well. And again, if my memory serves me well, you cannot use a defined constant with the "router id"-directive. (Don't know the reason.) But you should be able to use constants in pretty much of all other cases. Best regards, Kai
Gesendet: Dienstag, 14. Juli 2015 um 11:50 Uhr Von: "Peter Hudec" <phudec@cnc.sk> An: bird-users@network.cz Betreff: define command is not working ?
Hi,
I'm trying to make the configuration more template and variable based. but I'm fighting with this .. Am I using the define command wrong? I seen few examples how to use define command ..
--- log stderr all; log syslog all;
define bgp_router_id = 192.168.93.104;
# Override router ID router id bgp_router_id; .... ---
On the line with 'router id' I've got 'syntax error'.
os: debian jessie bird: 1.4.5
best regards Peter
-- *Peter Hudec* Infraštruktúrny architekt phudec@cnc.sk <mailto:phduec@cnc.sk>
*CNC, a.s.* Borská 6, 841 04 Bratislava Recepcia: +421 2 35 000 100
Mobil:+421 905 997 203 *www.cnc.sk* <http:///www.cnc.sk>
Hi, thanks, I put the just value. Any way I have antother snippet ;( --- define anycast_bgp_as = 57801; define anycast_a_bgp_community = 11; define anycast_a_bgp_med = 100; .... filter bgp_out_anycast { if (match_anycast_a()) then { bgp_community.add((anycast_bgp_as,anycast_a_bgp_community)); if (anycast_a_bgp_med > 0) { bgp_med = anycast_a_bgp_med; } accept; } .... --- The problem is in IF statement. I'm thinking to switch to ansible end templates :) best regards Peter On 14/07/15 12:04, Kai wrote:
Hi!
If I remember correctly, I tried this as well. And again, if my memory serves me well, you cannot use a defined constant with the "router id"-directive. (Don't know the reason.) But you should be able to use constants in pretty much of all other cases.
Best regards, Kai
Gesendet: Dienstag, 14. Juli 2015 um 11:50 Uhr Von: "Peter Hudec" <phudec@cnc.sk> An: bird-users@network.cz Betreff: define command is not working ?
Hi,
I'm trying to make the configuration more template and variable based. but I'm fighting with this .. Am I using the define command wrong? I seen few examples how to use define command ..
--- log stderr all; log syslog all;
define bgp_router_id = 192.168.93.104;
# Override router ID router id bgp_router_id; .... ---
On the line with 'router id' I've got 'syntax error'.
os: debian jessie bird: 1.4.5
best regards Peter
-- *Peter Hudec* Infraštruktúrny architekt phudec@cnc.sk <mailto:phduec@cnc.sk>
*CNC, a.s.* Borská 6, 841 04 Bratislava Recepcia: +421 2 35 000 100
Mobil:+421 905 997 203 *www.cnc.sk* <http:///www.cnc.sk>
-- *Peter Hudec* Infraštruktúrny architekt phudec@cnc.sk <mailto:phduec@cnc.sk> *CNC, a.s.* Borská 6, 841 04 Bratislava Recepcia: +421 2 35 000 100 Mobil:+421 905 997 203 *www.cnc.sk* <http:///www.cnc.sk>
On Tue, Jul 14, 2015 at 01:29:35PM +0200, Peter Hudec wrote:
Hi,
If I remember correctly, I tried this as well. And again, if my memory serves me well, you cannot use a defined constant with the "router id"-directive. (Don't know the reason.) thanks, I put the just value.
Hi Well, it is actually a bug, should work even there. There is one more problematic issue related to defines - it shares namespace with keywords and other symbols in config grammars, trying to define name colliding with e.g. a protocol option would cause a syntax error message for that define.
Any way I have antother snippet ;(
--- define anycast_bgp_as = 57801; define anycast_a_bgp_community = 11; define anycast_a_bgp_med = 100;
.... filter bgp_out_anycast {
if (match_anycast_a()) then { bgp_community.add((anycast_bgp_as,anycast_a_bgp_community)); if (anycast_a_bgp_med > 0) { bgp_med = anycast_a_bgp_med; } accept; } .... ---
The problem is in IF statement.
Because of missing 'then' in the inner if-statement. BTW, you don't need outer parentheses in if-statements (e.g. "if a > 0 then { }" is correct). -- Elen sila lumenn' omentielvo Ondrej 'Santiago' Zajicek (email: santiago@crfreenet.org) OpenPGP encrypted e-mails preferred (KeyID 0x11DEADC3, wwwkeys.pgp.net) "To err is human -- to blame it on a computer is even more so."
participants (3)
-
Kai -
Ondrej Zajicek -
Peter Hudec