Skip to content

Latest commit

 

History

18 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

Advanced iptables and ip6tables persistent firewall configuration

Configuration files for Linux kernel iptables firewall. Read this article for more information.

Make iptables configuration persistent on start-up:

$ chmod +x /sbin/scripts/4iptables.sh 
$ chmod +x /sbin/scripts/6iptables.sh

$ bash /sbin/scripts/4iptables.sh 
$ bash /sbin/scripts/6iptables.sh

$ chmod +x /sbin/scripts/iptables4.rules
$ chmod +x /sbin/scripts/iptables6.rules

Make iptables configuration persistent on start-up:

$ vi /etc/network/if-pre-up.d/iptables
#!/bin/bash
/sbin/iptables-restore < /sbin/scripts/iptables4.rules
/sbin/ip6tables-restore < /sbin/scripts/iptables6.rules

Make iptables pre-up file executable for startup:

$ chmod +x /etc/network/if-pre-up.d/iptables
$ vi /etc/nftables.conf

Verify and troubelshoot configuration: Make nftables persistant on boot:

$ iptables -vL
$ systemctl enable nftables
$ systemctl start nftables
$ systemctl status nftables

License

Berkeley Software Distribution (BSD)

Author

Jeroen van Kessel | cryptsus.com - we craft cyber security solutions

About

Advanced iptables and ip6tables persistent firewall configurations

Topics

Resources

Stars

4 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages