pastebin

Private paste #68682: Firewall script - part 2

#!/bin/sh

IPT=/sbin/iptables

$IPT -F

#policies

$IPT -P OUTPUT ACCEPT
$IPT -P INPUT DROP
$IPT -P FORWARD DROP
$IPT -t nat -P OUTPUT ACCEPT
$IPT -t nat -P PREROUTING ACCEPT
$IPT -t nat -P POSTROUTING ACCEPT



$IPT -N SERVICES

#allowed inputs

$IPT -A INPUT --in-interface lo -j ACCEPT
$IPT -A INPUT -j SERVICES

#allow responses

$IPT -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT


#allow services

$IPT -A SERVICES -p tcp --dport 22 -j ACCEPT
$IPT -A SERVICES -p tcp --dport 8080 -j ACCEPT

$IPT -A SERVICES -m iprange --src-range 192.168.1.1-192.168.1.254 -p tcp --dport 631 -j ACCEPT

$IPT -A SERVICES -m iprange --src-range 192.168.1.1-192.168.1.254 -p udp --dport 631 -j ACCEPT


$IPT -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-ports 8080

$IPT -A FORWARD -p tcp --dport 8080 -j ACCEPT

New paste

  Language:
Private   — Wrap long lines  —  3 + 3 =   —  

About this pastebin

Welcome to the bulix.org / pastebin. Please don't use this pastebin for illegal purposes, defamation or kitten-squashing.

This pastebin is written using PHP and MySQL and relies on Alex Gorbatchev's syntax hhighlighter (JavaScript based). To avoid spam, you will be required to complete a small mathematical challenge when adding a new paste.

New! Try the pastebin command-line tool: paste.py (requires Python and python-beautifulsoup).

30 more recent public pastes


# Title Type Date
1 Untitled ASCII paste by 203.87.12.85 ASCII 15 Mar 2010, 07:10
2 Untitled ASCII paste by 82.247.183.72 ASCII 14 Mar 2010, 11:36
3 Untitled ASCII paste by 212.126.160.18 ASCII 10 Mar 2010, 16:41
4 QT buttons ASCII 10 Mar 2010, 16:01
5 LinqPad Azure Table storage C# 10 Mar 2010, 08:09
6 Jasssystem ASCII 10 Mar 2010, 06:59
7 Untitled ASCII paste by 82.247.183.72 ASCII 09 Mar 2010, 21:10
8 Untitled ASCII paste by 82.247.183.72 ASCII 09 Mar 2010, 20:53
9 Untitled ASCII paste by 124.85.38.49 ASCII 09 Mar 2010, 13:02
10 Untitled ASCII paste by 77.57.166.143 ASCII 09 Mar 2010, 00:23
11 number-bullet.scm ASCII 08 Mar 2010, 10:57
12 numbers.scm ASCII 08 Mar 2010, 10:57
13 Untitled ASCII paste by 77.57.166.143 ASCII 08 Mar 2010, 03:12
14 Untitled ASCII paste by 82.247.183.72 ASCII 07 Mar 2010, 14:46
15 Untitled ASCII paste by 82.247.183.72 ASCII 07 Mar 2010, 14:45
16 Untitled ASCII paste by 82.247.183.72 ASCII 07 Mar 2010, 14:40
17 Untitled ASCII paste by 82.73.10.131 ASCII 06 Mar 2010, 23:39
18 Untitled ASCII paste by 82.247.183.72 ASCII 05 Mar 2010, 11:58
19 Untitled ASCII paste by 82.247.183.72 ASCII 05 Mar 2010, 11:55
20 Untitled ASCII paste by 82.247.183.72 ASCII 05 Mar 2010, 09:20
21 Untitled ASCII paste by 90.35.20.41 ASCII 04 Mar 2010, 14:22
22 Untitled ASCII paste by 82.247.183.72 ASCII 04 Mar 2010, 11:53
23 Untitled ASCII paste by 82.247.183.72 ASCII 04 Mar 2010, 11:53
24 Untitled ASCII paste by 82.247.183.72 ASCII 03 Mar 2010, 17:01
25 GoUrXoUjFyycZcLdUt Java 02 Mar 2010, 21:32
26 Untitled ASCII paste by 82.247.183.72 ASCII 02 Mar 2010, 10:36
27 Untitled PHP paste by 78.86.108.157 PHP 01 Mar 2010, 08:22
28 Make test ASCII 28 Feb 2010, 20:34
29 Untitled ASCII paste by 82.247.183.72 ASCII 28 Feb 2010, 20:27
30 iptables ASCII 28 Feb 2010, 16:04

Powered by the Bulix.org Code Pastebin, by Maxime Petazzoni. View pastebin statistics.