https://github.com/deric/bash-firewall
a bash DSL for generating firewall rules
https://github.com/deric/bash-firewall
Last synced: 12 months ago
JSON representation
a bash DSL for generating firewall rules
- Host: GitHub
- URL: https://github.com/deric/bash-firewall
- Owner: deric
- Created: 2015-01-10T15:22:49.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2015-04-07T14:50:19.000Z (about 11 years ago)
- Last Synced: 2025-04-04T10:34:02.134Z (about 1 year ago)
- Language: Shell
- Size: 188 KB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Bash firewall
Scripts for generating iptables rules.
## Checkout
git clone https://github.com/deric/bash-firewall.git /root/.firewall && source /root/.firewall/install
## Usage
Main firewall config should be located in `~/.fw/rules`
opening port
```
open_port tcp 22
```
will generate command:
```
/sbin/iptables -A input_new -p tcp -m multiport --destination-port 22 -j ACCEPT
```
`iptables` command is aliased as `ipt`
```
ipt -A INPUT -s 127.0.0.1 -j ACCEPT
```
Generate preview of iptables commands which will be applied
```
$ fw
```
apply firewall rules:
```
$ fw --apply
```
permanently saves (iptables-persistent)
```
$ fw --save
```