30 พ.ย. 2553

How can a user change their coova password ?

I downloaded PHP source code from Burapha University in Thailand.Then I have modified
it which can work with Coovachilli.Just copy in /var/www/hotspot/uam

download

27 พ.ย. 2553

Disable Cache in Squid 2.5

Add/modify squid.conf :

#no local caching
maximum_object_size 0 KB
minimum_object_size 0 KB

# specify uncachable requests
acl all src 0.0.0.0/0.0.0.0
no_cache deny all

or
# caches nothing based on time
acl Working time 08:00-16:00
no_cache deny Working


# avoid having a cache directory
cache_dir null /tmp
or
cache_dir null /null


http://www.nineteenlabs.com/2007/08/25/disable-cache-in-squid-25/

13 พ.ย. 2553

MIMO is the heart of 802.11n

To understand the improvement brought by MIMO technology, it is important to understand some of the basics that determine how well a traditional radio operates. In a traditional, single-input single-output radio, the amount of information that can be carried by a received radio signal depends on the amount by which the received signal strength exceeds the noise at the receiver, called the signal-to-noise ratio, or SNR. SNR is typically expressed in decibels (dB). The greater the SNR, the more information that can be carried on the signal and be recovered by the receiver.
To understand this situation, imagine the analogy of your eye as the receiver. Is your eye able to detect whether a table lamp is on or off in the house next door? In this analogy, ambient light is the noise. At night, detecting that the lamp is on or off is quite easy. However, in full daylight, it is much more difficult to make the same determination, because the ambient light is much brighter, and the tiny amount of additional light from the lamp can be undetectable.
Light, like a radio wave, disperses uniformly from its source. The farther the receiver is from the source, the less power is received from the source. In fact, the amount of power received decreases more rapidly than the square of the distance from the source. Noise, unfortunately, is often constant in the environment, due to both natural and man-made causes.
So, returning to the table lamp example, when it is too bright to determine if the lamp next door is on or off, it might be possible to make that determination from just outside the neighbor's window. Alternatively, it might be possible to make the determination if the neighbor changed the 40 watt bulb for a 150 watt bulb. In both cases, the SNR increases-in the first case, because the distance to the source is reduced, and in the second case, because the power of the transmitter is increased.
Once the minimum SNR is achieved to allow information to be exchanged at the desired rate, any additional SNR is like money in the bank. That additional SNR can be spent on increasing the information rate, increasing the distance, or a little bit of both. However, you can't spend the same dB more than once, just as you can't spend the same dollar more than once (at least not without encountering some unpleasant consequences).
All this is background to understand the improvements that MIMO technology brings to 802.11.
MIMO Technology: Beamforming

MIMO technology takes advantage of other techniques to improve the SNR at the receiver. One technique is transmit beamforming. When there is more than one transmit antenna, it is possible to coordinate the signal sent from each antenna so that the signal at the receiver is dramatically improved. This technique is generally used when the receiver has only a single antenna and when there are few obstructions or radio-reflective surfaces-for example, open storage yards.
To understand transmit beamforming, consider a radio signal as a wave shape, with a wave length that is specific to the frequency of the signal. When two radio signals are sent from different antennae, these signals are added together at the receiver's antenna (see Figure 1). Depending on the distance that each radio signal travels, they are very likely to arrive at the receiver out of phase with each other. This difference in phase at the receiver affects the overall signal strength of the received signal. By carefully adjusting the phase of the radio signals at the transmitter, the received signal can be maximized at the receiver, increasing SNR. This is what transmit beamforming does-it effectively focuses the transmitters on a single receiver, as shown in Figure 2.
Figure 1. Destructive Interference
Figure 2. Transmit Beanforming (Constructive Interference)

Transmit beamforming is not something that can easily be done at the transmitter without information from the receiver about the received signal. This feedback is available only from 802.11n devices, not from 802.11a, b, or g devices. To maximize the signal at the receiver, feedback from the receiver must be sent to the transmitter so that the transmitter can tune each signal it sends. This feedback is not immediate and is only valid for a short time. Any physical movement by the transmitter, receiver, or elements in the environment will quickly invalidate the parameters used for beamforming. The wave length for a 2.4-GHz radio is only 120mm, and only 55mm for 5-GHz radio. So, a normal walking pace of 1 meter per second will rapidly move the receiver out of the spot where the transmitter's beamforming efforts are most effective.
Transmit beamforming is useful only when transmitting to a single receiver. It is not possible to optimize the phase of the transmitted signals when sending broadcast or multicast transmissions. For this reason, in general networking applications, the utility of transmit beamforming is somewhat limited, providing improved SNR at the receiver for only those transmissions that are sent to that receiver alone. Transmit beamforming can increase the data rate available at greater distances from the AP. But, it does not increase the coverage area of an access point, since that is determined, in large part, by the ability to receive the beacons from the access point. Beacons are a broadcast transmission that does not benefit from transmit beamforming.
MIMO Technology: Multipath or Spatial Diversity

In typical indoor WLAN deployments-for example, offices, hospitals, and warehouses-the radio signal rarely takes the direct, shortest path from the transmitter to the receiver. This is because there is rarely "line of sight" between the transmitter and the receiver. Often there is a cube wall, door, or other structure that obscures the line of sight. All of these obstructions reduce the strength of the radio signal as it passes through them. Luckily, most of these environments are full of surfaces that reflect a radio signal as well as a mirror reflects light.
Imagine that all of the metallic surfaces, large and small, that are in an environment were actually mirrors. Nails and screws, door frames, ceiling suspension grids, and structural beams are all reflectors of radio signals. It would be possible to see the same WLAN access point in many of these mirrors simultaneously. Some of the images of the access point would be a direct reflection through a single mirror. Some images would be a reflection of a reflection. Still others would involve an even greater number of reflections. This phenomenon is called multipath (see Figure 3).
Figure 3. Multipath

When a signal travels over different paths to a single receiver, the time that the signal arrives at the receiver depends on the length of the path it traveled. The signal traveling the shortest path will arrive first, followed by copies or echoes of the signal slightly delayed by each of the longer paths that the copies traveled. When traveling at the speed of light, as radio signals do, the delays between the first signal to arrive and its copies is very small, only nanoseconds. (A rule of thumb for the distance covered at the speed of light is roughly one foot per one nanosecond.) This delay is enough to be able to cause significant degradation of the signal at a single antenna because all the copies interfere with the first signal to arrive.
A MIMO radio sends multiple radio signals at the same time and takes advantage of multipath. Each of these signals is called a spatial stream. Each spatial stream is sent from its own antenna, using its own transmitter. Because there is some space between each of these antennae, each signal follows a slightly different path to the receiver. This is called spatial diversity. Each radio can also send a different data stream from the other radios. The receiver has multiple antennas as well, each with its own radio. Each of the receive radios independently decode the arriving signals (see Figure 4.) Then, each radio's received signal is combined with the signals from the other receive radios. With a lot of complex math, the result is a much better receive signal than can be achieved with either a single antenna or even with transmit beamforming. One of the two significant benefits of MIMO is that it dramatically improves the SNR, providing more flexibility for the WLAN system designer.
Figure 4. Spatial Multiplexing


MIMO systems are described using the number of transmitters and receivers in the system-for example, 2x1 is "two by one," meaning two transmitters and one receiver. 802.11n defines a number of different combinations for the number of transmitters and the number of receivers, from 2x1, equivalent to transmit beamforming, to 4x4. Each additional transmitter or receiver in the system increases the SNR. However, the incremental gains from each additional transmitter or receiver diminish rapidly. The gain in SNR is large for each step from 2x1 to 2x2 and to 3x2, but the improvement with 3x3 and beyond is relatively small. The use of multiple transmitters provides the second significant benefit of MIMO, the ability to use each spatial stream to carry its own information, providing dramatically increased data rates.



http://www.cisco.com/en/US/prod/collateral/wireless/ps5678/ps6973/ps8382/prod_white_paper0900aecd806b8ce7_ns767_Networking_Solutions_White_Paper.html

Testing Access point router in the Real world

http://arstechnica.com/hardware/reviews/2007/11/802-11n-router-roundup.ars/3

11 พ.ย. 2553

I got the error after typing command "route -p add 10.0.0.0 mask 255.0.0.0 10.46.2.1"

I typed this command in Windows 7.
route -p add 10.0.0.0 mask 255.0.0.0 10.46.2.1

So I received the message this
The requested operation requires elevation.

Finally, I have known that I must run the Command Prompt with the administrator level By right-click the "Command Prompt" and choose to "Run as Administrator".

8 พ.ย. 2553

Password ของ Prestige 660R-T1

หลังจากที่ได้ Reset Router เปลี่ยนค่าเป็น factory default แล้ว
password จะถูกเปลี่ยนเป็น รหัสผ่านขั้นเทพ! ทันทีทันใด
username = Admin
password = ADSLmi^ZyXelP660RT1

3 พ.ย. 2553

How to configure CoovaChilli to support VLAN.

I got the new Switch Layer 3 and I want to setup Fresh Ubuntu on my old box .So I will be implement Coovachilli to support Vlans.

Requirement applications for Captive portal solution
Ubuntu Server 13.0
CoovaChilli 1.3.0

My scenario
-
------------------------------------------                           ╔╡192.168.10.0/24
------------------------------------------                           ╠╡192.168.20/24
[Router]192.168.1.1==192.168.1.3[Coova]==[Switch]==╬╡192.168.30/24
------------------------------------------                           ╚╡192.168.40/24


Configuration Procedure on Switch 3COM 4500 26 ports

# Create VLAN 10 for the marketing department and configure the IP address of VLAN-interface 10 as 192.168.10.40
system-view
[Sysname] vlan 10
[Sysname-vlan10] port Ethernet 1/0/1
[Sysname-vlan10] quit
[Sysname] interface Vlan-interface 10
[Sysname-Vlan-interface10] ip address 192.168.10.40 255.255.255.0
[Sysname-Vlan-interface10] quit

# Create VLAN 20 for the R&D department and configure the IP address of VLAN-interface 20 as 192.168.20.40
[Sysname] vlan 20
[Sysname-vlan20] port Ethernet 1/0/2
[Sysname-vlan20] quit
[Sysname] interface Vlan-interface 20
[Sysname-Vlan-interface20] ip address 192.168.20.40 255.255.255.0
[Sysname-Vlan-interface20] quit

# Create VLAN 30 for the administration department and configure the IP address of VLAN-interface 30 as 192.168.30.40
[Sysname] vlan 30
[Sysname-vlan30] port Ethernet 1/0/3
[Sysname-vlan30] quit
[Sysname] interface Vlan-interface 30
[Sysname-Vlan-interface30] ip address 192.168.30.40 255.255.255.0
[Sysname-Vlan-interface30] quit
# Create VLAN 40 for the Web cache server and configure the IP address of VLAN-interface 40 as 192.168.40.40
[Sysname] vlan 40
[Sysname-vlan40] port Ethernet 1/0/4
[Sysname-vlan40] quit
[Sysname] interface Vlan-interface 40
[Sysname-Vlan-interface40] ip address 192.168.40.40 255.255.255.0
[Sysname-Vlan-interface40] quit

[Sysname]interface GigabitEthernet 1/0/27
[Sysname-GigabitEthernet1/0/27]port link-type trunk
[Sysname-GigabitEthernet1/0/27]port trunk permit vlan all
[Sysname-GigabitEthernet1/0/27]undo shutdown

Plug the lan cable conectected with the internal interface of Coovachilli into port 27th

Install vlan support and create interface
apt-get install -y vlan
modprobe 8021q
echo "8021q" >> /etc/modules
vconfig add eth1 10
vconfig add eth1 20
vconfig add eth1 30
vconfig add eth1 40

Add vlan interface
nano /etc/network/interfaces

auto eth0
iface eth0 inet static
address 192.168.1.3
netmask 255.255.255.0
network 192.168.1.0
broadcast 10.10.10.255
gateway 192.168.1.1
# dns-* options are implemented by the resolvconf package, if installed
dns-nameservers 203.144.207.29
auto eth1

auto vlan40
iface vlan40 inet manual
vlan-raw-device eth1

auto vlan30
iface vlan20 inet manual
vlan-raw-device eth1

auto vlan20
iface vlan30 inet manual
vlan-raw-device eth1

auto vlan10
iface vlan10 inet manual
vlan-raw-device eth1


Build coova package
aptitude --assume-yes install dpkg-dev debhelper libssl-dev
cd /tmp
wget -c http://ap.coova.org/chilli/coova-chilli-1.3.0.tar.gz
tar xzf coova-chilli*.tar.gz
cd coova-chilli*
dpkg-buildpackage -rfakeroot

Install CoovaChilli:
cd ..
dpkg -i coova-chilli_*_i386.deb

Configure coova
cp etc/chilli/defaults /etc/chilli/config
nano /etc/chilli/config

HS_HS_RADSECRET=XXXX (Up to you)
HS_UAMSECRET=uamsecret
HS_UAMALLOW=www.coova.org,www.google.com,192.168.10.0/24
HS_UAMSERVER=192.168.10.1
HS_UAMFORMAT=https://\$HS_UAMSERVER/hotspot/uam/
HS_UAMSERVICE=https://
\$HS_UAMSERVER/cgi-bin/hotspotlogin.cgi

Create hotspot site for more detail you can sarch from my old article
mkdir /var/www/hotspot
cd /var/www/hotspot
cp /etc/chilli/www/* /var/www/hotspot
sed -i 's/1.0.0.1/10.1.1.1/g' /etc/chilli/www/ChilliLibrary.js
sed -i 's/1.0.0.1/10.1.1.1/g' /var/www/hotspot/ChilliLibrary.js

Configuration process
mkdir /etc/chilli/eth1.10
mkdir /etc/chilli/eth1.20
mkdir /etc/chilli/eth1.30
mkdir /etc/chilli/eth1.40

cp /etc/chilli/config /etc/chilli/eth1.10/config
cp /etc/chilli/config /etc/chilli/eth1.20/config
cp /etc/chilli/config /etc/chilli/eth1.30/config
cp /etc/chilli/config /etc/chilli/eth1.40/config

Edit value for vlan 10
nano /etc/chilli/eth1.10/config

# Settings only for eth1.10 network
HS_LANIF=vlan10
HS_NASID=nas-10
HS_NETWORK=10.10.1.0
HS_NETMASK=255.255.255.128
HS_UAMLISTEN=10.10.1.1
HS_UAMPORT=3100
HS_UAMUIPORT=4100
HS_UAMSERVER=10.10.1.1
HS_UAMFORMAT=https://\$HS_UAMSERVER/hotspot/uam/
HS_UAMHOMEPAGE=http://\$HS_UAMLISTEN:\$HS_UAMPORT/www/coova.html

nano /etc/chilli/eth1.10/chilli.conf

include /etc/chilli/eth1.10/main.conf
include /etc/chilli/eth1.10/hs.conf
include /etc/chilli/eth1.10/local.conf
ipup /etc/chilli/up.sh
ipdown /etc/chilli/down.sh

nano /etc/chilli/eth1.20/config

# Settings only for eth1.20 network
HS_LANIF=vlan20
HS_NASID=nas-20
HS_NETWORK=10.20.1.0
HS_NETMASK=255.255.255.128
HS_UAMLISTEN=10.20.1.1
HS_UAMPORT=3200
HS_UAMUIPORT=4200
HS_UAMSERVER=10.20.1.1
HS_UAMFORMAT=https://\$HS_UAMSERVER/hotspot/uam/
HS_UAMHOMEPAGE=http://\$HS_UAMLISTEN:\$HS_UAMPORT/www/coova.html


nano /etc/chilli/eth1.20/chilli.conf

include /etc/chilli/eth1.20/main.conf
include /etc/chilli/eth1.20/hs.conf
include /etc/chilli/eth1.20/local.conf
ipup /etc/chilli/up.sh
ipdown /etc/chilli/down.sh


nano /etc/chilli/eth1.30/config

# Settings only for eth1.30 network
HS_LANIF=vlan30
HS_NASID=nas-30
HS_NETWORK=10.3.3.0
HS_NETMASK=255.255.255.128
HS_UAMLISTEN=10.3.3.1
HS_UAMPORT=3300
HS_UAMUIPORT=4300
HS_UAMSERVER=10.3.3.1
HS_UAMFORMAT=https://\$HS_UAMSERVER/hotspot/uam/
HS_UAMHOMEPAGE=http://\$HS_UAMLISTEN:\$HS_UAMPORT/www/coova.html

Create inclouding file of Vlan 30
nano /etc/chilli/eth1.30/chilli.conf

include /etc/chilli/eth1.30/main.conf
include /etc/chilli/eth1.30/hs.conf
include /etc/chilli/eth1.30/local.conf
ipup /etc/chilli/up.sh
ipdown /etc/chilli/down.sh

Configure Vlan 40
nano /etc/chilli/eth1.40/config

# Settings only for eth1.40 network
HS_LANIF=vlan40
HS_NASID=nas-40
HS_NETWORK=10.40.1.0
HS_NETMASK=255.255.255.128
HS_UAMLISTEN=10.40.1.1
HS_UAMPORT=3400
HS_UAMUIPORT=4400
HS_UAMSERVER=10.40.1.1
HS_UAMFORMAT=https://\$HS_UAMSERVER/hotspot/uam/
HS_UAMHOMEPAGE=http://\$HS_UAMLISTEN:\$HS_UAMPORT/www/coova.html


Create inclouding file
nano /etc/chilli/eth1.40/chilli.conf

include /etc/chilli/eth1.40/main.conf
include /etc/chilli/eth1.40/hs.conf
include /etc/chilli/eth1.40/local.conf
ipup /etc/chilli/up.sh
ipdown /etc/chilli/down.sh

If you got the message"[error] [client 10.4.4.31] Invalid method in request \x16\x03\x01 " in apache log, try to input this command.
sudo ln -s /etc/apache2/sites-available/default-ssl /etc/apache2/sites-enabled/000-default-ssl
sudo /etc/init.d/apache2 restart


Finally, This is my configuration Coova file.
=========================================

HS_LANIF=vlan20 # Subscriber Interface for client devices
HS_NETWORK=192.168.20.0 # HotSpot Network (must include HS_UAMLISTEN)
HS_NETMASK=255.255.255.0 # HotSpot Network Netmask
HS_UAMLISTEN=192.168.20.1 # HotSpot IP Address (on subscriber network)
HS_UAMPORT=3200 # HotSpot UAM Port (on subscriber network)
HS_UAMUIPORT=4200 # HotSpot UAM "UI" Port (on subscriber network, for embedded portal)

HS_DYNIP=192.168.20.130
HS_DYNIP_MASK=255.255.255.0
HS_STATIP=192.168.20.3
HS_STATIP_MASK=255.255.255.0
# HS_DNS_DOMAIN=192.168.20.101

# OpenDNS Servers
HS_DNS1=192.168.20.1
HS_DNS2=192.168.20.102

HS_NASID=nas-20
HS_RADIUS=localhost
HS_RADIUS2=localhost
HS_UAMALLOW=192.168.20.0/24,192.168.0.0/24,10.10.10.0/27
HS_RADSECRET=Chitlada # Set to be your RADIUS shared secret
HS_UAMSECRET=Luamsecret # Set to be your UAM secret
HS_UAMALIASNAME=chilli

HS_UAMSERVER=192.168.20.1

HS_UAMFORMAT=https://\$HS_UAMSERVER/hotspot/uam/

HS_UAMHOMEPAGE=http://\$HS_UAMLISTEN:\$HS_UAMPORT/www/coova.html


HS_MODE=hotspot
HS_TYPE=chillispot
HS_WWWDIR=/etc/chilli/www

HS_WWWBIN=/etc/chilli/wwwsh

HS_PROVIDER=Coova
HS_PROVIDER_LINK=http://www.coova.org/

HS_LOC_NAME="My HotSpot"
=========== End of file ================


Reference
http://ubuntuforums.org/showthread.php?t=703387
http://www.sptc.ac.th/webboard/viewtopic.php?f=5&t=4

Upgrade Ubuntu from 10.04 to 10.10 From command line

Believe it or not, upgrading from command line is just as easy as it is from the GUI tool. The first step is to update your system. So open up a terminal window and issue this command:
sudo apt-get update

The first step is to issue the following command:
sudo apt-get install update-manager-core

nano /etc/update-manager/release-upgrades

This file determines the default behavior for the release upgrader. The line you need to change is at the bottom of this file. Change it from:

Prompt=lts

to

Prompt=normal

Save and close that file and then issue the command:

sudo do-release-upgrade -d

ที่มา http://www.ghacks.net/2010/09/28/upgrade-ubuntu-from-10-04-to-10-10/

2 พ.ย. 2553

ร่วมกันสร้างบุญบารมีคับ

วันที่ 2 พย. 2553 ที่หมู่บ้านขันหอม จังหวัดเชียงราย มีอุณหภมิ 12 องศา ผมคิดว่าปีนี้น่าจะเป็นปีที่หนาวเหน็บ เพราะผมเคยได้ยินมาว่า ปีไหนที่มีน้ำท่วมมาก ปีนั้นจะหนาวมาก
โดยเฉพาะปีนี้ที่หมู่บ้านขันหอม(หมู่บ้านของผมเอง) น้ำท่วมทั้งหมู่บ้าน และได้รับความช่วยเหลือจากมูลนิธิอาสาเพื่อนพึ่งภาฯยามยากเข้ามาแจกถุงยังชีพ
 
2-3 วันมานี้ที่กรุงเทพฯมีอากาศเย็นลง ผมกลับคิดถึงพ่อแม่ ผมโทรถามแม่ว่าหนาวมากไหม แม่บอกว่าหนาวเย็นทั้งวันเลย แล้วผมก็คิดถึงพระที่อยู่ที่วัด ท่านไม่ได้มีเสื้อกันหนาวเหมือนเรา แล้วจะมีใครไหมที่จะถวายผ้าอังสะกันหนาว และเมื่อปีที่แล้วแม่ของผมกับป้าแดงได้ร่วมกันถวายผ้าอังสะไหมพรม (โดยที่แม่ผมเป็นคนซื้อด้ายไหมพรม ส่วนป้าแดงเป็นคนถัก ปีที่แล้วถักได้ 26 ตัว) แม่เลือกถวายกับพระที่จำพรรษานานๆ ส่วนพระท่านที่บวชแป๊บๆไม่ได้ถวาย ส่วนปีนี้ผมอยากให้ เพื่อนๆ และพี่ๆ ได้ร่วมสร้างบุญบารมีกันครับ ทางแม่ผมได้ประเมินดูแล้วว่าควรจัดทำ อังสะสีกรัก 10 ผืน เพื่อถวายพระที่ยังไม่มี และถวายพระรูปที่มีแล้วเผื่อจะได้สลับสับเปลี่ยนได้
วัดที่จะนำผ้าอังสะกันหนาวไปถวายคือ วัดพระยอดขุนพลเวียงกาหลง ซึ่งเป็นวัดที่ผมเคยบวชพระที่นี้ และอยู่ใกล้บ้าน http://www.wiengkalong.com/
วิธีการมีดังนี้
โอนค่าด้ายไหมพรมมาที่ผม และผมก็จะรวบรวมส่งให้ป้าแดง ราคาด้ายชุดละ 250 บาท ด้าย 1 ชุดจะถักได้ผ้าอังสะกันหนาวอย่างหนา เพราะใช้ด้าย 2 เส้น และหมวก 1 ใบ พอป้าแดงถักเสร็จ ทางแม่ของผมจะนำมาซักและรีดให้เรียบร้อย ก่อนที่จะนำไปถวายต่อไป
ญาติธรรมท่านใดปราถนาร่วมสร้างบุญ สามารถโอนมาที่ บัญชี ณัฐตรัณ อนุศาสตร์ ธนาคารกรุงเทพ สาขาบางโพ เลขที่ 1600749475  หรือโทรได้ที่ 085-0349062 ได้ตลอดเวลาครับ