Shell Script to Start and Login via Netgear WG311 Marvell 88w8335 Wireless Card

by on April 24, 2008 · 0 comments

See how to configure - Linux Install and Configure Netgear WG311 Marvell 88w8335 Rev 03 Chipset Wireless Card

#!/bin/bash
# Shell Script to Start and Login via Netgear WG311 Marvell 88w8335 Wireless Card
# -------------------------------------------------------------------------
# See URL for usage information:
#http://www.cyberciti.biz/faq/marvell-88w8335-chipset-netgear-wg311-pcicard-driver/
# -------------------------------------------------------------------------
# Copyright (c) 2008 nixCraft project <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.
# -------------------------------------------------------------------------
INTERNET_IFACE="wlan0"
 
echo "Starting Wireless ${INTERNET_IFACE}..."
wpa_supplicant -B -c/etc/wpa_supplicant.conf -iwlan0
sleep 15
 
echo "Getting IP address..."
dhclient $INTERNET_IFACE
 
echo "Starting Firewall Setup..."
# 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
 
#unlimited
iptables -A INPUT -i lo -j ACCEPT
iptables -A OUTPUT -o lo -j ACCEPT
 
# DROP all incomming traffic
iptables -P INPUT DROP
iptables -P OUTPUT DROP
iptables -P FORWARD DROP
 
# Allow full outgoing connection but no incomming stuff
iptables -A INPUT -i ${INTERNET_IFACE} -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -A OUTPUT -o ${INTERNET_IFACE} -m state --state NEW,ESTABLISHED,RELATED -j ACCEPT
 
# Allow bittorent
# iptables -A INPUT -i ${INTERNET_IFACE} -p tcp  --destination-port 6881:6999 -j ACCEPT
 
# log everything else
iptables -A INPUT -j LOG
iptables -A INPUT -j DROP
4000+ howtos and counting! If you enjoyed this article, join 45000+ others and get free email updates!

{ 0 comments… add one now }

Leave a Comment

You can use these HTML tags and attributes for UNIX commands or shell scripts: <strong> <em> <ol> <li> <u> <ul> <blockquote> <pre> <a href="" title="">
What is 9 + 8 ?
Please leave these two fields as-is:
Are you a human being? Solve the simple math so we know that you are a human and not a script.



Tagged as: /etc/wpa_supplicant.conf, bash shell script, iface, iptables, modprobe command, netgear wg311, port 6881, script collection, sleep command, tcp, wireless internet, wpa supplicant, wpa_supplicant command

Previous Script:

Next Script: