Community discussions

MikroTik App
 
PND
just joined
Topic Author
Posts: 5
Joined: Tue Dec 24, 2019 2:02 pm

User can Browse Internet without Authentication

Tue Dec 24, 2019 2:29 pm

Hi !!

RouterBOARD 951Ui 2HnD

My Requirement : Users will get Internet connection only after authentication in Hotspot URL (which have to open automatically).
Present Status : Users are getting Internet without authentication in Hotspot.

I have configured WAN and LAN with DNS and I am able to get to the Internet from the Router Terminal.
So for User Authentication, I have created a Hotspot and configured perfectly with LAN IP, DHCP Server, IP Pool, User Profile, User. But the Users under the Router are able to get Internet without authentication in Hotsop URL. And also the Hotspot login page is not opening automatically.

The problem is the Network is open and anyone can browse Internet without any authentication.

Regards
 
PND
just joined
Topic Author
Posts: 5
Joined: Tue Dec 24, 2019 2:02 pm

Re: User can Browse Internet without Authentication

Wed Dec 25, 2019 9:54 pm

Please help me out !!
I'm stuck..
 
User avatar
ingdaka
Trainer
Trainer
Posts: 452
Joined: Thu Aug 30, 2012 3:06 pm
Location: Albania
Contact:

Re: User can Browse Internet without Authentication

Thu Dec 26, 2019 8:50 am

Post your configuration here!
Type in terminal /export hide-sensitive
 
PND
just joined
Topic Author
Posts: 5
Joined: Tue Dec 24, 2019 2:02 pm

Re: User can Browse Internet without Authentication

Fri Dec 27, 2019 11:47 am

Hi Ingdaka !!

Thanks for your reply. Below I have pasted the configuration you have asked for
Please help !!
*************************************************************
[admin@SC] > /export hide-sensitive 
# dec/27/2019 15:13:17 by RouterOS 6.46.1
# software id = 3N9A-I2Q4
#
# model = 951Ui-2HnD
# serial number = 643106599EB7
/interface ethernet
set [ find default-name=ether1 ] advertise=10M-half,10M-full,100M-half,100M-full,1000M-half,1000M-full name=BSNL-P1
set [ find default-name=ether2 ] advertise=10M-half,10M-full,100M-half,100M-full,1000M-half,1000M-full name=LAN-P2
set [ find default-name=ether3 ] advertise=10M-half,10M-full,100M-half,100M-full,1000M-half,1000M-full
set [ find default-name=ether4 ] advertise=10M-half,10M-full,100M-half,100M-full,1000M-half,1000M-full
set [ find default-name=ether5 ] advertise=10M-half,10M-full,100M-half,100M-full,1000M-half,1000M-full
/interface wireless
set [ find default-name=wlan1 ] antenna-gain=0 country=no_country_set frequency-mode=manual-txpower ssid=MikroTik
/interface wireless security-profiles
set [ find default=yes ] supplicant-identity=MikroTik
/ip hotspot profile
add dns-name=hotstop.soslog.in hotspot-address=192.168.1.1 login-by=http-chap name=HS-PROFILE
/ip pool
add name=HS-POOL ranges=192.168.1.50-192.168.1.220
/ip dhcp-server
add address-pool=HS-POOL authoritative=after-2sec-delay disabled=no interface=LAN-P2 lease-time=1h name=HS-DHCP
/ip hotspot
add address-pool=HS-POOL addresses-per-mac=1 disabled=no interface=LAN-P2 name=HOTSPOT profile=HS-PROFILE
/ip hotspot user profile
add add-mac-cookie=no address-pool=HS-POOL !mac-cookie-timeout name=UP1
/tool user-manager customer
set admin access=own-routers,own-users,own-profiles,own-limits,config-payment-gw
/tool user-manager profile
add name=guest name-for-users="" override-shared-users=unlimited owner=admin price=0 starts-at=logon validity=1d
add name=GUES name-for-users="" override-shared-users=10 owner=admin price=0 starts-at=logon validity=1d
/ip address
add address=192.168.18.2/25 interface=BSNL-P1 network=192.168.18.0
add address=192.168.1.1/24 comment="hotspot network" interface=LAN-P2 network=192.168.1.0
/ip dhcp-server network
add address=192.168.1.0/24 comment="hotspot network" gateway=192.168.1.1
/ip dns
set servers=8.8.8.8
/ip firewall filter
add action=passthrough chain=unused-hs-chain comment="place hotspot rules here" disabled=yes
/ip firewall nat
add action=passthrough chain=unused-hs-chain comment="place hotspot rules here" disabled=yes
add action=masquerade chain=srcnat comment="masquerade hotspot network" src-address=192.168.1.0/24
/ip hotspot user
add name=user1 profile=UP1 server=HOTSPOT
/ip hotspot walled-garden
add comment="place hotspot rules here"
/ip hotspot walled-garden ip
add action=accept disabled=no dst-address=172.20.20.1 !dst-port !protocol !src-address
/ip route
add distance=1 gateway=192.168.18.1
/system clock
set time-zone-name=Asia/Kolkata
/system identity
set name=SC
/system scheduler
add interval=10m name=readyVoucher on-event=readyVoucher policy=ftp,reboot,read,write,policy,test,password,sniff,sensitive,romon start-date=dec/21/2019 \
    start-time=16:07:17
/system script
add dont-require-permissions=no name=readyVoucher owner=admin policy=ftp,reboot,read,write,policy,test,password,sniff,sensitive,romon source=":local thisDate\
    \r\
    \n:local thisYear\r\
    \n:local thisDay\r\
    \n:local thisMonth\r\
    \n:local thisTime\r\
    \n:local thisTime1\r\
    \n:local thisTime2\r\
    \n:set thisDate [/ system clock get date]\r\
    \n:set thisTime [/ system clock get time]\r\
    \n:set thisYear [:pick \$thisDate 7 11]\r\
    \n :if (\$thisYear > \"2010\")  do={ \r\
    \n :set thisDay [:pick \$thisDate 4 6]\r\
    \n :set thisMonth [:pick \$thisDate 0 3]\r\
    \n :set thisTime1 [:pick \$thisTime 0 2]\r\
    \n :set thisTime2 [:pick \$thisTime 3 5]\r\
    \n :if (\$thisMonth = \"jan\") do={ :set thisMonth \"01\" }\r\
    \n :if (\$thisMonth = \"feb\") do={ :set thisMonth \"02\" }\r\
    \n :if (\$thisMonth = \"mar\") do={ :set thisMonth \"03\" }\r\
    \n :if (\$thisMonth = \"apr\") do={ :set thisMonth \"04\" }\r\
    \n :if (\$thisMonth = \"may\") do={ :set thisMonth \"05\" }\r\
    \n :if (\$thisMonth = \"jun\") do={ :set thisMonth \"06\" }\r\
    \n :if (\$thisMonth = \"jul\") do={ :set thisMonth \"07\" }\r\
    \n :if (\$thisMonth = \"aug\") do={ :set thisMonth \"08\" }\r\
    \n :if (\$thisMonth = \"sep\") do={ :set thisMonth \"09\" }\r\
    \n :if (\$thisMonth = \"oct\") do={ :set thisMonth \"10\" }\r\
    \n :if (\$thisMonth = \"nov\") do={ :set thisMonth \"11\" }\r\
    \n :if (\$thisMonth = \"dec\") do={ :set thisMonth \"12\" }\r\
    \n :set thisDate (\$thisYear.\$thisMonth.\$thisDay.\$thisTime1.\$thisTime2)\r\
    \n :local users [/ip hotspot user find]\r\
    \n :local i\r\
    \n :local expirationDate\r\
    \n :foreach i in=\$users do={\r\
    \n  :set expirationDate [/ ip hotspot user get \$i comment]\r\
    \n  :if ([:len \$expirationDate] = 12) do={\r\
    \n   :local expNum [:tonum \$expirationDate]\r\
    \n   :local thisNum [:tonum \$thisDate]\r\
    \n   :if (([:typeof \$expNum] = \"num\") and(\$expNum < \$thisNum)) do={\r\
    \n    :local userName [/ip hotspot user get \$i name]\r\
    \n    :local activeUser [/ip hotspot active find where user=\$userName]\r\
    \n    /ip hotspot user remove \$i\r\
    \n    /ip hotspot active remove \$activeUser\r\
    \n    :log info \"Detected readyVoucher hotspot expired user\"\r\
    \n   }\r\
    \n  }\r\
    \n  :delay 0.5s\r\
    \n }\r\
    \n}\r\
    \n"
/tool user-manager database
set db-path=user-manager
/tool user-manager router
add coa-port=1700 customer=admin disabled=no ip-address=127.0.0.1 log=auth-fail name=SC use-coa=yes
/tool user-manager user
add customer=admin disabled=no ipv6-dns=:: shared-users=10 username=cxb wireless-enc-algo=none wireless-enc-key="" wireless-psk=""
[admin@SC] >
Last edited by krisjanisj on Fri Dec 27, 2019 11:52 am, edited 1 time in total.
Reason: Please post configs/code in [code] blocks to save peoples scroll wheels
 
PND
just joined
Topic Author
Posts: 5
Joined: Tue Dec 24, 2019 2:02 pm

Re: User can Browse Internet without Authentication

Sat Dec 28, 2019 9:16 am

Please have a look and please help
 
PND
just joined
Topic Author
Posts: 5
Joined: Tue Dec 24, 2019 2:02 pm

Re: User can Browse Internet without Authentication

Mon Dec 30, 2019 6:44 pm

Hi Everyone !!

I am desperate to solve the issue but i am unable to. That's why i hav posted here. But i am uable to get any respond.

I am doing something wrong for not getting view on my post. Please help i urge the members of this forum.

Who is online

Users browsing this forum: GoogleOther [Bot] and 62 guests