The Wayback Machine - https://web.archive.org/web/20200616161854/https://github.com/topics/ipv4
Skip to content
#

ipv4

Here are 532 public repositories matching this topic...

adamhj
adamhj commented Jan 13, 2016

If you look at a cisco acl list, it is common to have an acl like:
rule 5 permit ip source 1.2.3.4 0.0.0.0
or in some cases:
rule 5 permit ip source 1.2.3.4 0

here both 0.0.0.0 and 0 are cisco acl bitmask, indicating a net mask of 32 bit length
but if I simply concatenate them with ip address, IPNetwork class will treat them as normal netmask and get the wrong result:

IPNetwork('1.2.3.4/0.0.

persuader
persuader commented Mar 24, 2016

the script coulnd get all the ip addresses of the server interfaces when running xen dom0.
ifconfig does not show aliases for the bridge interface xenbr0 so server blocks his own ip-s.

i changed the line

SERVER_IP_LIST=ifconfig | grep "inet " | awk '{print $2}' | sed "s/addr://g" | xargs | sed -e 's/ /|/g'

to
SERVER_IP_LIST=`( hostname -I ; echo 127.0.0.1 ) | cat | sed ':a;N;$!ba;s/\n/ /g'

bbqchickenrobot
bbqchickenrobot commented May 22, 2019

Would be great to allow an exclusion style lists as well. Say something like:

DontAllow(List<CIDRs>);
DontAllow(List<IPAddress>);
DontAllow(List<CountryCode>);

Right now, if I want to allow every country, say, except for Micronesia I have to list EVERY country but Micronesia. Same thing if I want to only block a few IPs... That said - great library!!! Thanks for your work!

Improve this page

Add a description, image, and links to the ipv4 topic page so that developers can more easily learn about it.

Curate this topic

Add this topic to your repo

To associate your repository with the ipv4 topic, visit your repo's landing page and select "manage topics."

Learn more

You can’t perform that action at this time.