Block / unblock ips using the Windows Firewall
Project description
Block / unblock ips using the Windows Firewall
Tested against Windows 10 / Python 3.11 / Anaconda
pip install blockunblockips
from blockunblockips import unblock_out, unblock_in, block_out, block_in
# Example 1: Unblock outgoing traffic to a specific IP address
ip_to_unblock = "192.168.1.100"
unblock_out(ip_to_unblock)
# This will delete a Windows Firewall rule that allows outgoing traffic to IP 192.168.1.100.
# Example 2: Unblock incoming traffic from a specific IP address
ip_to_unblock = "10.0.0.5"
unblock_in(ip_to_unblock)
# This will delete a Windows Firewall rule that allows incoming traffic from IP 10.0.0.5.
# Example 3: Block outgoing traffic to a specific IP address
ip_to_block = "203.0.113.25"
block_out(ip_to_block)
# This will create a Windows Firewall rule to block outgoing traffic to IP 203.0.113.25.
# Example 4: Block incoming traffic from a specific IP address
ip_to_block = "172.16.0.50"
block_in(ip_to_block)
# This will create a Windows Firewall rule to block incoming traffic from IP 172.16.0.50.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
blockunblockips-0.10.tar.gz
(3.7 kB
view details)
Built Distribution
File details
Details for the file blockunblockips-0.10.tar.gz
.
File metadata
- Download URL: blockunblockips-0.10.tar.gz
- Upload date:
- Size: 3.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c5159ef52fce4bbd5b53e8acb38b1f724a3e42b53bb3a19b6f943e90f1d25f5e |
|
MD5 | 8598e6d2b19a962784ea3aac7b3e59bc |
|
BLAKE2b-256 | d7dd7ecf389d038a29d2f1a188ec7e0528b2e1f3a5c4174993b203cb9c3b2797 |
File details
Details for the file blockunblockips-0.10-py3-none-any.whl
.
File metadata
- Download URL: blockunblockips-0.10-py3-none-any.whl
- Upload date:
- Size: 5.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3d30bffd4c5d361a6b10fe7d99ae2b40d5297db112bbc3a1436fe7cb8de38045 |
|
MD5 | 01c73f457822a8499acbd7b882866ce0 |
|
BLAKE2b-256 | aab9ccfffc4513c42dc638cb3a99e3b27c3f36f6e3f857b720c31fae9d2411e8 |