Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
en:dpi:dpi_options:use_cases:wifi_hotspot_session_management:start [2024/08/07 16:13] – created elena.krasnobryzh | en:dpi:dpi_options:use_cases:wifi_hotspot_session_management:start [Unknown date] (current) – removed - external edit (Unknown date) 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | {{indexmenu_n> | ||
- | ====== Configuring GUI, SSG, and WiFi HotSpot with Session Management Enabled ====== | ||
- | ===== Network Topology ===== | ||
- | - Connect the equipment according to the network topology.\\ {{ : | ||
- | |||
- | ===== Authorization Sequence ===== | ||
- | - The subscriber connects to the WiFi network | ||
- | - A welcome page appears informing the subscriber to open a browser and identify themselves | ||
- | - The subscriber opens a browser, and upon navigating to any URL, they are redirected to the identification page | ||
- | - The subscriber enters their phone number and requests an access code | ||
- | - The access code is sent to the phone number via SMS | ||
- | - The subscriber enters the received access code | ||
- | - Session cookies are recorded on the subscriber' | ||
- | |||
- | ===== Setting Up Virtual Machines (VM) ===== | ||
- | - Create two virtual machines with the following minimum specifications: | ||
- | * VM '' | ||
- | * VM '' | ||
- | - Install the latest version of CentOS 7 (build-2009 at the time of writing) on both virtual machines. Choose minimal installation during setup.\\ After OS installation, | ||
- | - Disable SELinux on both VMs: | ||
- | * Edit the file ''/ | ||
- | * Set the parameter '' | ||
- | |||
- | ===== Installing and Configuring dpiui_vm ===== | ||
- | - Install DPIUI on '' | ||
- | - Configure the network on both VMs and SSG:< | ||
- | ONBOOT=yes | ||
- | IPADDR=10.0.0.x | ||
- | NETMASK=255.255.255.0 | ||
- | GATEWAY=10.0.0.1 | ||
- | DNS1=10.0.0.2</ | ||
- | - Log in to the GUI and add both VMs and SSG in the " | ||
- | |||
- | ===== Installing and Configuring cp_wifi_vm ===== | ||
- | - Install the '' | ||
- | - Edit the configuration file for Hotspot:< | ||
- | - **'' | ||
- | - **'' | ||
- | - **'' | ||
- | - **'' | ||
- | - **'' | ||
- | |||
- | If the parameter '' | ||
- | |||
- | Finally, run the command:< | ||
- | |||
- | ===== Installing and Configuring dhcp-isc on cp_wifi_vm ===== | ||
- | - Install the '' | ||
- | - Configure the static ARP scripts and the '' | ||
- | * First, the '' | ||
- | authoritative; | ||
- | db-time-format local; | ||
- | log-facility local7; | ||
- | |||
- | subnet 100.64.0.0 netmask 255.255.252.0 { | ||
- | range 100.64.0.3 100.64.3.254; | ||
- | default-lease-time 600; | ||
- | max-lease-time 600; | ||
- | option subnet-mask 255.255.252.0; | ||
- | option broadcast-address 100.64.3.255; | ||
- | option routers 100.64.0.1; | ||
- | option ntp-servers < | ||
- | option domain-name-servers 10.0.0.2; | ||
- | option domain-name " | ||
- | |||
- | on commit { | ||
- | set ClientIP = binary-to-ascii(10, | ||
- | set ClientMac = concat ( | ||
- | suffix (concat (" | ||
- | suffix (concat (" | ||
- | suffix (concat (" | ||
- | suffix (concat (" | ||
- | suffix (concat (" | ||
- | suffix (concat (" | ||
- | log(concat(" | ||
- | |||
- | | ||
- | on release { | ||
- | set ClientIP = binary-to-ascii(10, | ||
- | set ClientMac = concat ( | ||
- | suffix (concat (" | ||
- | suffix (concat (" | ||
- | suffix (concat (" | ||
- | suffix (concat (" | ||
- | suffix (concat (" | ||
- | suffix (concat (" | ||
- | |||
- | log(concat(" | ||
- | execute("/ | ||
- | on expiry { | ||
- | set ClientIP = binary-to-ascii(10, | ||
- | log(concat(" | ||
- | execute("/ | ||
- | } | ||
- | subnet 10.0.0.0 netmask 255.255.255.0 { | ||
- | }</ | ||
- | |||
- | touch / | ||
- | && chown dpiacc: | ||
- | |||
- | chmod 755 / | ||
- | |||
- | chmod 755 / | ||
- | |||
- | set METHOD [lindex $argv 0] | ||
- | set IP_ADDR [lindex $argv 1] | ||
- | set MAC_ADDR [lindex $argv 2] | ||
- | set MAC_ADDR [string toupper $MAC_ADDR] | ||
- | #Client interface on MikroTik: | ||
- | set INT_CLIENT " | ||
- | set status 0 | ||
- | |||
- | #Record dhcp-lease (start and end) in the Hotspot database | ||
- | spawn / | ||
- | |||
- | expect " | ||
- | |||
- | #Connecting to the router | ||
- | spawn ssh -i / | ||
- | |||
- | /null | ||
- | |||
- | #Adding a static ARP record to the router | ||
- | expect { | ||
- | " | ||
- | set timeout 15 | ||
- | if { $METHOD == " | ||
- | send "ip arp add interface=$INT_CLIENT address=$IP_ADDR mac-address=$MAC_ADDR\r" | ||
- | | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | } | ||
- | } | ||
- | if { $METHOD == " | ||
- | send "ip arp remove [find address~\" | ||
- | | ||
- | " | ||
- | " | ||
- | "*not such item*" { set status 2 } | ||
- | " | ||
- | } | ||
- | } | ||
- | if { $METHOD == " | ||
- | send "ip arp remove [find address~\" | ||
- | | ||
- | " | ||
- | " | ||
- | "*not such item*" { set status 2 } | ||
- | " | ||
- | } | ||
- | } | ||
- | } | ||
- | } | ||
- | exit $status</ | ||
- | #Expecting external IP | ||
- | EXTIP=10.0.0.3 | ||
- | if [ $1 == ' | ||
- | echo " | ||
- | mysql -u hotspot -ppassword -h $EXTIP -D hotspot -e " | ||
- | if [ $? -eq 1 ]; then | ||
- | mysql -u hotspot -ppassword -h $EXTIP -D hotspot -e " | ||
- | echo " | ||
- | else | ||
- | mysql -u hotspot -ppassword -h $EXTIP -D hotspot -e " | ||
- | echo " | ||
- | fi | ||
- | else | ||
- | echo " | ||
- | mysql -u hotspot -ppassword -h $EXTIP -D hotspot -e " | ||
- | echo " | ||
- | fi | ||
- | echo " | ||
- | Finally, generate the key on the '' | ||