### Build and Install bgpq4 Source: https://github.com/bgp/bgpq4/blob/main/README.md Standard sequence of commands to prepare, compile, and install the software from a repository. ```bash ./bootstrap ``` ```bash ./configure ``` ```bash make ``` ```bash make install ``` -------------------------------- ### Build bgpq4 from Source Source: https://context7.com/bgp/bgpq4/llms.txt Compile bgpq4 from its source repository using autotools. This process involves cloning the repository, bootstrapping, configuring, compiling, and optionally installing the tool. ```bash # Clone and prepare build system git clone https://github.com/bgp/bgpq4.git cd bgpq4 ./bootstrap ``` ```bash # Configure and compile ./configure make ``` ```bash # Install system-wide sudo make install ``` ```bash # Create distribution archive make dist ``` ```bash # Clean build files make maintainer-clean ``` -------------------------------- ### Execute bgpq4 in Docker Source: https://github.com/bgp/bgpq4/blob/main/README.md Run the bgpq4 container image to generate prefix lists without local installation. ```bash docker run --rm ghcr.io/bgp/bgpq4:latest -Jl eltel AS20597 policy-options { replace: prefix-list eltel { 81.9.0.0/20; 81.9.32.0/20; 81.9.96.0/20; 81.222.128.0/20; 81.222.160.0/20; 81.222.192.0/18; 85.249.8.0/21; 85.249.224.0/19; 89.112.0.0/17; 217.170.64.0/19; } } ``` -------------------------------- ### Run bgpq4 in a Docker Container Source: https://context7.com/bgp/bgpq4/llms.txt Execute bgpq4 within a Docker container for isolated environments without local installation. This simplifies deployment and ensures consistent execution. ```bash # Pull and run the container docker run --rm ghcr.io/bgp/bgpq4:latest -Jl eltel AS20597 ``` ```bash # Run with aggregation docker run --rm ghcr.io/bgp/bgpq4:latest -Al customers AS-CUSTOMERS ``` ```bash # Generate JSON output docker run --rm ghcr.io/bgp/bgpq4:latest -jl prefixes AS65000 ``` -------------------------------- ### Generate Nokia SR OS format Source: https://context7.com/bgp/bgpq4/llms.txt Create configurations for Nokia SR OS in various CLI formats. ```bash bgpq4 -Nl eltel AS20597 ``` ```bash bgpq4 -nl eltel AS20597 ``` ```bash bgpq4 -n2l eltel AS20597 ``` ```bash bgpq4 -NEl eltel AS20597 ``` -------------------------------- ### Generate Huawei format Source: https://context7.com/bgp/bgpq4/llms.txt Create prefix-lists and AS-path filters for Huawei devices. ```bash bgpq4 -Ul eltel AS20597 ``` ```bash bgpq4 -ul eltel AS20597 ``` ```bash bgpq4 -UG 65000 AS-EXAMPLE ``` -------------------------------- ### Aggregate Prefix-Lists Source: https://context7.com/bgp/bgpq4/llms.txt Use the -A flag to produce more compact configurations by combining adjacent prefixes. ```bash # Generate aggregated prefix-list bgpq4 -Al eltel AS20597 # Output: # no ip prefix-list eltel # ip prefix-list eltel permit 81.9.0.0/20 # ip prefix-list eltel permit 81.9.32.0/20 # ip prefix-list eltel permit 81.9.96.0/20 # ip prefix-list eltel permit 81.222.128.0/20 # ip prefix-list eltel permit 81.222.192.0/18 # ip prefix-list eltel permit 85.249.8.0/21 # ip prefix-list eltel permit 85.249.224.0/19 # ip prefix-list eltel permit 89.112.0.0/18 ge 19 le 19 # ip prefix-list eltel permit 89.112.4.0/22 # ip prefix-list eltel permit 89.112.64.0/19 # ip prefix-list eltel permit 217.170.64.0/19 ge 20 le 20 ``` -------------------------------- ### Generate OpenBGPD format Source: https://context7.com/bgp/bgpq4/llms.txt Create prefix-sets and AS-sets for OpenBGPD. ```bash bgpq4 -Bl eltel AS20597 ``` ```bash bgpq4 -BEl eltel AS20597 ``` ```bash bgpq4 -Bt AS-ELTEL ``` ```bash bgpq4 -Ba 65000 -l eltel AS20597 ``` -------------------------------- ### Generate Cisco IOS Prefix-Lists Source: https://context7.com/bgp/bgpq4/llms.txt Create standard IPv4 prefix-lists for Cisco routers using an AS-SET or ASN. ```bash # Generate prefix-list for AS20597 bgpq4 -l eltel AS20597 # Output: # no ip prefix-list eltel # ip prefix-list eltel permit 81.9.0.0/20 # ip prefix-list eltel permit 81.9.32.0/20 # ip prefix-list eltel permit 81.9.96.0/20 # ip prefix-list eltel permit 81.222.128.0/20 # ip prefix-list eltel permit 81.222.192.0/18 # ip prefix-list eltel permit 85.249.8.0/21 # ip prefix-list eltel permit 85.249.224.0/19 # ip prefix-list eltel permit 89.112.0.0/19 # ip prefix-list eltel permit 89.112.4.0/22 # ip prefix-list eltel permit 89.112.32.0/19 # ip prefix-list eltel permit 89.112.64.0/19 # ip prefix-list eltel permit 217.170.64.0/20 # ip prefix-list eltel permit 217.170.80.0/20 ``` -------------------------------- ### Generate AS-Path Access-Lists Source: https://context7.com/bgp/bgpq4/llms.txt Create BGP policy filters for AS-path matching using -f or -G flags. ```bash # Generate input AS-path filter for AS112 via AS-SPACENET bgpq4 -Jf 112 AS-SPACENET # Output: # policy-options { # replace: # as-path-group NN { # as-path a0 "^112(112)*$"; ``` -------------------------------- ### Maintain Build System Source: https://github.com/bgp/bgpq4/blob/main/README.md Commands for cleaning the build environment or creating a distribution archive. ```bash make maintainer-clean ``` ```bash make dist ``` -------------------------------- ### Generate Cisco AS-path filter Source: https://context7.com/bgp/bgpq4/llms.txt Create an AS-path filter for Cisco devices. ```bash bgpq4 -G 65000 AS-EXAMPLE ``` -------------------------------- ### Generate Juniper JunOS Prefix-Lists Source: https://context7.com/bgp/bgpq4/llms.txt Create prefix-lists and route-filters in Juniper format using the -J flag. ```bash # Generate Juniper prefix-list bgpq4 -Jl eltel AS20597 # Output: # policy-options { # replace: # prefix-list eltel { # 81.9.0.0/20; # 81.9.32.0/20; # 81.9.96.0/20; # 81.222.128.0/20; # 81.222.192.0/18; # 85.249.8.0/21; # 85.249.224.0/19; # 89.112.0.0/19; # 89.112.4.0/22; # 89.112.32.0/19; # 89.112.64.0/19; # 217.170.64.0/20; # 217.170.80.0/20; # } # } ``` -------------------------------- ### Generate IPv6 prefix-list Source: https://github.com/bgp/bgpq4/blob/main/README.md Demonstrates IPv6 support using the -6 flag. ```bash $ bgpq4 -6l as-retn-6 AS-RETN6 no ipv6 prefix-list as-retn-6 ipv6 prefix-list as-retn-6 permit 2001:7fb:fe00::/48 ipv6 prefix-list as-retn-6 permit 2001:7fb:fe01::/48 [....] ``` -------------------------------- ### Generate BIRD format Source: https://context7.com/bgp/bgpq4/llms.txt Create prefix-lists and AS-paths for the BIRD routing daemon. ```bash bgpq4 -bl eltel AS20597 ``` ```bash bgpq4 -bf 112 AS-SPACENET ``` ```bash bgpq4 -bt AS-ELTEL ``` -------------------------------- ### Demonstrate Source Order Sensitivity Source: https://github.com/bgp/bgpq4/blob/main/README.md The order of sources in the -S flag can affect the resulting prefix list output. ```bash $ bgpq4 -S RIPE,RADB as-space no ip prefix-list NN ip prefix-list NN permit 195.190.32.0/19 ``` ```bash $ bgpq4 -S RADB,RIPE as-space no ip prefix-list NN ip prefix-list NN permit 45.4.4.0/22 ip prefix-list NN permit 45.4.132.0/22 ip prefix-list NN permit 45.6.128.0/22 ip prefix-list NN permit 45.65.184.0/22 [...] ``` -------------------------------- ### Generate MikroTik RouterOS format Source: https://context7.com/bgp/bgpq4/llms.txt Create prefix-lists for MikroTik RouterOS v6 and v7. ```bash bgpq4 -Kl eltel AS20597 ``` ```bash bgpq4 -K7l eltel AS20597 ``` -------------------------------- ### Generate Cisco prefix-list with aggregation Source: https://github.com/bgp/bgpq4/blob/main/README.md Uses the -A flag to aggregate prefixes into a more compact Cisco prefix-list format. ```bash $ bgpq4 -Al eltel AS20597 no ip prefix-list eltel ip prefix-list eltel permit 81.9.0.0/20 ip prefix-list eltel permit 81.9.32.0/20 ip prefix-list eltel permit 81.9.96.0/20 ip prefix-list eltel permit 81.222.128.0/20 ip prefix-list eltel permit 81.222.192.0/18 ip prefix-list eltel permit 85.249.8.0/21 ip prefix-list eltel permit 85.249.224.0/19 ip prefix-list eltel permit 89.112.0.0/18 ge 19 le 19 ip prefix-list eltel permit 89.112.4.0/22 ip prefix-list eltel permit 89.112.64.0/19 ip prefix-list eltel permit 217.170.64.0/19 ge 20 le 20 ``` -------------------------------- ### Generate Cisco IOS XR format Source: https://context7.com/bgp/bgpq4/llms.txt Create prefix-sets and AS-path filters for Cisco IOS XR. ```bash bgpq4 -Xl eltel AS20597 ``` ```bash bgpq4 -XG 65000 AS-EXAMPLE ``` -------------------------------- ### Generate IPv6 Prefix-Lists Source: https://context7.com/bgp/bgpq4/llms.txt Use the -6 flag to generate prefix-lists for IPv6 address families. ```bash # Generate IPv6 prefix-list for AS-RETN6 bgpq4 -6l as-retn-6 AS-RETN6 # Output: # no ipv6 prefix-list as-retn-6 # ipv6 prefix-list as-retn-6 permit 2001:7fb:fe00::/48 # ipv6 prefix-list as-retn-6 permit 2001:7fb:fe01::/48 # [...] ``` -------------------------------- ### Configure Router Policy-Options Source: https://github.com/bgp/bgpq4/blob/main/tests/reference/sros--6.txt Commands to define a prefix list named NN with specific IPv6 prefixes and commit the changes. ```text configure router policy-options begin no prefix-list "NN" prefix-list "NN" prefix 2001:4:112::/48 exact prefix 2620:4f:8000::/48 exact exit commit ``` -------------------------------- ### Tune OS Network Buffers for Performance Source: https://github.com/bgp/bgpq4/blob/main/README.md Adjust TCP buffer settings to improve performance when expanding large AS-SETs. ```bash sysctl -w net.inet.tcp.sendbuf_max=2097152 ``` ```bash sysctl -w net.ipv4.tcp_window_scaling=1 sysctl -w net.core.rmem_max=2097152 sysctl -w net.core.wmem_max=2097152 sysctl -w net.ipv4.tcp_rmem="4096 87380 2097152" sysctl -w net.ipv4.tcp_wmem="4096 65536 2097152" ``` -------------------------------- ### Generate custom output formats Source: https://context7.com/bgp/bgpq4/llms.txt Use format specifiers to generate custom output for non-router systems. ```bash bgpq4 -F "ipfw add pass all from %n/%l to any\n" as3254 ``` ```bash bgpq4 -6F "%n/%l; " as-eltel ``` ```bash bgpq4 -F "iptables -A INPUT -s %n/%l -j ACCEPT\n" AS65000 ``` -------------------------------- ### Generate complex Juniper policy-options Source: https://github.com/bgp/bgpq4/blob/main/README.md Uses extra match conditions, length constraints, and hierarchical naming for advanced Juniper policy generation. ```bash $ bgpq4 -AJEl eltel/specifics -r 29 -R 32 -M "community blackhole" AS20597 policy-options { policy-statement eltel { term specifics { replace: from { community blackhole; route-filter 81.9.0.0/20 prefix-length-range /29-/32; route-filter 81.9.32.0/20 prefix-length-range /29-/32; route-filter 81.9.96.0/20 prefix-length-range /29-/32; route-filter 81.222.128.0/20 prefix-length-range /29-/32; route-filter 81.222.192.0/18 prefix-length-range /29-/32; route-filter 85.249.8.0/21 prefix-length-range /29-/32; route-filter 85.249.224.0/19 prefix-length-range /29-/32; route-filter 89.112.0.0/17 prefix-length-range /29-/32; route-filter 217.170.64.0/19 prefix-length-range /29-/32; } } } } ``` -------------------------------- ### Generate Juniper prefix-filter Source: https://github.com/bgp/bgpq4/blob/main/README.md Generates a named Juniper prefix-list for a specific AS. ```bash $ bgpq4 -Jl eltel AS20597 policy-options { replace: prefix-list eltel { 81.9.0.0/20; 81.9.32.0/20; 81.9.96.0/20; 81.222.128.0/20; 81.222.192.0/18; 85.249.8.0/21; 85.249.224.0/19; 89.112.0.0/19; 89.112.4.0/22; 89.112.32.0/19; 89.112.64.0/19; 217.170.64.0/20; 217.170.80.0/20; } } ``` -------------------------------- ### Configure BGPQ4 Prefix List Source: https://github.com/bgp/bgpq4/blob/main/tests/reference/sros-mdcli--4.txt Use these commands to remove an existing prefix list and define a new one with specific prefixes. ```text /configure policy-options delete prefix-list "NN" prefix-list "NN" { prefix 192.31.196.0/24 type exact { } prefix 192.175.48.0/24 type exact { } } ``` -------------------------------- ### Generate Juniper Extended Route-Filters Source: https://context7.com/bgp/bgpq4/llms.txt Apply additional match conditions and more-specific route filtering for Juniper configurations. ```bash # Generate route-filter with community match and more-specifics /29-/32 bgpq4 -AJEl eltel/specifics -r 29 -R 32 -M "community blackhole" AS20597 # Output: # policy-options { # policy-statement eltel { # term specifics { # replace: # from { # community blackhole; # route-filter 81.9.0.0/20 prefix-length-range /29-/32; # route-filter 81.9.32.0/20 prefix-length-range /29-/32; # route-filter 81.9.96.0/20 prefix-length-range /29-/32; # route-filter 81.222.128.0/20 prefix-length-range /29-/32; # route-filter 81.222.192.0/18 prefix-length-range /29-/32; # route-filter 85.249.8.0/21 prefix-length-range /29-/32; # route-filter 85.249.224.0/19 prefix-length-range /29-/32; # route-filter 89.112.0.0/17 prefix-length-range /29-/32; # route-filter 217.170.64.0/19 prefix-length-range /29-/32; # } # } # } # } ``` -------------------------------- ### Configure IPv6 Prefix List Source: https://github.com/bgp/bgpq4/blob/main/tests/reference/ios--6.txt Clears an existing prefix list and defines new permit rules for specific IPv6 prefixes. ```text no ipv6 prefix-list NN ipv6 prefix-list NN permit 2001:4:112::/48 ipv6 prefix-list NN permit 2620:4f:8000::/48 ``` -------------------------------- ### Generate JunOS AS-path-origin filter Source: https://context7.com/bgp/bgpq4/llms.txt Create filters for JunOS 21.3R1+ using the -H flag. ```bash bgpq4 -JH 112 AS-SPACENET ``` -------------------------------- ### Connect to Alternate IRRD Host Source: https://context7.com/bgp/bgpq4/llms.txt Use the -h flag to specify an alternate IRRD host, optionally with a custom port. The default host is rr.ntt.net. ```bash # Use alternate IRRD host bgpq4 -h whois.radb.net AS-EXAMPLE ``` ```bash # Use alternate host with custom port bgpq4 -h irrd.example.com:4343 AS-EXAMPLE ``` -------------------------------- ### Select IRR sources Source: https://context7.com/bgp/bgpq4/llms.txt Limit queries to specific IRR databases or objects. ```bash bgpq4 -S RIPE,ARIN AS-VOSTRON ``` ```bash bgpq4 -S RPKI,AFRINIC,ARIN,APNIC,LACNIC,RIPE AS-EXAMPLE ``` ```bash bgpq4 RIPE::AS-VOSTRON ``` ```bash bgpq4 -S RIPE ARIN::AS-EXAMPLE ``` -------------------------------- ### Specify Authoritative Source with :: Notation Source: https://github.com/bgp/bgpq4/blob/main/README.md Use the :: notation to set the data source for specific AS-SETs or Route Sets, allowing for granular control over queries. ```bash $./bgpq4 RIPE::AS-VOSTRON no ip prefix-list NN ip prefix-list NN permit 89.21.224.0/19 ip prefix-list NN permit 134.0.64.0/21 ip prefix-list NN permit 208.86.232.0/22 ip prefix-list NN permit 208.86.232.0/24 ip prefix-list NN permit 208.86.233.0/24 ip prefix-list NN permit 208.86.234.0/24 ip prefix-list NN permit 208.86.235.0/24 ``` -------------------------------- ### Configure IPv6 Prefix Source: https://github.com/bgp/bgpq4/blob/main/tests/reference/huawei--6.txt Use this command to permit specific IPv6 prefixes within a routing policy. Ensure the prefix and mask are correctly specified. ```network-configuration undo ip ipv6-prefix NN ip ipv6-prefix NN permit 2001:4:112:: 48 ip ipv6-prefix NN permit 2620:4f:8000:: 48 ``` -------------------------------- ### Configure BGP Prefix List Source: https://github.com/bgp/bgpq4/blob/main/tests/reference/sros--4.txt Use this configuration to define a BGP prefix list named 'NN'. This involves removing any existing 'NN' prefix list and then creating a new one with specific IP address prefixes and exact match criteria. ```junos configure router policy-options begin no prefix-list "NN" prefix-list "NN" prefix 192.31.196.0/24 exact prefix 192.175.48.0/24 exact exit commit ``` -------------------------------- ### Generate Arista EOS format Source: https://context7.com/bgp/bgpq4/llms.txt Create prefix-lists for Arista EOS with automatic sequence numbers. ```bash bgpq4 -el eltel AS20597 ``` -------------------------------- ### Generate JSON output Source: https://context7.com/bgp/bgpq4/llms.txt Produce JSON-formatted output for automation integration. ```bash bgpq4 -jl example AS20597 ``` ```bash bgpq4 -jf 20597 AS-ELTEL ``` ```bash bgpq4 -jt AS-EXAMPLE ``` -------------------------------- ### Configure IPv6 Prefix List Source: https://github.com/bgp/bgpq4/blob/main/tests/reference/eos--6.txt Defines an IPv6 prefix list with specific sequence numbers for permit rules. ```text no ipv6 prefix-list NN ipv6 prefix-list NN seq 1 permit 2001:4:112::/48 seq 2 permit 2620:4f:8000::/48 ``` -------------------------------- ### Generate custom user-defined output Source: https://github.com/bgp/bgpq4/blob/main/README.md Uses the -F flag to define a custom output format string for non-router systems. ```bash $ bgpq4 -F "ipfw add pass all from %n/%l to any\n" as3254 ipfw add pass all from 62.244.0.0/18 to any ipfw add pass all from 91.219.29.0/24 to any ipfw add pass all from 91.219.30.0/24 to any ipfw add pass all from 193.193.192.0/19 to any ``` ```bash $ bgpq4 -6F "%n/%l; " as-eltel 2001:1b00::/32; 2620:4f:8000::/48; 2a04:bac0::/29; 2a05:3a80::/48; ``` -------------------------------- ### Generate JunOS Route-Filter-Lists Source: https://context7.com/bgp/bgpq4/llms.txt Use the -z flag to generate route-filter-lists for JunOS 16.2+. The -J flag specifically targets JunOS output. ```bash # Generate route-filter-list bgpq4 -Jzl eltel AS20597 ``` ```text # Output: # policy-options { # replace: # route-filter-list eltel { # 81.9.0.0/20 exact; # 81.9.32.0/20 exact; # [...] # } # } ``` ```bash # With aggregation bgpq4 -AJzl eltel AS20597 ``` -------------------------------- ### Generate 32-bit ASN path-group Source: https://github.com/bgp/bgpq4/blob/main/README.md Generates an as-path-group supporting 32-bit ASNs. ```bash $ bgpq4 -Jf 112 AS-SPACENET policy-options { replace: as-path-group NN { as-path a0 "^112(112)*$"; as-path a1 "^112(.)*(1898|5539|8495|8763|8878|12136|12931|15909)$"; as-path a2 "^112(.)*(21358|23456|23600|24151|25152|31529|34127|34906)$"; as-path a3 "^112(.)*(35052|41720|43628|44450|196611)$"; } } ``` -------------------------------- ### Define a Prefix Set in Routing Policy Source: https://github.com/bgp/bgpq4/blob/main/tests/reference/srlinux--4.txt Use this syntax to define a new prefix set named 'NN' with specific IP address prefixes and mask length ranges. Ensure correct formatting for prefixes and mask length specifications. ```routing-policy prefix-set "NN" { prefix 192.31.196.0/24 mask-length-range exact { } prefix 192.175.48.0/24 mask-length-range exact { } } ``` -------------------------------- ### Configure BGPQ4 AS Path Group Source: https://github.com/bgp/bgpq4/blob/main/tests/reference/sros-mdcli--asp.txt Defines an AS path group named NN with a specific regular expression entry. ```text /configure policy-options delete as-path-group "NN" as-path-group "NN" { entry 1 { expression "112+" } } ``` -------------------------------- ### Configure BGP AS-path group Source: https://github.com/bgp/bgpq4/blob/main/tests/reference/sros--asp.txt Defines an AS-path group named NN with a specific regular expression entry. ```text configure router policy-options begin no as-path-group "NN" as-path-group "NN" entry 1 expression "112+" exit commit ``` -------------------------------- ### Update Test Reference Data Source: https://github.com/bgp/bgpq4/blob/main/README.md Execute the generation script to update known-good reference data after modifying bgpq4 output. ```bash ./tests/generate_outputs.sh ./bgpq4 tests/reference ``` -------------------------------- ### Configure BGP Prefix List Source: https://github.com/bgp/bgpq4/blob/main/tests/reference/sros-mdcli--6.txt Defines a prefix list named 'NN' for BGP policy configuration. This includes IPv6 prefixes with an exact match type. ```junos prefix-list "NN" { prefix 2001:4:112::/48 type exact { } prefix 2620:4f:8000::/48 type exact { } } ``` -------------------------------- ### Limit IRR Data Sources with -S Flag Source: https://github.com/bgp/bgpq4/blob/main/README.md Use the -S flag to restrict queries to specific databases. Ensure all required sources for the AS-SET are included. ```bash $./bgpq4 -S RIPE AS-VOSTRON no ip prefix-list NN ip prefix-list NN permit 89.21.224.0/19 ip prefix-list NN permit 134.0.64.0/21 ``` ```bash $./bgpq4 -S RIPE,ARIN AS-VOSTRON no ip prefix-list NN ip prefix-list NN permit 89.21.224.0/19 ip prefix-list NN permit 134.0.64.0/21 ip prefix-list NN permit 208.86.232.0/24 ip prefix-list NN permit 208.86.233.0/24 ip prefix-list NN permit 208.86.234.0/24 ip prefix-list NN permit 208.86.235.0/24 ``` -------------------------------- ### Generate Cisco/Arista Prefix-Lists with Sequence Numbers Source: https://context7.com/bgp/bgpq4/llms.txt Use the -s flag to add sequence numbers to Cisco IOS and Arista EOS prefix-lists. This is essential for managing and updating prefix-lists on these platforms. ```bash # Generate prefix-list with sequence numbers bgpq4 -sl eltel AS20597 ``` ```text # Output: # no ip prefix-list eltel # ip prefix-list eltel seq 1 permit 81.9.0.0/20 # ip prefix-list eltel seq 2 permit 81.9.32.0/20 # ip prefix-list eltel seq 3 permit 81.9.96.0/20 # [...] ``` -------------------------------- ### Add BGP Routing Filter Rule Source: https://github.com/bgp/bgpq4/blob/main/tests/reference/routeros7--4.txt Use this command to add a new routing filter rule to a specified chain. The rule accepts traffic if the destination matches the given IP address range. ```bash /routing filter rule add chain="NN-V4" rule="if (dst==192.31.196.0/24) {accept}" ``` ```bash /routing filter rule add chain="NN-V4" rule="if (dst==192.175.48.0/24) {accept}" ``` -------------------------------- ### Limit Maximum Prefix Length Source: https://context7.com/bgp/bgpq4/llms.txt Use the -m flag to limit the maximum prefix length for accepted prefixes. This is useful for controlling the granularity of your routing policies. ```bash # Accept only prefixes up to /24 for IPv4 bgpq4 -m 24 -l customers AS-CUSTOMERS ``` ```bash # Accept only prefixes up to /48 for IPv6 bgpq4 -6 -m 48 -l customers6 AS-CUSTOMERS ``` -------------------------------- ### Exclude Objects from Expansion Source: https://context7.com/bgp/bgpq4/llms.txt Append EXCEPT followed by the objects to exclude to prevent their expansion. This is useful for fine-tuning the generated filters. ```bash # Generate prefix-list excluding specific AS-SET bgpq4 -l customers AS-CUSTOMERS EXCEPT AS-EXCLUDED ``` ```bash # Exclude multiple objects bgpq4 -l peers AS-PEERS EXCEPT AS64496 AS-PRIVATE AS-BOGONS ``` -------------------------------- ### Add IPv6 Routing Filter Rule for 2620:4f:8000::/48 Source: https://github.com/bgp/bgpq4/blob/main/tests/reference/routeros7--6.txt Adds a routing filter rule to the 'NN-V6' chain. This rule accepts traffic destined for the 2620:4f:8000::/48 network. This command is useful for implementing specific network access policies. ```bash /routing filter rule add chain="NN-V6" rule="if (dst==2620:4f:8000::/48) {accept}" ``` -------------------------------- ### Add IPv6 Routing Filter Rule for 2001:4:112::/48 Source: https://github.com/bgp/bgpq4/blob/main/tests/reference/routeros7--6.txt Adds a routing filter rule to the 'NN-V6' chain. This rule accepts traffic destined for the 2001:4:112::/48 network. Ensure the 'routing filter rule add' command is available in your environment. ```bash /routing filter rule add chain="NN-V6" rule="if (dst==2001:4:112::/48) {accept}" ``` -------------------------------- ### Configure BGP Prefix List Source: https://github.com/bgp/bgpq4/blob/main/tests/reference/eos--4.txt Defines a BGP prefix list named 'NN' with specific network entries. Use this to filter BGP routes based on IP prefixes. ```network-config no ip prefix-list NN ip prefix-list NN seq 1 permit 192.31.196.0/24 seq 2 permit 192.175.48.0/24 ``` -------------------------------- ### Add BGP Routing Filter Rules Source: https://github.com/bgp/bgpq4/blob/main/tests/reference/routeros6--4.txt Defines filter rules to accept specific IPv4 prefixes in the NN-V4 chain. ```RouterOS /routing filter add action=accept chain="NN-V4" prefix=192.31.196.0/24 /routing filter add action=accept chain="NN-V4" prefix=192.175.48.0/24 ``` -------------------------------- ### Limit Recursion Depth Source: https://context7.com/bgp/bgpq4/llms.txt Use the -L flag to limit the AS-SET expansion recursion depth. This prevents excessive queries on deeply nested AS-SETs and helps manage resource usage. ```bash # Limit recursion to 2 levels bgpq4 -L 2 AS-LARGESET ``` ```bash # Limit recursion to 5 levels bgpq4 -L 5 -l limited AS-VERYLARGESET ``` -------------------------------- ### Delete BGP Prefix List Source: https://github.com/bgp/bgpq4/blob/main/tests/reference/sros-mdcli--6.txt Command to delete an existing prefix list named 'NN' within BGP policy options. ```junos delete prefix-list "NN" ``` -------------------------------- ### Delete a Prefix Set in Routing Policy Source: https://github.com/bgp/bgpq4/blob/main/tests/reference/srlinux--4.txt Command to remove an existing prefix set named 'NN' from the routing policy configuration. This action is irreversible. ```routing-policy delete prefix-set "NN" ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.