This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionLast revisionBoth sides next revision | ||
device_filtering [2023/05/24 21:07] – [Block devices via script/scheduler] hogwild | device_filtering [2023/05/24 21:30] – [iptables] -condense, formatting hogwild | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== Block devices via script/ | ====== Block devices via script/ | ||
- | The easiest way to filter | + | The easiest way to filter |
* For a bridged environment (Media-bridge/ | * For a bridged environment (Media-bridge/ | ||
Line 8: | Line 8: | ||
\\ | \\ | ||
- | Given a MAC address you want to control, such as: '' | + | Given a MAC address you want to control, such as: '' |
- | ===== ebtables ===== | + | ===== ebtables |
- | # Block\\ | + | # Block\\ |
- | ''/ | + | |
- | # Unblock\\ | + | \\ |
- | ''/ | + | |
+ | # Unblock\\ | ||
+ | |||
+ | \\ | ||
+ | |||
+ | # Flush (unblock all the defined references at once)\\ | ||
+ | |||
+ | NOTE: you might have additional ebtables in your system so **be very careful** about flushing the full ebtable. | ||
- | # Flush (unblock all the defined references at once)\\ | ||
- | ''/ | ||
- | NOTE: you might have additional ebtables in your system so be very careful about flushing the full ebtable. | ||
===== iptables ===== | ===== iptables ===== | ||
- | # Block Internet access (or any intra-vlan)\\ | ||
- | ''/ | ||
- | # Block any network acrtivity including services provided by the router itself e.g. minidlna/ | + | # Block Internet access (or any intra-vlan)\\ ''/ |
- | ''/ | + | |
- | # Unblock | + | \\ |
- | ''/ | + | |
+ | # Block any network activity, including services provided by the router (e.g. minidlna/ | ||
+ | |||
+ | \\ | ||
+ | |||
+ | # Unblock | ||
+ | |||
+ | \\ | ||
+ | |||
+ | # Flush\\ | ||
+ | |||
+ | \\ | ||
+ | |||
+ | These days, blocking MAC addresses can be tedious task. Many client devices use a MAC randomization function. MAC addresses can " | ||
+ | |||
+ | For dealing with this, one alternative is to filter using hostnames. | ||
+ | |||
+ | \\ | ||
+ | |||
+ | For example: | ||
+ | |||
+ | # Block\\ | ||
+ | |||
+ | \\ | ||
+ | |||
+ | # Unblock\\ | ||
+ | |||
+ | \\ | ||
- | # Flush\\ | + | Still, the hostname is resolved into an IP address by the kernel. A device with a randomized MAC address will obtain a new IP address when reconnecting. This might function well, but only until the user restarts |
- | '' | + | |
- | Blocking mac addresses nowadays can be a very tedious task as many end devices have the mac randomisation function enabled. An alternative is to filter using hostnames e.g.\\ | + | If you were very security conscious, you could trigger a " |
- | # Block\\ | + | For WiFi devices, perhaps the best way to limit access is to make them connect to a dedicated SSID, and enable/ |
- | '' | + | |
- | # Unblock\\ | ||
- | '' | ||
- | Still, the hostname is resolved into an IP by the kernel and a device with random mac address will obtain a new IP when reconnecting. Probably good until the user decides to restart the phone or simply disconnect/ |