Mikrotik DHCP option 43 How to

 

 

Mikrotik DHCP option 43 How to

After doing a lot of searching, I could not find an easy guide on how to add the option 43 to DHCP on a Mikrotik and get my APs to connect to a remote Controller so I figured I would write one.

My Setup:
Mikrotik 750 (v5.4 os) (Default config)
Unifi 2.2 controller on ubuntu VMWARE guest (Public IP: 192.168.200.10)

1. Convert your public IP to hex. The option 43 value has to be in HEX to work.
192=C0
168=A8
200=C8
10=0A
2. Your option 43 value will be “0x0104” + the HEX of the IP.
So in my example it is: “0x0104C0A8C80A”
3. Open up a new terminal on your Mikrotik or ssh in and type:
/ip dhcp-server option add code=43 name=unifi value=0x0104C0A8C80A
/ip dhcp-server network set 0 dhcp-option=unifi
My router was using the default config so only one network was present ID 0. You could do “/ip dhcp-server network print” to see the list and pick the ID of the network you want to add the option to.
4. Plug in your UAP and it should grab the info and show up on the remote Unifi controller asking to be adopted.

Troubleshooting:
Older UAPs have older firmware. The older firmware does not ask DHCP for option 43. Pulled my hair out for a few hours on this one. The way I found this was by turning on DHCP logging and watched the DHCP Discover. It was not asking for “VendorSpecific” which is option 43. If you have these you have a few options.
1. Upgrade the firmware in the lab by connecting them to a local Controller, adopting them and then “paper-clip” them.
2. Use the discovery tool on them to make them connect.
3. Use DNS. I prefer not to use this method but it does work even on older firmware. In your DHCP server config put in a domain name that you control. Then add a unifi A record pointing to the remote unif controller. Some will say this is easier than Option 43. However if you are doing many different controllers you would have to setup lots of sub-domains and such. And that domain will be default domain name on any hosts connecting on that network.

分類: RouterOS | 發佈留言

為你的RouterOS 設定NAT loopback (Hairpin NAT)

如果你的電腦在路由器底下想要透過公網IP或是網址訪問同一個區網底下伺服器的話,

這時因為NAT loopback問題會導致你無法訪問你的區網內的伺服器.

底下是官網的教學,官方稱它叫作 Hairpin NAT(這個網站教學一直以來都是給初學者看的,大嬸請繞路.)

 

設定方式如下..

 

1.假設你的網段是192.168.88.xxx

2.假設你的WEB伺服器是192.168.88.8

底下這張圖第0行是基本的port mapping,就不另外多解釋.

/ip firewall nat
add chain=dstnat in-interface=pppoe-out1 protocol=tcp dst-port=80 \
  action=dst-nat to-address=192.168.88.8 to-port=80
add chain=srcnat out-interface=pppoe-out1 action=masquerade

 


 

防火牆第1行開始做起(底下5900改成你自己需要的PORT,例如80)

/ip firewall nat
add chain=dstnat dst-address-type=local protocol=tcp dst-port=80 \
  action=dst-nat to-address=192.168.88.8 to-port=80


 

 

第三行的設定(底下5900改成你自己需要的PORT,例如80)

/ip firewall nat add chain=srcnat src-address=192.168.88.0/24 \ dst-address=192.168.88.8 protocol=tcp dst-port=80 \ out-interface=bridge-local action=masquerade

大功告成.

底下這個網址可以自行測試設定是否有成功

https://www.yougetsignal.com/tools/open-ports/

 

 

 

 

 

 

分類: RouterOS | 2 則留言

UniFi Controller AC控制器安装在 Ubuntu 12.04

Install Ubiquiti UniFi Controller on Ubuntu 12.04

Install MongoDB for DebianImport 10gen public GPG key:

sudo apt-key adv –keyserver keyserver.ubuntu.com –recv 7F0CEB10

Add the 10gen repository to /etc/apt/sources.list:

sudo nano /etc/apt/sources.list.d/10gen.list
deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen
sudo apt-get update
sudo apt-get install mongodb-10gen
Install UniFi Controller
Add the following line to the bottom of /etc/apt/sources.list:
sudo nano /etc/apt/sources.list
deb http://www.ubnt.com/downloads/unifi/distros/deb/precise precise ubiquiti
Note:
If using a different version of Ubuntu replace “precise” with your Ubuntu distro (i.e. “oneiric” for Ubuntu 11.10).
Add GPG key:
sudo apt-key adv –keyserver keyserver.ubuntu.com –recv C0A52C50
Retrieve the latest package information:
sudo apt-get update
Install/Upgrade UniFi package:
Note:
unifi (the most stable), unifi-rapid (beta version intended for stable release), and unifi-beta (the cutting edge)
You can install / switch between releases.
sudo apt-get install unifi
The UniFi Controller should now be accessible from https://<server_ip>:8443/
分類: RouterOS | 發佈留言

UniFi AP設置連到雲AC接管

先用SSH軟體登入UAP   

 PUTTY下載處1 

PUTTY本站下載

下圖不是叫你登入10.1.1.14, 你自己要想辦法知道你自己的uap ip是多少!

 


 成功登入之後的畫面 


先對UAP下重置命令,把舊的配置先清空(恢復出廠值)

還原至出廠設定命令如下

syswrapper.sh restore-default

出廠的預設登入帳密是: ubnt/ubnt

還原完成


 開始重新設定新的雲ac控制器接管位址

命令如下

mca-cli

set-inform http://unifi.tw:8080/inform 

(紅色的地方改成你自己的雲AC服務器網址或是IP)


 設置完成


 前往雲AC的網頁檢查

下面這張圖,UAP已經自動連上來控制器 等待設定.

完工。

分類: RouterOS | 1 則留言

RouterOS WinBox 遠端協助

為什麼要這樣做………..因為以下原因

1.網路狠卡  .

2.你的ip是浮動的 .

3.你的路由器安裝位置處於內網之內.(如果有被防火牆封鎖pptp的話,請改用OPENVPN-Client跑443 port 連線)

 

因此必須要透過vpn,才能順利的使用WinBox操作你的ROS.

先照著下面圖片設定你自己的ROS讓它能連上我的伺服器,成功連線後再告知我.{a31}

 (等問題協助處理完成後再自行刪除此連線設定即可)


操作方式如下…

先新增一個PPTP-Client

 


 

Name 打 help 即可

 

 


 

1的位置填入 aliyun.ros.tw (深圳阿里雲機房)  

2的位置填入   help   四個英文字  {a38}

3的位置填入   help   四個英文字  {a38}

全部填好之後在4的地方按一下,會看到最底下連線成功的英文字

 


 

 

R表示註冊連線成功 {a63} 

搞定之後再聯繫我吧{a64}

分類: RouterOS | 8 則留言

MikroTik v6.x版 VM虛擬機專用可升级

按我下載(需要解壓密碼)

使用方法如下

分類: RouterOS | 發佈留言

RouterOS連線數設定(Session)

限制lan端的整個網段每一台電腦的Session連線數

350意思是每個ip最大 350個Session

32的意思是指單個ip,千萬別搞錯

(如果填24就變成整個網段限制只能跑 350個Session)

 

超過 350個Session就丟棄封包

完工

 

2 則留言

SITE TO SITE VPN 教學(使用PPTP)

這裡介紹最簡單的二地透過PPTP-VPN互連的教學 相關ip範例參數如下圖

1. A跟B二個不同地方,其中A點當PPTP-VPN SERVR , B點當PPTP-Client.

2. A點的RouterOS先自行設定好要當PPTP-VPN SERVR的功能.

3. B點的RouterOS新增一個PPTP-Client 連線到A點.

當B點的筆電要連到A點底下的電腦時 , B點的 RouterOS需先設定路由表告訴目的地該如走.

如下

以上這樣即可從B點的筆電連到A點底下的電腦.

 

 

閱讀全文 →

1 則留言

MikroTik RBcAP2n cAP 2n 吸頂式 無線AP

802.11n 150m 單頻2.4G 最大功率17dBm吸頂式無線AP

1 則留言

Mikrotik RB850Gx2 採用500MHz雙核心的PPC處理器

20141030221559

The RB850Gx2 is a five port Gigabit ethernet router. Comparing to the RB450G, the RB850Gx2 is much faster, with a dual core CPU, yet it still retains the same form factor, and will fit into the same enclosures.

The device is powered by a 500MHz P1023 PPC CPU, and also includes a temperature sensor and voltage monitor.

Product specifications

Details
Product code RB850Gx2
CPU nominal frequency 500 MHz
CPU core count 2
Size of RAM 512 MB
Architecture PowerPC
10/100 Ethernet ports 0
10/100/1000 Ethernet ports 5
MiniPCI slots 0
MiniPCI-e slots 0
Wireless chip model None
Number of USB ports 0
Memory Cards 1
Memory card type microSD
Power Jack 2
802.3af support No
PoE out No
PoE in Yes
Supported input voltage 5 V – 30 V
Voltage Monitor Yes
PCB temperature monitor Yes
CPU temperature monitor Yes
Dimensions 90mm x 115mm
Operating System RouterOS
License level 5
Antenna gain DBI No
Current Monitor No
CPU P1023NSN5CFB
Max Power consumption 8 W
SFP ports 0
SFP+ ports None
Number of chains 0
Serial port RS232
分類: RouterOS | 1 則留言