|
NAMEaclgen - create optimized access listsSYNOPSISaclgen [-h] [-p] [-i] [-m permit,deny] [-f format-string] [-t trace-flags] [input_file]DESCRIPTIONaclgen builds optimized IP access lists. It is primarily intended for use in large scripts that generate access lists, network lists, or series of static routes from various input sources, e.g. RIPE database route or inetnum objects.aclgen reads a series of IP address specifications, then computes the most compact classless notation of listed address ranges. The input address expressions may be inclusive or exclusive. Meanwhile the program reads the input it builds internally a binary tree representing the whole address space. After reading the input data, aclgen makes several optimizations on the tree on order to generate the smallest possible graph corresponding to the input address expresions. Each input line may contain one address expression or a comment. The program accepts wide variety of input formats.
Address specifications may be preceded by a modifier. Modifiers may be positive or negative. The default modifier is positive. The acceptable input modifiers are positive negative ------------------- + - permit deny yes no Modifiers are case insensitive, the default is positive. The input address list is preceded by an implicit
Empty lines, leading/trailing spaces and any characters from `#' to the end of line are ignored as well as unparseable lines. If the input line begins with `*' aclgen prints the currents state of the binary tree of the address space. This is for debugging purposes only. The input is read from infile or from the standard input if no input file specified. `-' means stdin too. OPTIONS
EXAMPLESThe examples below follow the syntax of Cisco IOS configuration commands.Basic functionality % aclgen -f "access-list 83 %m %a %w" << END > 192.168.10.0-192.168.15.0 # range of 6 C classes > 192.168.16.0/23 # classless > 192.168.18.0 # classful > 192.168.19.0 # classful > 192.168.32.0 255.255.224.0 # masked > 192.168.32.5 # host > 192.168.80.7 # host > END access-list 83 deny 192.168.8.0 0.0.1.255 access-list 83 permit 192.168.8.0 0.0.7.255 access-list 83 permit 192.168.16.0 0.0.3.255 access-list 83 permit 192.168.32.0 0.0.31.255 access-list 83 permit 192.168.80.7 0.0.0.0 access-list 83 deny 0.0.0.0 255.255.255.255 % The same list but inverted % aclgen -f "access-list 83 %m %a %w" -m "deny ,permit" << END > 192.168.10.0-192.168.15.0 # range of 6 C classes > 192.168.16.0/23 # classless > 192.168.18.0 # classful > 192.168.19.0 # classful > 192.168.32.0 255.255.224.0 # masked > 192.168.32.5 # host > 192.168.80.7 # host > END access-list 83 permit 192.168.8.0 0.0.1.255 access-list 83 deny 192.168.8.0 0.0.7.255 access-list 83 deny 192.168.16.0 0.0.3.255 access-list 83 deny 192.168.32.0 0.0.31.255 access-list 83 deny 192.168.80.7 0.0.0.0 access-list 83 permit 0.0.0.0 255.255.255.255 % Classless BGP announcements % aclgen -p -f "network %a %k" <<END > 192.168.10.0-192.168.15.0 # range of 6 C classes > 192.168.16.0/23 # classless > 192.168.18.0 # classful > 192.168.19.0 # classful > 192.168.32.0 255.255.224.0 # masked > 192.168.32.5 # host > 192.168.80.7 # host END network 192.168.10.0 255.255.254.0 network 192.168.12.0 255.255.252.0 network 192.168.16.0 255.255.252.0 network 192.168.32.0 255.255.224.0 network 192.168.80.7 255.255.255.255 % Static routes % aclgen -p -f "ip route %a %k 10.0.3.2" <<END > 192.168.10.0-192.168.15.0 # range of 6 C classes > no 192.168.13.128/26 # hole in the block above > 192.168.16.0/23 # classless > 192.168.18.0 # classful > 192.168.19.0 # classful > 192.168.32.0 255.255.224.0 # masked > END ip route 192.168.10.0 255.255.254.0 10.0.3.2 ip route 192.168.12.0 255.255.255.0 10.0.3.2 ip route 192.168.13.0 255.255.255.128 10.0.3.2 ip route 192.168.13.192 255.255.255.192 10.0.3.2 ip route 192.168.14.0 255.255.254.0 10.0.3.2 ip route 192.168.16.0 255.255.252.0 10.0.3.2 ip route 192.168.32.0 255.255.224.0 10.0.3.2 % BUGSThis manpage is written in "Hunglish". ;-)AUTHORWritten by Gabor Kiss <kissg@sztaki.hu>
Visit the GSP FreeBSD Man Page Interface. |