Results 1 to 4 of 4

Thread: howto start/stop/restart post-firewall

  1. #1

    howto start/stop/restart post-firewall

    Hi all,

    I've got Oleg's firmware running on a wl500gp2 with the help of wengi's tutorial. it's working great but my problem is that l am constantly getting port scanned. what l want is to be able to quickly add an ip (ban it) to the post-firewall file which is running on iptables and to restart it, so the new ban rule would take place immediately. unfortunately, l found no way to restart the firewall other than to reboot the whole router, which isn't really working for me.
    can anybody help please?

    ps: l know that iptables running as a service can be restarted with
    service iptables restart
    on some linux distros, but l can't do it on this one.

  2. #2
    Join Date
    Feb 2005
    Location
    Germany - Frankfurt
    Posts
    1,548
    Übersicht aller HowTos --- HowTo Overview (mostly german)
    WL-HDD mit diesem Setup. --- WL-HDD with this setup.
    Kein Support per PM - Frage im jeweiligen Thread! --- No support via pm - ask in the according thread!
    Eine wirklich gute Idee erkennt man daran, dass ihre Verwirklichung von vorne herein ausgeschlossen erscheint. (Albert Einstein)

  3. #3
    thank you wengi, once again. I've got some more questions which l'll post there.

  4. #4
    Join Date
    Feb 2007
    Location
    Moscow, Russia
    Posts
    3,805
    I use the following script to restart the firewall after changes in post-firewall:

    PHP Code:
    #! /bin/sh

    PATH=/usr/local/bin:/opt/local/bin:/opt/sbin:/opt/bin:/sbin:/bin:/usr/sbin:/usr/bin

    logger 
    -t iptables-restart Restarting firewall.

    logger -t iptables Setting default policies
    # chain policies
    # drop everything and open stuff as necessary
    iptables -P INPUT DROP
    iptables 
    -P FORWARD DROP
    iptables 
    -P OUTPUT DROP

    logger 
    -t iptables Flushing tables
    iptables 
    -F
    iptables 
    -F INPUT
    iptables 
    -F OUTPUT
    iptables 
    -F FORWARD
    iptables 
    --t mangle
    iptables 
    --t nat
    iptables 
    -X
    iptables 
    -Z

    WANIF
    =ppp0
    LANIF
    =br0
    MANIF
    =vlan1
    WANIP
    =`ifconfig "${WANIF}" | awk -F ":" '/inet addr/{print $2}' | awk '{print $1}'`
    LANIP=`ifconfig "${LANIF}" | awk -F ":" '/inet addr/{print $2}' | awk '{print $1}'`
    MANIP=`ifconfig "${MANIF}" | awk -F ":" '/inet addr/{print $2}' | awk '{print $1}'`

    cat /tmp/filter_rules iptables-restore
    cat 
    /tmp/nat_rules iptables-restore

    /usr/local/sbin/post-firewall ${WANIF} ${WANIP} ${LANIF} ${LANIP} ${MANIF} ${MANIP

Similar Threads

  1. Post your startup/shutdown files here!
    By wirespot in forum WL-500gP Tutorials
    Replies: 3
    Last Post: 10-12-2010, 23:49
  2. Secure settings (firewall, iptables and vsftpd)
    By absolon in forum WL-500gP Q&A
    Replies: 1
    Last Post: 04-08-2008, 17:54
  3. Replies: 0
    Last Post: 25-10-2007, 21:59
  4. Post lost?
    By ikerstges in forum WL-500g Q&A
    Replies: 3
    Last Post: 15-02-2006, 12:41

Posting Permissions

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