Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

As promised to Fuller` on irc.

  • 23-10-2002 4:06pm
    #1
    Closed Accounts Posts: 5,564 ✭✭✭


    rc.local
    #bin/sh
    #
    # /etc/rc.d/rc.local: Local system initialization script.
    #
    # Put any local setup commands in here:
    echo 1 > /proc/sys/net/ipv4/ip_forward
    echo "Enabeling Network Address Translation and Firewall rules resistance is futile!"
    iptables -F
    ##nuke that syn flood
    iptables -N syn-flood
    iptables -A INPUT -s ! 10.0.0.0/24 -p tcp --syn -j syn-flood
    iptables -A syn-flood -m limit --limit 1/s --limit-burst 4 -j RETURN
    iptables -A syn-flood -j DROP #nuke any tcp connection that is not a syn
    iptables -A INPUT -s ! 10.0.0.0/24 -p tcp ! --syn -m state --state NEW -j DROP #samba are you in the KBS domin ? if not get lost you can't have netbios
    iptables -A INPUT -s ! 10.0.0.0/24 -p tcp --dport 139 -m state --state NEW -j DROP
    iptables -A INPUT -s ! 10.0.0.0/24 -p tcp --dport 139 -m state --state ESTABLISHED -j ACCEPT
    iptables -A INPUT -s 10.0.0.0/24 -d ! 10.0.0.0/24 -p tcp --dport 139 -m state --state NEW,ESTABLISHED -j ACCEPT
    #http
    iptables -t nat -A PREROUTING -s ! 10.0.0.0/24 -p tcp --dport 80 -j DNAT --to 10.0.0.2:80
    iptables -A FORWARD -s ! 10.0.0.0/24 -p tcp --dport 80 -j ACCEPT
    iptables -A INPUT -s ! 10.0.0.0/24 -p tcp --dport 80 -m state --state NEW,ESTABLISHED -j ACCEPT
    iptables -A INPUT -s 10.0.0.0/24 -d ! 10.0.0.0/24 -p tcp --dport 80 -m state --state NEW,ESTABLISHED -j ACCEPT
    #ftp
    iptables -t filter -A INPUT -s ! 10.0.0.0/24 -p tcp --dport 21 -m state --state ESTABLISHED -j ACCEPT
    iptables -A INPUT -s 10.0.0.0/24 -d ! 10.0.0.0/24 -p tcp --dport 80 -m state --state NEW,ESTABLISHED -j ACCEPT
    #irc
    iptables -A INPUT -s ! 10.0.0.0/24 -p tcp --dport 194 -m state --state ESTABLISHED -j ACCEPT
    iptables -A INPUT -s 10.0.0.0/24 -d ! 10.0.0.0/24 -p tcp --dport 194 -m state --state NEW,ESTABLISHED -j ACCEPT
    #allow dns
    iptables -A INPUT -s ! 10.0.0.0/24 -p udp --dport 53 -m state --state ESTABLISHED -j ACCEPT
    iptables -A INPUT -s 10.0.0.0/24 -d ! 10.0.0.0/24 -p udp --dport 53 -m state --state NEW,ESTABLISHED -j ACCEPT
    #outgoing ssh
    iptables -A INPUT -s ! 10.0.0.0/24 -p tcp --dport 22 -m state --state ESTABLISHED -j ACCEPT
    iptables -A INPUT -s 10.0.0.0/24 -d ! 10.0.0.0/24 -p tcp --dport 22 -m state --state NEW,ESTABLISHED -j ACCEPT
    #telnet out
    iptables -A INPUT -s ! 10.0.0.0/24 -p tcp --dport 23 -m state --state ESTABLISHED -j ACCEPT
    iptables -A INPUT -s 10.0.0.0/24 -d ! 10.0.0.0/24 -p tcp --dport 23 -m state --state NEW,ESTABLISHED -j ACCEPT
    #smtp
    iptables -A INPUT -s ! 10.0.0.0/24 -p tcp --dport 25 -m state --state NEW,ESTABLISHED -j ACCEPT
    iptables -A INPUT -s 10.0.0.0/24 -d ! 10.0.0.0/24 -p tcp --dport 25 -m state --state NEW,ESTABLISHED -j ACCEPT
    #nameserver out
    iptables -t filter -A INPUT -s ! 10.0.0.0/24 -p tcp --dport 42 -m state --state ESTABLISHED -j ACCEPT
    iptables -A INPUT -s 10.0.0.0/24 -d ! 10.0.0.0/24 -p tcp --dport 42 -m state --state NEW,ESTABLISHED -j ACCEPT
    #rsync out
    iptables -A INPUT -s ! 10.0.0.0/24 -p tcp --dport 873 -m state --state ESTABLISHED -j ACCEPT
    iptables -A INPUT -s 10.0.0.0/24 -d ! 10.0.0.0/24 -p tcp --dport 873 -m state --state NEW,ESTABLISHED -j ACCEPT
    #irc
    iptables -A INPUT -s ! 10.0.0.0/24 -p tcp --dport 6667 -m state --state ESTABLISHED -j ACCEPT
    iptables -A INPUT -s 10.0.0.0/24 -d ! 10.0.0.0/24 -p tcp --dport 6667 -m state --state NEW,ESTABLISHED -j ACCEPT
    #masquerading
    iptables -t nat -A POSTROUTING -s 10.0.0.0/24 -d ! 10.0.0.0/24 -j MASQUERADE
    iptables -t nat -A POSTROUTING -s 10.0.0.0/24 -d 10.0.0.0/24 -j ACCEPT
    iptables -A INPUT -s ! 10.0.0.0/24 -d 10.0.0.0/24 -p icmp -j LOG
    #icmp
    iptables -A INPUT -s ! 10.0.0.0/24 -d 10.0.0.0/24 -p icmp -m state --state ESTABLISHED -j ACCEPT
    iptables -A INPUT -p icmp -s 10.0.0.0/24 -d ! 10.0.0.0/24 -m state --state NEW,ESTABLISHED -j ACCEPT
    #drop assholes drop and swivel on it
    #iptables -A INPUT -p tcp -s ! 10.0.0.0/24 -m state --state NEW -j LOG
    iptables -A INPUT -p tcp -s ! 10.0.0.0/24 -m state --state NEW -j DROP
    #iptables -A INPUT -p udp -s ! 10.0.0.0/24 -m state --state NEW -j LOG
    iptables -A INPUT -p udp -s ! 10.0.0.0/24 -m state --state NEW -j DROP
    #iptables -A INPUT -p icmp -s ! 10.0.0.0/24 -m state --state NEW -j LOG
    iptables -A INPUT -p icmp -s ! 10.0.0.0/24 -m state --state NEW -j DROP

    echo "Starting Samba"
    /usr/sbin/smbd
    /usr/sbin/nmbd
    echo "Starting Postfix mail relay"
    postfix start
    echo "Bringing up ADSL connection now fear the Penguin lusers !"
    adsl-start
    echo "Starting Squid Unix Proxy Server"
    /usr/local/squid/bin/squid -s


Comments

Advertisement