User Tools

Site Tools


toh:mikrotik:rb951ui

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Previous revision
toh:mikrotik:rb951ui [2014/02/23 02:07]
toh:mikrotik:rb951ui [2015/04/20 04:32] (current)
toerless Normalizing titles
Line 1: Line 1:
-==== MikroTik RouterBOARD 951Ui-2HnD ====+==== Mikrotik RouterBoard RB951Ui-2HnD ====
 === Hardware === === Hardware ===
 ^ CPU ^ CPU Speed ^ RAM (MB) ^ NAND (MB) ^ Serial Flash ^ Ethernet Switch ^ PoE port ^ Wireless ^ USB ^ UART ^ JTAG ^ ^ CPU ^ CPU Speed ^ RAM (MB) ^ NAND (MB) ^ Serial Flash ^ Ethernet Switch ^ PoE port ^ Wireless ^ USB ^ UART ^ JTAG ^
 | AR9334 | 600 MHz | 128 (2x W9751G6KB-25) | 128 (1x TC58DVG02D5TA00-ND) | MX25L512E | AR7240 (10M/100M) | 1-in 5-out (500mA) | AR9344-DC3A | 1x 2.0 | 1x onboard | 1x onboard | | AR9334 | 600 MHz | 128 (2x W9751G6KB-25) | 128 (1x TC58DVG02D5TA00-ND) | MX25L512E | AR7240 (10M/100M) | 1-in 5-out (500mA) | AR9344-DC3A | 1x 2.0 | 1x onboard | 1x onboard |
-=== Create ​image === +=== Download OpenWRT ​image === 
-  ​$ mkdir /home/user/mikrotik/ +The 951Ui-2HnD is supported starting with OpenWRT 14.07. 
-  $ cd /home/user/​mikrotik/​ +  ​wget -c https://downloads.openwrt.org/latest/ar71xx/mikrotik/openwrt-ar71xx-mikrotik-vmlinux-initramfs.elf 
-  ​$ svn co -r 39392 svn://svn.openwrt.org/​openwrt/trunk/ +  ​wget -c https://downloads.openwrt.org/​latest/ar71xx/mikrotik/openwrt-ar71xx-mikrotik-vmlinux-lzma.elf 
-  $ cd /home/user/mikrotik/trunk +  wget -c https://downloads.openwrt.org/​latest/ar71xx/mikrotik/openwrt-ar71xx-mikrotik-DefaultNoWifi-rootfs.tar.gz 
-  ​wget -c http://patchwork.openwrt.org/​patch/4773/raw-O OpenWrt-Devel-ar71xx-Add-support-for-MikroTik-RB951Ui-2HnD.patch +  ​ln -s openwrt-ar71xx-mikrotik-DefaultNoWifi-rootfs.tar.gz openwrt-ar71xx-mikrotik-rootfs.tar.gz 
-  ​$ patch -u -p0 < OpenWrt-Devel-ar71xx-Add-support-for-MikroTik-RB951Ui-2HnD.patch +Installing OpenWRT is a two-stage process. First netboot the router via DHCP/TFTP to OpenWRT initramfs running in RAM. From that OpenWRT download/install OpenWRT kernel and filesystem onto NAND Flash. That second stage overwrites the MikroTik OS (RouterOS) in NAND Flash, but it does not touch the MikroTik Bootloader. 
-// Configure image for booting from RAM // +=== Netboot RG951ui to OpenWrt in RAM === 
-  ​$ make menuconfig +Connect port 1 (WAN port) to a network with a DHCP/TFTP server. Connect a PC to port 2..5 or WLAN. Log into RouterOS and set router to boot from ethernet once with DHCP: 
-  ​$ make kernel_menuconfig +  ​- System -> Routerboard -> Settings -> Boot device: Try ethernet once then NAND 
-''​ Target = AR7XXX +  ​- System -> Routerboard -> Settings -> Boot protocol: DHCP 
- Subtarget = Mikrotik device with NAND flash +Copy openwrt-ar71xx-mikrotik-vmlinux-initramfs.elf to your TFTP server location. Set up your DHCP server to point to your TFTP server as the next-server and to that file as the bootfile (see below how to use dnsmasq as DHCP+TFTP as an example). ​ 
- Target Images = ramdisk''​ +Reboot RG951ui. If it netboots into OpenWRT you will see P5 lighting red. Otherwise, manually netboot RB951ui: 
-  ​$ make V=s +  - Unplug RB951ui power jack  
-// Configure image for booting from NAND // +  ​- Hold reset button 
-  ​$ make menuconfig +  - Plug power jack 
-''​ Target = AR7XXX +  ​- Observe ACT LED.  
- Subtarget = Mikrotik device with NAND flash +  - It first goes on continuously. Then it flashes. Then it goes on continuously. Then it goes off continuously. This will take 15..20 seconds. Then a beep sounds (5 seconds later). 
- Target Images = tar.gz''​ +  - Release reset button. 
-  $ make V=s +When successfull,​ P5 LED should light red
-=== run OpenWrt in RAM ===+If netbooting fails, reset RG951ui to factory condition and try again: Same as netbooting, but release reset button when ACT flashed, then wait a minute or so until double-beep,​ then RouterOS is up and running. 
 + 
 +// How to use dnsmasq as DHCP + TFTP server // 
 Copy openwrt-ar71xx-mikrotik-vmlinux-initramfs.elf to /tftp/ Copy openwrt-ar71xx-mikrotik-vmlinux-initramfs.elf to /tftp/
 Create script: nano /​tftp/​loader.sh Create script: nano /​tftp/​loader.sh
Line 32: Line 35:
   --enable-tftp --tftp-root=/​home/​user/​mikrotik/​trunk/​bin/​ar71xx/​ -d -u test -p0 -K --log-dhcp --bootp-dynamic   --enable-tftp --tftp-root=/​home/​user/​mikrotik/​trunk/​bin/​ar71xx/​ -d -u test -p0 -K --log-dhcp --bootp-dynamic
 Run script loader.sh Run script loader.sh
-Unplug power jack +Reboot RB951ui as described above
-Hold reset button  +
-Plug power jack +
-After beep unhold reset button+
  
-=== Flash OpenWRT to Mikrotik === +=== Flash OpenWRT to Mikrotik ​via wget2nand ​=== 
-ToDo +Copy openwrt-ar71xx-mikrotik-vmlinux-lzma.elf ​and openwrt-ar71xx-mikrotik-rootfs.tar.gz ​to a HTTP/HTTPs server reachable from the RB951ui (Port 1/Wan or Port2..5). Connect to the router via telnet ​to 192.168.1.1 ​(or Uart if you soldered a serial console). Example: http://​myhttpserver.org/​path/​openwrt-ar71xx-mikrotik-vmlinux-lzma.elf 
-To flash openwrt-ar71xx-nand-vmlinux-lzma.elf ​you must copy OpenWrt image to /tmpthen login into router via telnet 192.168.1.1 or Uart+  root@OpenWrt:/#​ wget2nand http://​myhttpserver.org/​path 
 +Reboot. 
 + 
 +=== Initial setup === 
 + 
 +== Leds == 
 + 
 +Add these lines to /​etc/​config/​system 
 + 
 +  config led '​act'​ 
 +        option trigger '​netdev'​ 
 +        option mode 'link tx rx' 
 +        option sysfs '​rb:​green:​act'​ 
 +        option name '​ACT'​ 
 +        option dev '​eth1'​ 
 +        option brightness '​0'​ 
 +        option default '​0'​ 
 +  config led '​p1'​ 
 +        option trigger '​netdev'​ 
 +        option name '​Port_1'​ 
 +        option sysfs '​rb:​green:​port1'​ 
 +        option dev '​eth0'​ 
 +        option mode 'link tx rx' 
 +        option default '​0'​ 
 +  config led '​p2'​ 
 +        option trigger '​switch0'​ 
 +        option name '​Port_2'​ 
 +        option sysfs '​rb:​green:​port2'​ 
 +        option port_mask '​0x10'​ 
 +        option default '​0'​ 
 +  config led '​p3'​ 
 +        option name '​Port_3'​ 
 +        option sysfs '​rb:​green:​port3'​ 
 +        option trigger '​switch0'​ 
 +        option port_mask '​0x8'​ 
 +        option default '​0'​ 
 +  config led '​p4'​ 
 +        option name '​Port_4'​ 
 +        option trigger '​switch0'​ 
 +        option sysfs '​rb:​green:​port4'​ 
 +        option port_mask '​0x4'​ 
 +        option default '​0'​ 
 +  config led '​p5'​ 
 +        option name '​Port_5'​ 
 +        option sysfs '​rb:​green:​port5'​ 
 +        option trigger '​switch0'​ 
 +        option port_mask '​0x2'​ 
 +        option default '​0'​ 
 +  config led '​wlan'​ 
 +        option sysfs '​rb:​green:​wlan'​ 
 +        option name '​WLAN'​ 
 +        option trigger '​phy0tpt'​ 
 +        option default '​0'​ 
 + 
 +There is a red led on port 5, which seems to be some indication of PoE (or lack of, not sure). By default it's always on. You can turn it off with the following command. You can put it in /​etc/​rc.local 
 + 
 +  echo 0 > /​sys/​devices/​virtual/​gpio/​gpio2/​value 
 + 
 +In /​etc/​config/​network,​ add these lines to enable the built-in ethernet switch between borts 2..5. 
 + 
 +  config switch '​eth1'​ 
 +        option enable '​1'​ 
 +         
 +You are done. The following sections explain optional / alternative steps. 
 + 
 +== Serial console == 
 + 
 +If you solder the UART pins on the board, you can enable the serial console, adding this line to /​etc/​inittab:​ 
 + 
 +  ttyS0::​askfirst:/​bin/​ash --login 
 + 
 +== Example VLAN configuration for switch ports == 
 + 
 +In /​etc/​config/​network,​ add these lines to enable the switch, and create 2 vlan interfaces (eth1.11 and eth1.12). The first for ports 5 and 4, and the later for ports 3 and 2. Port 1 on the router is eth0. 
 + 
 +  config switch '​eth1'​ 
 +        option enable '​1'​ 
 +        option enable_vlan '​1'​ 
 +  config switch_vlan 
 +        option device '​eth1'​ 
 +        option vlan '​11'​ 
 +        option vid '​11'​ 
 +        option ports '0t 1 2' 
 +  config switch_vlan 
 +        option device '​eth1'​ 
 +        option vlan '​12'​ 
 +        option vid '​12'​ 
 +        option ports '0t 3 4' 
 +         
 +=== Flash OpenWRT to Mikrotik manually === 
 + 
 +If wget2nand encounters problems, perform its steps manually from shell:
   root@OpenWrt:/#​ passwd   root@OpenWrt:/#​ passwd
   root@OpenWrt:/#​ mtd erase /dev/mtd1   root@OpenWrt:/#​ mtd erase /dev/mtd1
Line 58: Line 149:
   root@OpenWrt:/#​ cd /   root@OpenWrt:/#​ cd /
   root@OpenWrt:/#​ umount /mnt/rootfs   root@OpenWrt:/#​ umount /mnt/rootfs
 +  root@OpenWrt:/#​ sync
 +Reboot
 +  ​
 +=== Compile OpenWRT yourself ===
 +This section was written before the rb951ui was supported by released OpenWRT images. You only need this section if you plan to not use those supported images.
 +  $ mkdir /​home/​user/​mikrotik/​
 +  $ cd /​home/​user/​mikrotik/​
 +  $ svn co -r 39392 svn://​svn.openwrt.org/​openwrt/​trunk/​
 +  $ cd /​home/​user/​mikrotik/​trunk
 +  $ wget -c http://​patchwork.openwrt.org/​patch/​4773/​raw/​ -O OpenWrt-Devel-ar71xx-Add-support-for-MikroTik-RB951Ui-2HnD.patch
 +  $ patch -u -p0 < OpenWrt-Devel-ar71xx-Add-support-for-MikroTik-RB951Ui-2HnD.patch
 +// Configure image for booting from RAM //
 +  $ make menuconfig
 +  $ make kernel_menuconfig
 +''​ Target = AR7XXX
 + ​Subtarget = Mikrotik device with NAND flash
 + ​Target Images = ramdisk''​
 +  $ make V=s
 +// Configure image for booting from NAND //
 +  $ make menuconfig
 +''​ Target = AR7XXX
 + ​Subtarget = Mikrotik device with NAND flash
 + ​Target Images = tar.gz''​
 +  $ make V=s
 +After compiling your image, go back to the section for Booting to OepnWrt in RAM.
 +If your image predates 14.07, you may also need to install the WiFi driver (Install kmod-ath9k).
  
 ''​About:​ ''​About:​
toh/mikrotik/rb951ui.1393117629.txt.bz2 · Last modified: 2014/02/23 02:07 (external edit)