#!/bin/sh # Script to start DLink PCL wireless lan card 520 # ---------------------------------------------------------------- # Copyright (c) 2006 nixCraft <http://cyberciti.biz/fb/> # This script is licensed under GNU GPL version 2.0 or above # ------------------------------------------------------------------------- # This script is part of nixCraft shell script collection (NSSC) # Visit http://bash.cyberciti.biz/ for more information. # See url for more info: # http://www.cyberciti.biz/tips/linux-install-and-configure-dlink-dwl-g-520-wireless-lan-pci-card.html # ------------------------------------------------------------------------- # assing values # use 'iwlist ra0 scanning' command to get values SSID=nixcraft TYPE=Managed CHANNEL=6 KEY="your-key" INET=ra0 IWC="/sbin/iwconfig" # ok config ra0 $IWC $INET essid $SSID $IWC $INET mode $TYPE $IWC $INET channel $CHANNEL $IWC $INET key $KEY # firewall iptables -F iptables -X iptables -t nat -F iptables -t nat -X iptables -t mangle -F iptables -t mangle -X modprobe ip_conntrack modprobe ip_conntrack_ftp # Setting default filter policy iptables -P INPUT DROP iptables -P OUTPUT ACCEPT # Unlimited access to loop back iptables -A INPUT -i lo -j ACCEPT iptables -A OUTPUT -o lo -j ACCEPT # Allow UDP, DNS and Passive FTP iptables -A INPUT -i $INET -m state --state ESTABLISHED,RELATED -j ACCEPT #allow bittorent incomming client request :) iptables -A INPUT -p tcp --destination-port 6881:6882 -j ACCEPT #Uncomment below to allow sshd incoming client request #iptables -A INPUT -p tcp --destination-port 22 -j ACCEPT # DROP everything and Log it iptables -A INPUT -j LOG iptables -A INPUT -j DROP
Featured Articles:
- 20 Linux System Monitoring Tools Every SysAdmin Should Know
- 20 Linux Server Hardening Security Tips
- 10 Greatest Open Source Software Of 2009
- My 10 UNIX Command Line Mistakes
- Top 5 Email Client For Linux, Mac OS X, and Windows Users
- Top 20 OpenSSH Server Best Security Practices
- Top 10 Open Source Web-Based Project Management Software
- Top 5 Linux Video Editor Software
Want to read Linux tips and tricks, but don't have time to check our blog everyday? Subscribe to our email newsletter to make sure you don't miss a single tip/tricks.
- Download Script
- Email this to a friend
- Rss Feed
- Last Updated: 04/10/08