gnu_linux_server:network_configuration:firewall
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| gnu_linux_server:network_configuration:firewall [2012/01/28 20:20] – Script (ajout init info + debug + correction syntaxe) guillaume | gnu_linux_server:network_configuration:firewall [2021/01/04 20:41] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 12: | Line 12: | ||
| <code bash> | <code bash> | ||
| deny_everything() { | deny_everything() { | ||
| - | | + | |
| iptables -t filter -P INPUT DROP | iptables -t filter -P INPUT DROP | ||
| Line 18: | Line 18: | ||
| iptables -t filter -P OUTPUT | iptables -t filter -P OUTPUT | ||
| - | | + | |
| } | } | ||
| </ | </ | ||
| Line 25: | Line 25: | ||
| <code bash> | <code bash> | ||
| cleanup_tables() { | cleanup_tables() { | ||
| - | | + | |
| iptables -t filter -F | iptables -t filter -F | ||
| iptables -t filter -X | iptables -t filter -X | ||
| - | | + | |
| } | } | ||
| </ | </ | ||
| Line 37: | Line 37: | ||
| <code bash> | <code bash> | ||
| dont_break_connections() { | dont_break_connections() { | ||
| - | | + | |
| iptables -A INPUT -m state --state RELATED, | iptables -A INPUT -m state --state RELATED, | ||
| iptables -A OUTPUT -m state --state RELATED, | iptables -A OUTPUT -m state --state RELATED, | ||
| - | | + | |
| } | } | ||
| </ | </ | ||
| Line 49: | Line 49: | ||
| <code bash> | <code bash> | ||
| allow_loopback() { | allow_loopback() { | ||
| - | | + | |
| iptables -t filter -A INPUT -i lo -j ACCEPT | iptables -t filter -A INPUT -i lo -j ACCEPT | ||
| iptables -t filter -A OUTPUT -o lo -j ACCEPT | iptables -t filter -A OUTPUT -o lo -j ACCEPT | ||
| - | | + | |
| } | } | ||
| </ | </ | ||
| Line 158: | Line 158: | ||
| iptables -A SPOOFED -s 192.168.0.0/ | iptables -A SPOOFED -s 192.168.0.0/ | ||
| iptables -A SPOOFED -s 10.0.0.0/ | iptables -A SPOOFED -s 10.0.0.0/ | ||
| + | |||
| + | end_debug $? | ||
| + | } | ||
| + | |||
| + | misc_config() { | ||
| + | print_debug "Misc configurations" | ||
| + | |||
| + | echo 1 > / | ||
| + | echo 0 > / | ||
| + | echo 1 > / | ||
| + | echo 1 >/ | ||
| + | echo 1 > / | ||
| + | echo 1 > / | ||
| + | echo 1 > / | ||
| + | echo 0 > / | ||
| + | echo 0 > / | ||
| end_debug $? | end_debug $? | ||
| Line 322: | Line 338: | ||
| deny_spoofing | deny_spoofing | ||
| + | misc_config | ||
| # Starting fail2ban again | # Starting fail2ban again | ||
gnu_linux_server/network_configuration/firewall.1327782006.txt.gz · Last modified: 2021/01/04 20:40 (external edit)
