Multiple SSID on OpenWRT with bandwidth limit


If you’re a network junkie and not been living under the rocks, you must have heard of OpenWRT. It’s a Linux distribution for embedded devices (routers) and gives you power to do things usually impossible or difficult with inbuilt router firmware. Wireless Freedom indeed.

This was my scenario: I had to create two wireless APs, one for the guests (no password but bandwidth limited) and another for myself (password protected but no limit on bandwidth). That way the visitors will have free wireless internet, but with limited bandwidth. The office staffs will have to connect to a password protected wifi for unrestricted bandwidth.

The requirements for the APs are,

Free Wifi for visitors
– SSID: ShadhinFree
– Password: none
– Bandwidth limit: 256Kbps uplink, 128Kbps downlink

For myself
– SSID: Shadhin
– Password: 1234567890
– Encryption: WPA2
– Bandwidth limit: none

Here’s how I did it on OpenWRT. Connect to OpenWRT shell.

1. First create two wireless APs with above configuration. Add the following lines to /etc/config/wireless (Remove any existing ‘wifi-iface’ configurations)
#myfi

config wifi-iface
option device ‘radio0’
option network ‘lan’
option mode ‘ap’
option ssid ‘7uxBo7’
option key ‘tuxfi123’
option encryption ‘psk2’

#free

config wifi-iface
option device ‘radio0’
option network ‘lan’
option mode ‘ap’
option ssid ‘7uxBo7-free’
option key ‘457tththgh’
option encryption ‘none’

As simple as that! Now to enable the wifi, go to shell and 

# wifi down; wifi up

2. Now to limit bandwidth, we’ll be using wondershaper. To install:

# opkg update
# opkg install wshaper


3. Now find which interface is the FreeWifi assigned to

# iwconfig

On mine, it was on wlan0

4. Modify /etc/config/wshaper and start wondershaper

config 'wshaper' 'settings'
option 'network' 'wlan0-1'
option 'downlink' '256'
option 'uplink' '128'


Now, start wondershaper.

# /etc/init.d/wshaper start

5. By default, wshaper isnt enabled at startup. so,

# ln -s /etc/init.d/wshaper /etc/rc.d/S99wshaper

Advertisements

Skype 4.2 audio problem on ubuntu 13.10


After upgrading my Ubuntu 13.10 Skype don’t capture my audio input. here is the error

ALSA lib conf.c:4694:(snd_config_expand) Unknown parameters CARD=MID
ALSA lib control.c:953:(snd_ctl_open_noupdate) Invalid CTL default:CARD=MID

Solution:

Installing ‘libasound2-plugins:i386’

sudo apt-get install libasound2-plugins:i386

Some ideas presented here: http://community.skype.com/t5/Mac/Debian-7-0-Skype-crashed-when-making-call/td-p/1371149

 

Install conky & conky theme seamod-mix on linux


Conky is a free software system monitor for the X Window System. It is available for Linux, FreeBSD, and OpenBSD.Conky is highly configurable and is able to monitor many system variables including the status of the CPU, memory, swap space, disk storage, temperatures, processes, network interfaces, battery power, system messages etc.

Install conky on Linux machine:

For ubuntu,mint,debian:
using apt-get or the Synaptic GUI.

sudo apt-get install conky-all

For fedora,opensuse,centos etc rpm base:

sudo yum install conky-all

For ArchLinux:

pacman conky-all

Now install conky theme seamod-mix.But to get all things work we need to install couple more packages(lm-sensors,hddtemp,dmidecode). you can install it via your package manager. OR visit below links.

lm-sensors

hddtemp

dmidecode

After installing above packages you need to change permission of following packages

sudo chmod u+s /usr/sbin/hddtemp
sudo chmod u+s /usr/sbin/dmidecode

*other wise hdd temperature & main board info & temperature won’t work.

Now for pretty look we need to install 2 fonts STYLBCC.ttf and Poky.ttf. if don’t know how to install it,then follow this link.

Now go to http://weather.yahoo.com and search you city
you will get a zip code of your city like ‘1915035’ into urls.
Now copy the zip code and open ‘weather’ file from downloads.
file the line ‘http://xml.weather.yahoo.com/forecastrss?w=1915035&u=c’
replace code numbers with yours & save the file.

Then open conky-startup.sh file and replace below line with ur conky files location

cd “/home/penguin/mybin/conky”

save the file.now add the ‘xxx.sh’ to start up application.

Enjoy 🙂

Screenshot from 2014-01-03 00:33:55

conky-seamod-mix theme download link: here

Get your computer hardware information in UNIX like systems(nix*)


Dmidecode reports information about your system’s hardware as described in your system BIOS according to the SMBIOS/DMI standard (see a sample output). This information typically includes system manufacturer, model name, serial number, BIOS version, asset tag as well as a lot of other details of varying level of interest and reliability depending on the manufacturer. This will often include usage status for the CPU sockets, expansion slots (e.g. AGP, PCI, ISA) and memory module slots, and the list of I/O ports (e.g. serial, parallel, USB).

Supported OS:

  • Linux i386, x86-64, ia64
  • FreeBSD i386, amd64
  • NetBSD i386, amd64
  • OpenBSD i386, amd64
  • BeOS i386
  • Cygwin i386
  • Solaris x86
  • Haiku i586

Install it with your package manager base on your OS. here i’m mention on ubuntu

$sudo apt-get install dmidecode

run it

$dmidecode

Screenshot from 2014-01-04 00:56:46

Install and configure lm-sensors on Linux


What is lm-sensors?
lm_sensors (Linux-monitoring sensors), is a free open source software-tool for Linux that provides tools and drivers for monitoring temperatures, voltage, humidity and fans.[more]

Install lm-sensors on Linux machine:

For ubuntu,mint,debian:
using apt-get or the Synaptic GUI.

sudo apt-get install lm-sensors

For fedora,opensuse,centos etc rpm base:

sudo yum install lm-sensors

For ArchLinux:

pacman lm_sensors

Configure lm-sensors: run below command on terminal and answer all questions ‘yes’ including last one.

sensors-detect

Lm-sensors

Now start the service

service kmod start

run the sensors to get desire output

sensors

Screenshot from 2014-01-03 23:37:41

if you want to view the result on GUI then install “Psensor’ on Ubuntu.
Enjoy:)