Skip to content

Instantly share code, notes, and snippets.

@zhihuiyuze
Last active April 29, 2022 11:13
Show Gist options
  • Save zhihuiyuze/a957d1da91c6c640c3f7360029515746 to your computer and use it in GitHub Desktop.
Save zhihuiyuze/a957d1da91c6c640c3f7360029515746 to your computer and use it in GitHub Desktop.
bgpq4 get IP and save to bird configuration file Automatically read prefix from AS-SET using bgpq4
as_set=("AS-HUIZE" "AS141011")
prefix=$(bgpq4 -b -A -6 ${as_set[*]} -R 48 -l allowed_prefix)
if [[ "$prefix" =~ ^ERROR.* ]]; then
exit
else
echo "$prefix" > /etc/bird/filters/allowed_prefix.conf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment