Code Monkey home page Code Monkey logo

firewall-iptables's Introduction

IP Firewall Config (for Linux and iptables)

Copyright (C) 2001 Oskar Andreasson <[email protected]>
Extensively rewritten by Bart Massey <[email protected]> 2001-2012.

This collection of shell scripts uses iptables on a Debian Linux box to set up an IP firewall. Specifically, it sets up my firewall. While it may be helpful in setting up your firewall, you should be aware that:

  • I have no idea whether this thing does what it is supposed to. On my boxes, it seems to let most of the packets I want to let through get through. I cannot promise more than that. The whole thing may be horribly insecure even on my boxes. Your boxes may be different than mine in important ways. Read the scripts yourself, and adapt as desired.

  • The more your network looks different from mine, the more that you are going to have to give up on just plugging config variables and actually alter the script. Adding another network is easy. Doing more gets intricate.

  • My policy choices may not be yours. Again, the only way to fix this is to alter the script. I've described my current intended policy below.

This work was adapted incrementally from Oskar Andreasson's original over a period of many years. In June of 2012, I rewrote enough of it to restore some generality and portability.

Policy

My setup is:

  • An external Internet connection (and sometimes two).

  • An internal trusted GB LAN ethernet.

  • An internal trusted Ethernet-Over-Power interface on my firewall box.

  • A WPA-protected trusted 802.11 interface on my firewall box.

  • A WEP-protected "semi-trusted" 802.11 interface on my firewall box.

My intended policy is this:

  • My firewall/server box should be able to send and receive any packets from anywhere. It is a trusted host. It should be able to provide services on any port.

  • Hosts on the trusted networks should be able to send packets anywhere they want. They should be able to receive packets from the Internet only from trusted sources and/or ports. They should not be able to provide services on any port unless specific exception is made.

  • Hosts on the semi-trusted network should be able to send packets to the Internet, but not to any of the trusted networks. They should be able to receive packets from the Internet only from trusted sources and/or ports. They should not be able to provide services on any port unless specific exception is made.

Installation

Examine everything carefully. Do the configuration variable settings at the front of firewall-iptables. Configure the Makefile as needed, then run "make install" as root. Configure your system RC files as appropriate to get the firewall scripts run at boot. Enjoy your new firewall.

The firewall-iptables script auto-configures itself based on the available interfaces it finds when it runs. You need to be very careful to put any dependencies in the init script that you need to make sure all the interfaces are up for firewall-iptables to find. Otherwise you will get mysterious behavior. For example, I have my script that does magic to bring up my wireless connection as a dependency of firewall.init .

Bart Massey <[email protected]>
2012-07-13

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.