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 hashes)
Built Distribution
Close
Hashes for blockunblockips-0.10-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3d30bffd4c5d361a6b10fe7d99ae2b40d5297db112bbc3a1436fe7cb8de38045 |
|
MD5 | 01c73f457822a8499acbd7b882866ce0 |
|
BLAKE2b-256 | aab9ccfffc4513c42dc638cb3a99e3b27c3f36f6e3f857b720c31fae9d2411e8 |