diff options
author | Mikael Magnusson <mikma@users.sourceforge.net> | 2019-04-15 13:52:48 +0200 |
---|---|---|
committer | Mikael Magnusson <mikma@users.sourceforge.net> | 2019-04-15 14:04:23 +0200 |
commit | 2917c94c0dbe77f384d1352c3c623d372636c6ae (patch) | |
tree | 87def2a9e6e99b7d57c41159aaf607c4b4209b36 /nest/proto.c | |
parent | 6ff811976513132c831a352bd0aa0f3600252acb (diff) |
firewall protocol supportproto-firewall
Patch by Alexander V. Chernikov <melifaro@ipfw.ru>
Hello list!
This patch adds 'firewall' protocol permitting prefixes announced to
this protocol to be put in configured firewall table with optional value.
Supported firewalls: IPFW, PF, *
Optional value support: IPFW, *
Sample configuration:
protocol bgp {
..
import filter { fw_value = 42; accept; } # Set firewall optional value
for each prefix
}
protocol firewall {
fwtype ipfw;
fwtable "2";
export all;
flush always; # do flush both on startup and shutdown
};
Tested on FreeBSD 8.X, PF should work on Open/NetBSD, too.
[*] I can add support for ipset on demand. However I can't understand
how it can be [effectively] used without some kind of radix/rbtree
backend (according to docs).
P.S.
This can be thought as first step for implementation BGP FlowSpec (RFC 5575)
Diffstat (limited to 'nest/proto.c')
-rw-r--r-- | nest/proto.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/nest/proto.c b/nest/proto.c index d4a333d0..040dc115 100644 --- a/nest/proto.c +++ b/nest/proto.c @@ -1382,7 +1382,9 @@ protos_build(void) #ifdef CONFIG_PERF proto_build(&proto_perf); #endif - +#ifdef CONFIG_FIREWALL + proto_build(&proto_firewall); +#endif proto_pool = rp_new(&root_pool, "Protocols"); proto_shutdown_timer = tm_new(proto_pool); proto_shutdown_timer->hook = proto_shutdown_loop; |