Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generating an IP ACL generates an invalid format ACL #18

Open
tbaschak opened this issue Jan 30, 2020 · 3 comments
Open

Generating an IP ACL generates an invalid format ACL #18

tbaschak opened this issue Jan 30, 2020 · 3 comments

Comments

@tbaschak
Copy link

fprintf(f, " permit ip host %s host %s\n", prefix,

Example of buggy output from the mailing list:
https://tcp0.com/pipermail/bgpq4/2020-January/000002.html

./bgpq4 -E -l FASTNET-ipv4-in AS-FASTNETCOMM
no ip access-list extended FASTNET-ipv4-in
ip access-list extended FASTNET-ipv4-in
 permit ip host 23.133.64.0 host 255.255.255.0
 permit ip host 23.166.32.0 host 255.255.255.0
 permit ip host 64.234.118.0 host 255.255.255.0
 permit ip host 158.51.210.0 host 255.255.254.0
 permit ip host 158.51.244.0 host 255.255.252.0
 permit ip host 161.38.14.0 host 255.255.255.0
 permit ip host 161.129.245.0 host 255.255.255.0
 permit ip host 162.249.40.0 host 255.255.252.0
 permit ip host 162.249.40.0 host 255.255.254.0
 permit ip host 162.249.42.0 host 255.255.254.0
 permit ip host 192.219.0.0 host 255.255.255.0
 permit ip host 199.87.156.0 host 255.255.255.0

There shouldn't be host listed a second time on the line.

I believe the correct code may be as follows, but I'm not 100% confident this code isn't used by other functions other than generating an extended ACL.

fprintf(f, " permit ip %s %s\n", prefix,
	inet_ntoa(*(struct in_addr*) & netmask));
@tbaschak
Copy link
Author

(I might be misunderstanding what the -E option is intended to be used for)

@job
Copy link
Member

job commented Feb 4, 2020

yeah, this seems somewhat broken

@tbaschak
Copy link
Author

tbaschak commented Feb 4, 2020

Stefan de Kooter pointed me to this blog which points to what those extended access-lists are probably used for: https://blog.ine.com/2008/01/04/using-extended-access-lists-in-a-distribute-list

Changing this would likely break users who are using bgpq4 for this purpose.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants