This Bash script allows users to easily manage iptables rules on a Linux system. It prompts users to set default policies, handle traffic from specific IP addresses, and specify which connection types and ports to allow. The script provides a simple and interactive way to configure iptables firewall rules.
- Clone or download the script to your Linux system.
- Make the script executable:
chmod +x iptables-configuration.sh
- Run the script as root:
sudo ./iptables-configuration.sh
- Follow the prompts to set default policies, handle traffic from specific IP addresses, and specify allowed connection types and ports.
- Set default input policy (ACCEPT/DROP).
- Set loopback traffic policy (ACCEPT/DROP).
- Handle traffic from a specific IP address (ACCEPT/DROP).
- Specify allowed connection types (TCP/UDP/ALL).
- Specify ports or port ranges to allow.
- Linux operating system.
- Bash shell.
./iptables-configuration.sh
Set default input policy: ACCEPT
Set loopback traffic policy: ACCEPT
Handle traffic from a specific IP: no
Specify connection types: TCP
Specify ports or port ranges to allow: 80 443
./iptables-configuration.sh
Set default input policy: DROP
Set loopback traffic policy: ACCEPT
Handle traffic from a specific IP: yes
Enter the IP address: 192.168.1.100
Do you want to accept or drop traffic from this IP? (ACCEPT/DROP): ACCEPT
Specify connection types: TCP
Specify ports or port ranges to allow: 22
./iptables-configuration.sh
Set default input policy: DROP
Set loopback traffic policy: ACCEPT
Handle traffic from a specific IP: yes
Enter the IP address: 192.168.1.100
Do you want to accept or drop traffic from this IP? (ACCEPT/DROP): ACCEPT
Specify connection types: ALL
Specify ports or port ranges to allow:
If you encounter any issues or errors while using iptables-configuration
, feel free to join our Discord server for assistance: Join Discord Server
- Email : [email protected]
- Linkedin : https://www.linkedin.com/in/halil-ibrahim-deniz
- Instagram: https://www.instagram.com/deniz.halil333/
- Discord : https://discord.gg/nGBpfMHX4u
- Mysite : https://denizhalil.com
This project is licensed under the MIT License - see the LICENSE file for details.