Shell Script to start DLink PCL wireless lan card 520 / 510

#!/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:
# https://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
Get the latest tutorials on SysAdmin, Linux/Unix, Open Source, and DevOps topics:
Category List of Unix and Linux commands
File Management cat
Firewall Alpine Awall CentOS 8 OpenSUSE RHEL 8 Ubuntu 16.04 Ubuntu 18.04 Ubuntu 20.04
Network Utilities dig host ip nmap
OpenVPN CentOS 7 CentOS 8 Debian 10 Debian 8/9 Ubuntu 18.04 Ubuntu 20.04
Package Manager apk apt
Processes Management bg chroot cron disown fg jobs killall kill pidof pstree pwdx time
Searching grep whereis which
User Information groups id lastcomm last lid/libuser-lid logname members users whoami who w
WireGuard VPN Alpine CentOS 8 Debian 10 Firewall Ubuntu 20.04
0 comments… add one

Leave a Reply

Your email address will not be published. Required fields are marked *

Use HTML <pre>...</pre>, <code>...</code> and <kbd>...</kbd> for code samples.