Ebtables is an application program used to set up and maintain the tables of rules (inside the Linux kernel) that inspect Ethernet frames. It is analogous to the iptables application, but less complicated, due to the fact that the Ethernet protocol is much simpler than the IP protocol. ebtables used with bridges on Linux. The following script will stop and clean all ebtables rules:
#!/bin/bash # A simple shell script to remove all ebtables rules # Tested on : Debian and Ubuntu servers. # ---------------------------------------------------------------------------- # Author: Vivek Gite # Copyright: 2016 nixCraft under GNU GPL v2.0+ # ---------------------------------------------------------------------------- # Last updated 05 Sep 2016 # ---------------------------------------------------------------------------- #----[*** verify me ***]----# EBT=/sbin/ebtables # die if ebtables not found [[ -x "$EBT" ]] || { echo "$0: error \"$EBT\" not found."; exit 1; } # die if we are not root [[ "$(id -u)" != "0" ]] && { echo "Error: $0 script must be run as root." 2>&1; exit 2; } # Let us start for p in INPUT FORWARD OUTPUT do echo "Accepting $p" $EBT -P $p ACCEPT done for T in filter nat broute do echo "Flushing and deleting $T..." $EBT -t $T -F $EBT -t $T -X done
- RSS feed or Weekly email newsletter
- Share on Twitter • Facebook • 5 comments... add one ↓
Category | List of Unix and Linux commands |
---|---|
File Management | cat |
Firewall | Alpine Awall • CentOS 8 • OpenSUSE • RHEL 8 • Ubuntu 16.04 • Ubuntu 18.04 • Ubuntu 20.04 |
Network Utilities | dig • host • ip • nmap |
OpenVPN | CentOS 7 • CentOS 8 • Debian 10 • Debian 8/9 • Ubuntu 18.04 • Ubuntu 20.04 |
Package Manager | apk • apt |
Processes Management | bg • chroot • cron • disown • fg • jobs • killall • kill • pidof • pstree • pwdx • time |
Searching | grep • whereis • which |
User Information | groups • id • lastcomm • last • lid/libuser-lid • logname • members • users • whoami • who • w |
WireGuard VPN | Alpine • CentOS 8 • Debian 10 • Firewall • Ubuntu 20.04 |
Yup. Thanks for the script. I was messing around my CentOS server and this script helped me to reset till I get everything correct for my setup.
Awesome work. thanks!
Use pf. This is just bad.
Cool thanks for share, but I was wondering in what case Do you use ebtables, at practical level.
Thanks.
If you setup bridge on Linux, you need to use this tool to block or allow traffic. Typically bridges includes your wireless wifi or virtual machines.