How to config a ospf stub area?
Hi, +-----------------------+ +-------------------+ +-------------------+ +---------------------- - + | 172.16.34.0/30 \ / 172.16.45.0/30 \ / 172.16.56.0/30 \ / 172.16.67.0/30 | | rt3 --------------------- rt4 ------------------- rt5 --------------------- rt6 ------------------- rt7 | | area 172.16.34.0 / \ area 0.0.0.0 / \ area 172.16.56.0 / \ | +-----------------------+ +-------------------+ +----- ---------------+ + ------------------------+ OSPF RIP I would like to config area 172.16.34.0 as a stub area, here is my config: ``` rt3.conf protocol ospf v2 { ipv4 { import all; export all; }; area 172.16.34.0 { stub yes; interface "veth34" { type bcast; # Detected by default cost 10; # Interface metric hello 10; # Default hello perid 10 is too long }; interface "lo3" { stub yes; }; }; } ``` rt4.conf ``` protocol ospf v2 { ipv4 { import all; export all; }; area 172.16.34.0 { stub yes; interface "veth43" { type bcast; # Detected by default cost 10; # Interface metric hello 10; # Default hello perid 10 is too long }; interface "lo3" { stub yes; }; }; area 0.0.0.0 { ... } } ``` rt3 ``` rt3# bird -c /etc/bird/lab/rt3.conf -p bird: /etc/bird/lab/rt3.conf:173:1 ASBR must be in non-stub area ``` rt4 ``` rt4# bird -c /etc/bird/lab/rt4.conf -p rt4# birdc -s /run/bird/rt4.pid configure ``` after that rt4 ``` bird> show ospf lsadb ... area 172.16.34.0 router 172.16.8.4 distance 0 stubnet 172.16.34.0/30 metric 10 xnetwork 0.0.0.0/0 metric 1000 bird> show ospf lsadb area 172.16.34.0 Area 172.16.34.0 Type LS ID Router Sequence Age Checksum 0001 172.16.8.4 172.16.8.4 80000019 616 067e 0003 0.0.0.0 172.16.8.4 80000001 621 1753 ``` rt3 ``` bird> show ospf lsadb area 172.16.34.0 Area 172.16.34.0 Type LS ID Router Sequence Age Checksum 0001 172.16.8.3 172.16.8.3 8000001b 676 1d29 0001 172.16.8.4 172.16.8.4 80000017 1782 2578 0004 172.16.8.5 172.16.8.4 80000016 1777 e089 0004 172.16.8.6 172.16.8.4 80000016 1777 3b24 0002 172.16.34.2 172.16.8.4 80000016 1782 f5d7 0003 172.16.45.3 172.16.8.4 80000017 1782 56f3 0003 172.16.56.3 172.16.8.4 80000016 1777 43f2 0003 4.8.5.3 172.16.8.4 80000016 1777 67b2 0003 4.8.5.4 172.16.8.4 80000016 1777 5dbb 0003 4.8.5.11 172.16.8.4 80000016 1777 17fa 0003 4.8.5.12 172.16.8.4 80000016 1777 0d04 0003 4.8.6.3 172.16.8.4 80000003 2017 e63b 0003 4.8.6.4 172.16.8.4 80000003 2017 dc44 0003 4.8.6.11 172.16.8.4 80000003 2017 9683 0003 4.8.6.12 172.16.8.4 80000003 2017 8c8c bird> show ospf lsadb state syntax error, unexpected STATE bird> show ospf state area 172.16.34.0 router 172.16.8.3 distance 0 stubnet 4.8.3.0/30 metric 10 stubnet 4.8.3.4/30 metric 10 stubnet 4.8.3.8/30 metric 10 stubnet 4.8.3.12/30 metric 10 stubnet 172.16.34.0/30 metric 10 stubnet 4.8.3.100/30 metric 10 bird> ```
rt3 ``` rt3# bird -c /etc/bird/lab/rt3.conf -p bird: /etc/bird/lab/rt3.conf:173:1 ASBR must be in non-stub area ``` does it mean this router is an ASBR? but this router only connect to rt4. and does not contain static route, here is the complete bird.conf ``` log syslog all; log "/var/log/bird-rt3.log" all; debug protocols all; router id 172.16.8.3; protocol device { scan time 10; } protocol direct { disabled; ipv4; } filter kernel_out prefix set reject_local_net; { reject_local_net = [ 4.8.3.0/28+, 172.16.34.0/30 ]; if net ~ reject_local_net then reject; else accept; } protocol kernel { ipv4 { import none; export filter kernel_out; }; learn; scan time 20; persist; merge paths on; } protocol ospf v2 { ipv4 { import all; export all; }; area 172.16.34.0 { stub; summary yes; interface "veth34" { type bcast; cost 10; hello 10; }; interface "lo3" { stub yes; }; }; } ``` so how to identify if a router is asbr of abr?
On Wed, Apr 10, 2024 at 02:48:11AM +0000, chan alfie wrote:
rt3 ``` rt3# bird -c /etc/bird/lab/rt3.conf -p bird: /etc/bird/lab/rt3.conf:173:1 ASBR must be in non-stub area ``` does it mean this router is an ASBR? but this router only connect to rt4. and does not contain static route, here is the complete bird.conf
Yes. In BIRD, router is considered ASBR if the export filter of the OSPF protocol is set to something different than 'none' (so it could export external routes, regardless of whether it actually exported them). That is also a reason why it does not allow it the area 172.16.34.0 to be set as stub area (as ASBRs cannot be in stub areas). Just do not set export filter in OSPF if you do not want to export external routes.
protocol ospf v2 { ipv4 { import all; export all; }; area 172.16.34.0 { stub; summary yes; interface "veth34" { type bcast; cost 10; hello 10; }; interface "lo3" { stub yes; }; }; }
-- Elen sila lumenn' omentielvo Ondrej 'Santiago' Zajicek (email: santiago@crfreenet.org) "To err is human -- to blame it on a computer is even more so."
participants (2)
-
chan alfie -
Ondrej Zajicek