Minggu, 12 September 2021

EasyHotspot OpenWrt Bagian 4 - Konfigurasi Coova-Chilli

 Lanjutan EasyHotspot OpenWrt Bagian 3 - Konfigurasi HostNames-Radius

Lakukan urutan langkahnya sebagai berikut :

1. Konfigurasi Coova-chilli

- Masuk ke folder /etc/chilli , melalui "WinScp"

- Edit bagian dibawah ini, di dalam file /etc/chilli/wwwsh , menggunakan "WinScp"

------------------------------------------------------------------------------------

haserl=/usr/bin/haserl

------------------------------------------------------------------------------------

lalu "save" dan tutup

- Edit bagian dibawah ini, di dalam file /etc/chilli/defaults , menggunakan "WinScp"

------------------------------------------------------------------------------------

HS_NASID=nas01

HS_RADIUS=www.awanggacomp.net

HS_RADIUS2=www.awanggacomp.net

#HS_RADIUS=70.70.70.1

#HS_RADIUS2=70.70.70.1

HS_UAMALLOW=www.coova.org

HS_RADSECRET=easyhotspot

HS_UAMSECRET=easyhotspot

------------------------------------------------------------------------------------

lalu "save" dan tutup

tekan tombol "Shift+F4" , masukkan "local.conf", kemudian "Enter"

masukkan baris berikut

-------------------------------------------------------------------------------------

# auto config

-------------------------------------------------------------------------------------

lalu "save" dan tutup

tekan tombol "Shift+F4" , masukkan "main.conf", kemudian "Enter"

masukkan baris berikut

-------------------------------------------------------------------------------------

# THIS FILE IS AUTOMATICALLY GENERATED

cmdsocket       /var/run/chilli.br-lan.sock

unixipc         chilli.br-lan.ipc

pidfile         /var/run/chilli.br-lan.pid

net        10.1.0.0/255.255.255.0

uamlisten    10.1.0.1

uamport         3990

dhcpif        br-lan

uamallowed    "www.coova.org,10.1.0.1,70.70.70.1,70.70.70.236,facebook.com"

macallowed "xx-xx-xx-xx-xx-xx" # < mac addres LAN yg terhubung dengan router

uamanydns

domain "lan"

dns1 "208.67.222.222"

dns2 "208.67.220.220"

uamhomepage http://10.1.0.1:3990/www/coova.html

wwwdir /etc/chilli/www

wwwbin /etc/chilli/wwwsh

uamuiport 4990

locationname "AwangaComp-Net"

radiuslocationname "AwanggaComp_Net"

radiuslocationid "isocc=,cc=,ac=,network=AwanggaComp_Net,"

-------------------------------------------------------------------------------------

lalu "save" dan tutup

tekan tombol "Shift+F4" , masukkan "hs.conf", kemudian "Enter"

masukkan baris berikut

-------------------------------------------------------------------------------------

radiusserver1    "www.awanggacomp.net"

radiusserver2    "www.awanggacomp.net"

radiussecret    "easyhotspot"

radiusauthport  1812

radiusacctport  1813

uamserver    "http://10.1.0.1:4990/www/login.chi"

radiusnasid    "nas01"

papalwaysok

uamaliasname "chilli"

adminupdatefile "/etc/chilli/local.conf"

uamsecret "easyhotspot"

-------------------------------------------------------------------------------------

lalu "save" dan tutup

- Masuk ke folder /etc/init.d , melalui "WinScp"

tekan tombol "Shift+F4" , masukkan "chilli", kemudian "Enter"

masukkan baris berikut

-------------------------------------------------------------------------------------

#!/bin/sh /etc/rc.common

# Copyright (C) 2006 OpenWrt.org

START=50

RUN_D=/var/run

PID_F=$RUN_D/chilli.pid

start() {

    include /lib/network

    scan_interfaces

    /sbin/insmod tun >/dev/null 2>&1

    [ -d $RUN_D ] || mkdir -p $RUN_D

    config_get ipaddr lan ipaddr

    /usr/sbin/chilli --dns1="$ipaddr"

}

stop() {

    echo stop

    killall chilli

    [ -f $PID_F ] && kill $(cat $PID_F) >/dev/null 2>&1

}

-------------------------------------------------------------------------------------

lalu "save" dan tutup

- masuk "putty"

------------------------------------------------------------------------------------

root@OpenWrt:/srv/www/easyhotspot/install# chmod a+x /etc/init.d/chilli

root@OpenWrt:/srv/www/easyhotspot/install# /etc/init.d/chilli start

root@OpenWrt:/srv/www/easyhotspot/install# chilli -fd

------------------------------------------------------------------------------------

akhiri dengan menekan "Ctrl+C"

Pastikan hasilnya seperti dibawah ini, maka sudah OK. jika ada errot jangan ke langkah berikutnya.edit dulu bagian yang error

------------------------------------------------------------------------------------

net.c: 1308: 0 (Debug) wlan0  address family: 17 (AF_PACKET)

net.c: 1308: 0 (Debug) wlan0-1  address family: 17 (AF_PACKET)

net.c: 1308: 0 (Debug) br-lan  address family: 17 (AF_PACKET)

net.c: 1308: 0 (Debug) lo  address family: 2 (AF_INET)

net.c: 1308: 0 (Debug) br-lan  address family: 2 (AF_INET)

net.c: 1308: 0 (Debug) 3g-wan2  address family: 2 (AF_INET)

net.c: 1308: 0 (Debug) tun0  address family: 2 (AF_INET)

net.c: 1308: 0 (Debug) tun1  address family: 2 (AF_INET)

dhcp.c: 480: 0 (Debug) hash table size 512 (512)

dhcp.c: 332: 0 (Debug) GARP: Replying to broadcast

dhcp.c: 1172: 0 (Debug) dhcpif (br-wifi) IPv6 address ::

radius.c: 1285: 0 (Debug) RADIUS client 0.0.0.0:0

redir.c: 1718: 125 (Address already in use) IP: 10.1.0.1 Port: 3990 - Waiting for retry.

redir.c: 1718: 125 (Address already in use) IP: 10.1.0.1 Port: 4990 - Waiting for retry.

redir.c: 1718: 125 (Address already in use) IP: 10.1.0.1 Port: 4990 - Waiting for retry.

^Cchilli.c: 7251: 0 (Debug) Failed to create redir listen

------------------------------------------------------------------------------------

- Masuk "putty"

------------------------------------------------------------------------------------

root@OpenWrt:/srv/www/easyhotspot/install# netstat -apn

------------------------------------------------------------------------------------

pastikan isi baris sprti dibawah ini

------------------------------------------------------------------------------------

tcp        0      0 127.0.0.1:3306          0.0.0.0:*

tcp        0      0 10.1.0.1:3990           0.0.0.0:*

tcp        0      0 0.0.0.0:22              0.0.0.0:*

tcp        0      0 10.1.0.1:4990           0.0.0.0:*

udp        0      0 70.70.70.1:1812        0.0.0.0:*

udp        0      0 70.70.70.1:1813        0.0.0.0:*

----------------------------------------------------------------------------------------

root@OpenWrt:/srv/www/easyhotspot/install#

Lebih jelasnya bisa tonton video dibawah ini



EasyHotspot OpenWrt Bagian 3 - Konfigurasi HostNames-Freeradius-Mysql

 Berikut ini lanjutan dari EasyHotspot OpenWrt Bagian 2-Konfigurasi Easyhotspot-Mysql

Urutan langkahnya sebagai berikut :

1. Konfigurasi Hostnames

LUCI>Network>Hostnames

klik "Add"

Hostnames = www.awanggacomp.net  <<<< sesuaikan dengan HostName Router  Anda

IP Address = 70.70.70.1

klik "Save & Apply"

2. Konfigurasi Freeradius

- Edit bagian dibawah ini, di file /etc/freeradius2/sql.conf , menggunakan "WinScp"

------------------------------------------------------------------------------------

        # Connection info:

        server = "localhost"

        #port = 3306

        login = "easyhotspot"

        password = "easyhotspot"

        # Database table configuration for everything except Oracle

        radius_db = "hotspot"

------------------------------------------------------------------------------------

- Edit bagian dibawah ini, di file /etc/freeradius2/client.conf , menggunakan "WinScp"

------------------------------------------------------------------------------------

client www.awanggacomp.net {

    ipaddr = 70.70.70.1

    secret = easyhotspot

------------------------------------------------------------------------------------

- Edit bagian dibawah ini, di file /etc/freeradius2/radiusd.conf , menggunakan "WinScp"

------------------------------------------------------------------------------------

listen {

    type = auth

    interface = br-lan

}

listen {

    ipaddr = *

#    ipv6addr = ::

    port = 0

    type = acct

    interface = br-lan

#    clients = per_socket_clients

}

modules {

#    $INCLUDE eap.conf

    $INCLUDE sql.conf

    $INCLUDE sql/mysql/counter.conf

}

instantiate {

    max_all_mb

    noresetcounter

}

------------------------------------------------------------------------------------

- masuk "putty"                                      

root@OpenWrt:/srv/www/easyhotspot/install# mkdir -p /etc/freeradius2/sql/mysql

------------------------------------------------------------------------------------

Download 2 file berikut

dialup.conf  

counter.conf 

Link Download 2 file diatas DISINI

Masukkan 2 file tsb ke folder /etc/freeradius2/sql/mysql melalui "WinScp"

- Edit bagian dibawah ini, di file /etc/freeradius2/site/default , menggunakan "WinScp"

------------------------------------------------------------------------------------

authorize {

#    eap {

#        ok = return

#    }

#    files

    sql

    max_all_mb

    noresetcounter

#    pap

}

authenticate {

#    Auth-Type PAP {

#        pap

#    }

#    Auth-Type CHAP {

#        chap

#    }

#    Auth-Type MS-CHAP {

#        mschap

#    }

#    eap

}

accounting {

#    radutmp

#    unix

    sql

#    exec

}

session {

#    radutmp

    sql

}

post-auth {

    sql

}

------------------------------------------------------------------------------------

- Edit bagian dibawah ini, di file /usr/share/freeradius2/dictionary , menggunakan "WinScp"

------------------------------------------------------------------------------------

$INCLUDE dictionary.chillispot

------------------------------------------------------------------------------------

Download file berikut

dictionary.chillispot Download Now

Masukkan file tsb ke folder /usr/share/freeradius2/ melalui "WinScp"

- masuk "putty"

------------------------------------------------------------------------------------

root@OpenWrt:/srv/www/easyhotspot/install# radiusd -X  

------------------------------------------------------------------------------------

Pastikan sudah tidak ada pesan eror,

------------------------------------------------------------------------------------

- Masuk "putty"

------------------------------------------------------------------------------------

root@OpenWrt:/srv/www/easyhotspot/install# /etc/init.d/radiusd start

root@OpenWrt:/srv/www/easyhotspot/install# netstat -apn

------------------------------------------------------------------------------------

jika sdh ada baris berikut, maka sdh bs ke tahap selanjutnya

------------------------------------------------------------------------------------

udp        0      0 70.70.70.1:1812        0.0.0.0:*                           

udp        0      0 70.70.70.1:1813        0.0.0.0:*                           

-------------------------------------------------------------------------------------

Lebih jelasnya lihat pada video dibawah ini


* Cara download Click Link diatas akan diarahkan  ke notifikasi  Click "Take Me" selanjutnya tinggal ngikuti petunjuk yang diberikan

Featured Post

Extroot and install luci in firmware OpenWrt Compilation