User Tools

Site Tools


toh:mikrotik:rb450g

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:rb450g [2014/02/25 14:58]
toh:mikrotik:rb450g [2015/07/15 04:00] (current)
jansegre [Install the OpenWRT distribution]
Line 1: Line 1:
-====== Mikrotik RouterBoard ​450G (RB-450G) ​======+====== Mikrotik RouterBoard ​RB450G ​======
  
-The good news: Attitude Adjustment 12.09 works very well on the RB-450G. ​ The device is built with good hardware, almost all of which is fully supported. ​ The switch chipset (Atheros AR8316) however does not provide support for mixing tagged and untagged VLAN's on the same port. With a fast processor, gigabit ethernet, and relatively huge amounts of RAM and flash, this is a very capable device once OpenWRT is installed+The good news: Barrier Breaker 14.07 works very well on the RB-450G. ​ The device is built with good hardware, almost all of which is fully supported. ​ The switch chipset (Atheros AR8316) however does not provide support for mixing tagged and untagged VLAN's on the same port. With a fast processor, gigabit ethernet, and relatively huge amounts of RAM and flash, this is a very capable device once OpenWRT is installed.
- +
-The bad news: getting OpenWRT installed in the first place is not straightforward.+
  
 +The bad news: getting OpenWRT installed in the first place is not straightforward (but almost).
 ===== Installing a New Firmware Image ===== ===== Installing a New Firmware Image =====
-OpenWRT doesn'​t provide a firmware image that can be written directly to the flash memory via the firmware update system in Mikrotik'​s RouterOS. ​ So installing OpenWRT is a two step process that requires two separate kernel images. 
  
-You're going to need computer ​that can build OpenWRT ​from source You'​re ​also going to need a desktop computer that has a working serial port and an ethernet interface. ​ This computer will also need to have:+OpenWrt doesn't provide ​firmware image that can be written directly to the flash memory via the firmware update system in Mikrotik'​s RouterOS. ​ So installing ​OpenWRT ​is a two step process that requires two separate kernel images. 
 + 
 +You're going to need a desktop computer that has a working serial port (or adapter) ​and an ethernet interface. ​ This computer will also need to have:
   * some kind of serial terminal software   * some kind of serial terminal software
   * a DHCP server; this documentation will use ''​dnsmasq''​   * a DHCP server; this documentation will use ''​dnsmasq''​
   * a TFTP server; also ''​dnsmasq''​   * a TFTP server; also ''​dnsmasq''​
  
-The following instructions illustrate installing ​Attitude Adjustment 12.09, but should be easily adaptable to other versions.+The following instructions illustrate installing ​Barrier Breaker 14.07, but should be easily adaptable to newer versions. For Attitude Adjustment 12.09 and previous it is required to build OpenWrt from source.
  
-==== Create ​a netboot image for the RB450G ==== +==== Download ​a netboot image for the RB450G ====
-  - [[doc/​howto/​buildroot.exigence|Get the OpenWRT source code]] +
-  - You could configure the system entirely by hand, but it's easier to just start with an [[http://​downloads.openwrt.org/​attitude_adjustment/​12.09/​ar71xx/​nand/​config.ar71xx_nand|existing configuration]] that works for the RB450G. +
-    * [[http://​www.pitt-pladdy.com/​blog/​_20101117-184005_0000_OpenWrt_on_RB450G_for_AAISP_FTTC/​rb450g-netboot.config|here]] is a smaller configuration made for Backfire (r24027). ​ It will not take as long to compile as the default OpenWRT configuration,​ and works fine for Attitude Adjustment 12.09-rc1.  +
-  - Configure the system to use a ramdisk:<​code>​ +
-Target Images ​ ---> +
-    [*] ramdisk</​code>​ +
-  - [[doc/​howto/​build|Build OpenWRT from source]] +
-  - The build will create the file ''​bin/​ar71xx/​openwrt-ar71xx-nand-vmlinux-initramfs-lzma.elf''​. ​ This is the kernel+ramdisk that the RB450G will use to boot. +
- +
-TODO: is it possible to directly combine a kernel and the rootfs provided by OpenWRT? ​ This would get around needing to build an image from source.+
  
 +https://​downloads.openwrt.org/​barrier_breaker/​14.07/​ar71xx/​mikrotik/​openwrt-ar71xx-mikrotik-vmlinux-initramfs-lzma.elf should be OK.
 ==== Boot the RB450G from the network ==== ==== Boot the RB450G from the network ====
 +
   - Connect the ethernet adapter of your desktop computer to Eth1 of the RB450G using either a straight or crossover cable. ​ The RB450G will figure out the crossover on its own.   - Connect the ethernet adapter of your desktop computer to Eth1 of the RB450G using either a straight or crossover cable. ​ The RB450G will figure out the crossover on its own.
   - Manually assign an IPv4 address (anything other than 192.168.1.1,​ or anything in the range of IPs used in your local LAN) to the ethernet adapter on your desktop computer. ​ Here I'll use ''​10.2.3.4''​.   - Manually assign an IPv4 address (anything other than 192.168.1.1,​ or anything in the range of IPs used in your local LAN) to the ethernet adapter on your desktop computer. ​ Here I'll use ''​10.2.3.4''​.
   - Set up ''​dnsmasq''​ on the desktop computer.   - Set up ''​dnsmasq''​ on the desktop computer.
     - The RB450G'​s bootloader apparently ignores all DHCP options, such as ''​tftp-server''​ or ''​bootp-filename'',​ normally used to instruct a netboot device how to find its image. ​ So you need to set up ''​dnsmasq''​ with specific options to work around this quirk.     - The RB450G'​s bootloader apparently ignores all DHCP options, such as ''​tftp-server''​ or ''​bootp-filename'',​ normally used to instruct a netboot device how to find its image. ​ So you need to set up ''​dnsmasq''​ with specific options to work around this quirk.
-    - Copy the file ''​openwrt-ar71xx-nand-vmlinux-initramfs-lzma.elf'' ​from your OpenWRT build tree to a clean directory like ''​~/​tftproot/''​. ​ Rename the file to ''​vmlinux''​.+    - Copy the file ''​openwrt-ar71xx-mikrotik-vmlinux-initramfs-lzma.elf''​ to a clean directory like ''​~/​tftproot/''​. ​ Rename the file to ''​vmlinux'' ​(this helps when testing other images).
     - Run ''​sudo dnsmasq -a 10.2.3.4 -z -d -p 0 -F 10.2.3.5,​10.2.3.6 --enable-tftp --tftp-root=~/​tftproot/​ --dhcp-boot=~/​tftproot/​vmlinux''​.     - Run ''​sudo dnsmasq -a 10.2.3.4 -z -d -p 0 -F 10.2.3.5,​10.2.3.6 --enable-tftp --tftp-root=~/​tftproot/​ --dhcp-boot=~/​tftproot/​vmlinux''​.
     - ''​dnsmasq''​ should start in the foreground writing all its output to the terminal; you're only going to run it temporarily,​ and having the debugging information may come in handy.     - ''​dnsmasq''​ should start in the foreground writing all its output to the terminal; you're only going to run it temporarily,​ and having the debugging information may come in handy.
  
-  - Connect the serial port of your desktop computer to the serial port of your RB450G using a [[wp>​null modem cable]]. ​ Start your terminal server program. ​ The RB450G serial interface uses 8N1 with hardware flow control at 115200 bps.+  - Connect the serial port of your desktop computer to the serial port of your RB450G using a [[wp>​null modem cable]]. ​ Start your terminal server program. ​ The RB450G serial interface uses 8N1 with hardware flow control at 115200 bps (which is the default, but it can be configured through various means).
  
-TIP: Try setting hardware flow control to off if you can't get to the bootloader menu (i.e. it always times out without detecting a key press). If using minicom, try ''​minicom -o --color=on --device=/​dev/​ttyS#'',​ then once minicom opens, type ''​CONTROL A Z''​ and find your way to disable hardware flow control. To figure out which ttyS device you should use, the command ''​dmesg | grep ttyS''​ can be helpful.+TIP: Try setting hardware flow control to off if you can't get to the bootloader menu (i.e. it always times out without detecting a key press). If using minicom, try ''​minicom -o --color=on --device=/​dev/​ttyS#'',​ then once minicom opens, type ''​CONTROL A Z''​ and find your way to disable hardware flow control. ​Or try ''​screen /dev/ttyS# 115200'' ​To figure out which ttyS device you should use, the command ''​dmesg | grep ttyS''​ can be helpful.
  
   - Power up the RB450G. ​ Immediately hit any key to go to the bootloader menu:<​code>​   - Power up the RB450G. ​ Immediately hit any key to go to the bootloader menu:<​code>​
Line 55: Line 47:
   t - do memory testing   t - do memory testing
   x - exit setup</​code>​   x - exit setup</​code>​
-  - Select ''​o - boot device''​ and then select ''​1''​ to boot once from the network, and then boot from the nand after that.  Hit ''​x''​ to exit setup+  ​- Select ''​p - boot protocol''​ and then select ''​2 - dhcp protocol'',​ because bootp (default) does not support dynamic address. 
-  - The RB450G will reboot. ​ Let the bootloader menu time out, and it should get an address via DHCP and then load the netboot image from your desktop computer. ​ After a minute or so, you should be able to hit <​enter>​ and get to the OpenWRT prompt.+  ​- Select ''​o - boot device''​ and then select ''​1 ​- boot Ethernet once, then NAND''​ to boot once from the network, and then boot from the nand after that. 
 +  Hit ''​x''​ to exit setup, the RB450G will reboot. ​ Let the bootloader menu time out, and it should get an address via DHCP and then load the netboot image from your desktop computer. ​ After a minute or so, you should be able to hit <​enter>​ and get to the OpenWRT prompt.
  
 ==== Install the OpenWRT distribution ==== ==== Install the OpenWRT distribution ====
   - Don't bother configuring anything while in netboot. ​ Any changes you make won't be written back to the original image, so they'​ll all be lost when you reboot anyway.   - Don't bother configuring anything while in netboot. ​ Any changes you make won't be written back to the original image, so they'​ll all be lost when you reboot anyway.
-  - You can disconnect the ethernet connection between your RB450G and your desktop system **Do not disconnect the serial connection.** +  - You can disconnect the ethernet connection between your RB450G and your desktop system ​but  **Do not disconnect the serial connection.**. 
-  - Wipe out any network self-configuration that the RB450 has done: ''​ifconfig eth0 down''​ and ''​ifconfig br-lan down''​. ​ While not absolutely necessary, I suggest doing this so that anything that the RB450G has done on its own doesn'​t conflict with your existing LAN setup+  - Now you'll need to establish a connection between the RB450G and the internet so that it can download the OpenWRT packages it needs for installation. ​ Since personal LANs vary so much, I will leave this as an exercise to the reader ​(on my setup I chose to provide internet through the same desktop used to netboot it).
-  - Now you'll need to establish a connection between the RB450G and the internet so that it can download the OpenWRT packages it needs for installation. ​ Since personal LANs vary so much, I will leave this as an exercise to the reader. +
  
     * Use Eth0/PoE port to connect the RB450G to your local LAN because the netboot image will only have this port with a dynamic DHCP config. All other ports are static to 192.168.1.1,​ so they will require further configuration changes which are pointless at this stage given that anything you do to your system now will not be persisted;     * Use Eth0/PoE port to connect the RB450G to your local LAN because the netboot image will only have this port with a dynamic DHCP config. All other ports are static to 192.168.1.1,​ so they will require further configuration changes which are pointless at this stage given that anything you do to your system now will not be persisted;
-    * You may need to change the dns nameserver by editing the file ''/​etc/​resolv.conf''​ (''​vi /​etc/​resolv.conf''​). Replace 127.0.0.1 with 8.8.8.8 or any other public dns server. ​For vi beginners: once the file is open type ''​*i'' ​to enter editing mode and when done type ''​ESC''​ and then '':​wq'';​+    * You may need to change the dns nameserver by editing the file ''/​etc/​resolv.conf''​ (''​vi /​etc/​resolv.conf''​). Replace 127.0.0.1 with 8.8.8.8 or any other public dns server. ''​rm /​etc/​resolv.conf;​ echo nameserver 8.8.8.8 > /​etc/​resolv.conf'' ​will do it.
     * Issue the command ''/​etc/​init.d/​network restart''​ so all configuration changes are reloaded and applied;     * Issue the command ''/​etc/​init.d/​network restart''​ so all configuration changes are reloaded and applied;
-    * Try ''​ping ​bing.com''​ and see if it works;+    * Try ''​ping ​openwrt.org''​ and see if it works;
     * If networking is not okay, try editing ''/​etc/​config/​network''​ to your needs and remember to ''/​etc/​init.d/​network restart''​ after you make any changes;     * If networking is not okay, try editing ''/​etc/​config/​network''​ to your needs and remember to ''/​etc/​init.d/​network restart''​ after you make any changes;
-    ​ + 
-  - Once the internet connection is established,​ use the ''​wget2nand''​ script to install OpenWRT into the flash of the RB450G: ''​wget2nand http://​downloads.openwrt.org/​attitude_adjustment/12.09/ar71xx/nand/''​. +  - There is a small quirk now, you'll have to edit wget2nand to download the right rootfs, in our case it is the DefaultNoWifi one.  So ''​sed -i '​s/​openwrt-ar71xx-mikrotik-rootfs.tar.gz/​openwrt-ar71xx-mikrotik-DefaultNoWifi-rootfs.tar.gz/​g'​ $(which wget2nand)''​ will do it. 
-  - Once ''​wget2nand''​ finishes, you can reboot the router. ​ This time, the router should boot from flash and give you a working OpenWRT installation that you can configure as you like.+  - Once the internet connection is established,​ use the ''​wget2nand''​ script to install OpenWRT into the flash of the RB450G: ''​wget2nand http://​downloads.openwrt.org/​barrier_breaker/14.07/ar71xx/mikrotik''​. 
 +  - Once ''​wget2nand''​ finishes, you can reboot the router. ​ This time, the router should boot from flash (since we chose try ethernet once and then nand) and give you a working OpenWRT installation that you can configure as you like.
  
 ====== Hardware ====== ====== Hardware ======
toh/mikrotik/rb450g.1393336688.txt.bz2 · Last modified: 2014/02/25 14:58 (external edit)