Anda di halaman 1dari 5

Easy Mikrotik HotSpot Setup

Quick WiFi HotSpot Setup powered by Mikrotik

===> Setup your IP addresses. We will use Ethernet Port 1 (ether1) and Enternet Port 5 (ether5)
for this tutorial. The setup will be:

ether1 = 192.168.1.10/24 = Connected to Internet

ether2 =
ether3 =
ether4 =
ether5 =

Unused at this time


Unused at this time
Unused at this time
192.168.5.10/24 = Connected to Client / Access Point (AP)

/ip address
add address=192.168.1.10/24 comment=WAN disabled=no \
interface=ether1 network=192.168.1.0
add address=192.168.5.10/24 comment=LAN disabled=no \
interface=ether5 network=192.168.5.0
///////////////@\\\\\\\\\\\\\\\
===> We will also setup a DHCP Server on Mikrotik RB and set a DHCP IP Pool for it. Before we
start, make sure you already disabled all of your AP's DHCP Server function so that it will not
give out any IP address an only Mikrotik RB sends out IP Addresses to your client. We will also
use IP Address starting with 192.168.5.11 because 192.168.5.1 to 192.168.5.10 will be used by
AP's.
/ip dhcp-server
add address-pool=hs-pool-1 authoritative=after-2sec-delay \
bootp-support=static disabled=no interface=ether5 \
lease-time=1h name=dhcp1
/ip dhcp-server config set store-leases-disk=5m
/ip dhcp-server network add address=192.168.5.0/24 \
comment="HotSpot Network" gateway=192.168.5.10
/ip pool add name=hs-pool-1 ranges=192.168.5.11-192.168.5.254

click image to enlarge


///////////////@\\\\\\\\\\\\\\\
===> On this step, we will add a DNS IP Address. Refer to your ISP for their DNS IP Address of in
this tutorial, we will use Google Public DNS Address.

/ip dns set allow-remote-requests=yes cache-max-ttl=1w \


cache-size=10000KiB max-udp-packet-size=512 servers=8.8.8.8
///////////////@\\\\\\\\\\\\\\\
===> Now, we will proceed to setup HotSpot. Please note these items:

[ dns-name="" ] - You can change it if you want. Leave it as is if you want to use default
IP Address 192.168.5.10 as your hotspot URL. If not, you can add hotspot.abc.com or
abc.hotspot. Make sure that the DNS Name is not publicly accessible or else it will show that
website instead of your hotspot pages.

[ use-radius=no ] - We will not setup any radius server at this moment. So, it will be
left with 'no'. We will setup radius server later.

[ idle-timeout=15m ] - This will be your client's idle timeout. They will be disconnected
in 15 minutes if there is no activity on their terminal. It is good to setup this value no more
than 30 minutes. If any client don't properly logout, they can only login back after that time
period.

[ /ip hotspot user add ... ] - Change this information with your preferred username and
password. This will be used to login to your HotSpot and User Management Portal later.

click image to enlarge


/ip hotspot profile set default dns-name="" hotspot-address=0.0.0.0 \
html-directory=hotspot http-cookie-lifetime=3d http-proxy=0.0.0.0:0 \
login-by=cookie,http-chap name=default rate-limit="" \
smtp-server=0.0.0.0 split-user-domain=no use-radius=no
/ip hotspot profile add dns-name=hotspot.zarencorp.com \
hotspot-address=192.168.5.10 html-directory=hotspot \
http-cookie-lifetime=1d http-proxy=0.0.0.0:0 \
login-by=cookie,http-chap name=hsprof1 rate-limit="" \
smtp-server=0.0.0.0 split-user-domain=no use-radius=no
/ip hotspot add address-pool=hs-pool-1 addresses-per-mac=2 \
disabled=no idle-timeout=15m interface=ether5 \
keepalive-timeout=none name=hotspot1 profile=hsprof1
/ip hotspot user profile set default idle-timeout=none \
keepalive-timeout=2m name=default shared-users=1 \
status-autorefresh=1m transparent-proxy=no
/ip hotspot service-port set ftp disabled=yes ports=21
/ip hotspot walled-garden ip add action=accept disabled=no \
dst-address=192.168.5.10

/ip hotspot set numbers=hotspot1 address-pool=none


/ip firewall nat add action=masquerade chain=srcnat disabled=no
/ip hotspot user add disabled=no \
name=your_username password=your_password \
profile=default
///////////////@\\\\\\\\\\\\\\\
===> Lastly, before the HotSpot setup is completely ready to use, we will create a route which
will redirect your client to HotSpot login before they can browse the internet.
/ip route add disabled=no distance=1 dst-address=0.0.0.0/0 \
gateway=192.168.1.1 scope=30 target-scope=10
///////////////@\\\\\\\\\\\\\\\
Alternatively, we can copy and paste the codes all at once. Make sure you edit certain
information before you paste to Mikrotik's Terminal.
/ip address add address=192.168.1.10/24 comment=WAN \
disabled=no interface=ether1 network=192.168.1.0
/ip address add address=192.168.5.10/24 comment=LAN \
disabled=no interface=ether5 network=192.168.5.0
/ip dhcp-server
add address-pool=hs-pool-1 authoritative=after-2sec-delay \
bootp-support=static disabled=no interface=ether5 \
lease-time=1h name=dhcp1
/ip dhcp-server config set store-leases-disk=5m
/ip dhcp-server network add address=192.168.5.0/24 \
comment="HotSpot Network" gateway=192.168.5.10
/ip pool add name=hs-pool-1 ranges=192.168.5.11-192.168.5.254
/ip dns set allow-remote-requests=yes cache-max-ttl=1w \
cache-size=10000KiB max-udp-packet-size=512 servers=8.8.8.8
/ip hotspot profile set default dns-name="" hotspot-address=0.0.0.0 \
html-directory=hotspot http-cookie-lifetime=3d http-proxy=0.0.0.0:0 \
login-by=cookie,http-chap name=default rate-limit="" \
smtp-server=0.0.0.0 split-user-domain=no use-radius=no
/ip hotspot profile add dns-name=hotspot.zarencorp.com \
hotspot-address=192.168.5.10 html-directory=hotspot \
http-cookie-lifetime=1d http-proxy=0.0.0.0:0 \
login-by=cookie,http-chap name=hsprof1 rate-limit="" \
smtp-server=0.0.0.0 split-user-domain=no use-radius=no
/ip hotspot add address-pool=hs-pool-1 addresses-per-mac=2 \
disabled=no idle-timeout=15m interface=ether5 \
keepalive-timeout=none name=hotspot1 profile=hsprof1
/ip hotspot user profile set default idle-timeout=none \
keepalive-timeout=2m name=default shared-users=1 \

status-autorefresh=1m transparent-proxy=no
/ip hotspot service-port set ftp disabled=yes ports=21
/ip hotspot walled-garden ip add action=accept disabled=no \
dst-address=192.168.5.10
/ip hotspot set numbers=hotspot1 address-pool=none
/ip firewall nat add action=masquerade chain=srcnat disabled=no
/ip hotspot user add disabled=no \
name=your_username password=your_password \
profile=default
/ip route add disabled=no distance=1 dst-address=0.0.0.0/0 \
gateway=192.168.1.1 scope=30 target-scope=10
///////////////@\\\\\\\\\\\\\\\

Anda mungkin juga menyukai