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

  1. #!/bin/bash
  2. # Shell Script to Start and Login via Netgear WG311 Marvell 88w8335 Wireless Card
  3. # -------------------------------------------------------------------------
  4. # See URL for usage information:
  5. #http://www.cyberciti.biz/faq/marvell-88w8335-chipset-netgear-wg311-pcicard-driver/
  6. # -------------------------------------------------------------------------
  7. # Copyright (c) 2008 nixCraft project <http://cyberciti.biz/fb/>
  8. # This script is licensed under GNU GPL version 2.0 or above
  9. # -------------------------------------------------------------------------
  10. # This script is part of nixCraft shell script collection (NSSC)
  11. # Visit http://bash.cyberciti.biz/ for more information.
  12. # -------------------------------------------------------------------------
  13. INTERNET_IFACE="wlan0"
  14.  
  15. echo "Starting Wireless ${INTERNET_IFACE}..."
  16. wpa_supplicant -B -c/etc/wpa_supplicant.conf -iwlan0
  17. sleep 15
  18.  
  19. echo "Getting IP address..."
  20. dhclient $INTERNET_IFACE
  21.  
  22.  
  23. echo "Starting Firewall Setup..."
  24. # Firewall
  25. iptables -F
  26. iptables -X
  27. iptables -t nat -F
  28. iptables -t nat -X
  29. iptables -t mangle -F
  30. iptables -t mangle -X
  31. modprobe ip_conntrack
  32. modprobe ip_conntrack_ftp
  33.  
  34. #unlimited
  35. iptables -A INPUT -i lo -j ACCEPT
  36. iptables -A OUTPUT -o lo -j ACCEPT
  37.  
  38. # DROP all incomming traffic
  39. iptables -P INPUT DROP
  40. iptables -P OUTPUT DROP
  41. iptables -P FORWARD DROP
  42.  
  43. # Allow full outgoing connection but no incomming stuff
  44. iptables -A INPUT -i ${INTERNET_IFACE} -m state --state ESTABLISHED,RELATED -j ACCEPT
  45. iptables -A OUTPUT -o ${INTERNET_IFACE} -m state --state NEW,ESTABLISHED,RELATED -j ACCEPT
  46.  
  47. # Allow bittorent
  48. # iptables -A INPUT -i ${INTERNET_IFACE} -p tcp --destination-port 6881:6999 -j ACCEPT
  49.  
  50. # log everything else
  51. iptables -A INPUT -j LOG
  52. iptables -A INPUT -j DROP


4000+ howtos and counting! If you enjoyed this article, join 45000+ others and get free email updates!

Click here to subscribe via email.

Previous Script:

Next Script: