Warning: Function ereg() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 4

Warning: Function split() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 19

Warning: Function ereg() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 4

Warning: Function split() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 19

Warning: Function ereg() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 4

Warning: Function split() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 19
Simple firewall script
Results 1 to 3 of 3

Thread: Simple firewall script

Hybrid View

  1. #1

    Simple firewall script

    Hello,

    i tried to setup a simple firewall script by following the howto from:
    http://www.siliconvalleyccie.com/lin...bles-intro.htm

    For first i want everything to be blocked and allow connections
    by ssh.

    At the moment the script looks like this:
    Code:
    #---------------------------------------------------------------
    # Initialize all the chains by removing all the rules
    # tied to them
    #---------------------------------------------------------------
    
    iptables --flush
    iptables -t nat --flush
    iptables -t mangle --flush
    
    #---------------------------------------------------------------
    # Now that the chains have been initialized, the user defined
    # chains should be deleted. We'll recreate them in the next step
    #---------------------------------------------------------------
    iptables --delete-chain
    iptables -t nat --delete-chain
    iptables -t mangle --delete-chain
    
    #---------------------------------------------------------------
    # If a packet doesn't match one of the built in chains, then
    # The policy should be to drop it
    #---------------------------------------------------------------
    iptables --policy INPUT   DROP
    iptables --policy OUTPUT  DROP
    iptables --policy FORWARD DROP
    iptables -t nat --policy POSTROUTING ACCEPT
    iptables -t nat --policy PREROUTING ACCEPT
    
    #---------------------------------------------------------------
    # The loopback interface should accept all traffic
    # Necessary for X-Windows and other socket based services
    #---------------------------------------------------------------
    iptables -A INPUT  -i lo -j ACCEPT
    iptables -A OUTPUT -o lo -j ACCEPT
    
    #---------------------------------------------------------------
    # Allow previously established connections
    # - Interface eth0 is the internet interface
    #---------------------------------------------------------------
    iptables -A OUTPUT -o eth0 -m state --state ESTABLISHED,RELATED \
      -j ACCEPT
    
    #---------------------------------------------------------------
    # Allow port 22 (SSH) connections to the firewall
    #---------------------------------------------------------------
    
    iptables -A INPUT -p tcp -i eth0 --dport 22 --sport 1024:65535 \
      -m state --state NEW -j ACCEPT
    After starting this script i am no longer able to login.
    Even running session are closed. (good to have a restore script
    in cron .)

    Can somebody help?

    How is this forum related to the above url?

  2. #2
    What kind of help do you need? Do you want to disable and boot or iptable configuration help?

  3. #3
    Moderator
    Good Guru
    Compunuts's Avatar
    Join Date
    May 2001
    Location
    California
    Posts
    3,935
    Not directly related to your problem but ....

    I quit using raw scripts and go with firestarter firewall. A lot easier and it's GUI.

    To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
    - The truely community run Linux/Floss forum !

    No IT BS !!

Similar Threads

  1. Simple Website Monitoring Script in Perl
    By tuxette in forum Linux - Software, Applications & Programming
    Replies: 2
    Last Post: 01-15-2009, 05:03 PM
  2. Simple Website Monitoring Script in Perl
    By peter in forum Tutorials
    Replies: 0
    Last Post: 11-24-2008, 04:59 AM
  3. Firewall script in RHEL 4
    By sud.tech in forum Programming
    Replies: 8
    Last Post: 06-12-2008, 01:07 PM
  4. Can Anyone Help With A Simple Script??
    By Gary Penner in forum Programming
    Replies: 1
    Last Post: 02-01-2005, 07:03 PM
  5. Apache Firewall Script
    By rhonneil in forum Programming
    Replies: 1
    Last Post: 11-12-2003, 03:59 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •