Difference between revisions of "Mesh/OpenWRT"

Jump to navigation Jump to search
8,064 bytes added ,  12:54, 15 August 2013
 
(24 intermediate revisions by 5 users not shown)
Line 43: Line 43:


  telnet 192.168.1.1
  telnet 192.168.1.1
(I've found that if you get an error here--like no path to host or connection refused--immediately after flashing, unplugging the router and plugging it back in is useful)


If it asks for a password use 'passwd' (without the quotes).
If it asks for a password use 'passwd' (without the quotes).
Line 152: Line 154:


Restart networking and you should be set.
Restart networking and you should be set.
/etc/init.d/network restart
There are a few other issues that might come up if you're trying to connect to the internet through the device. One is that 192.168.1.1 is a common ip (subnet?) for home routers. If you're connecting from your computer to your open-wrt router over 192.168.1.1 and the wifi router you're attempting to connect to is also on 192.168.1.1, there will be a (routing?) problem connecting to the internet.
One easy fix is to edit your networking config file so that the open-wrt router is on a different subnet.
vi /etc/config/network
<pre>
config interface lan
option ifname  eth0
option type    bridge
option proto  static
option ipaddr  192.168.2.1
option netmask 255.255.255.0
</pre>
If you restart networking on the device after changing your lan ip address, you will be disconnected from your terminal session. Log back in using the new ip address. (You may have to manually update your ip address on your computer).
You may need to assign yourself a new manual IP
<pre>
  sudo ifconfig eth0 192.168.2.2 netmask 255.255.255.0 up
</pre>
There may also be a need to update your nameserver.
vi /etc/resolv.conf
<pre>
search lan
nameserver 192.168.1.1
</pre>
Where 192.168.1.1 is the ip address of the wireless router you are attempting to connect to the internet over.
After making the changes, restart networking.
/etc/init.d/network restart
/etc/init.d/network restart


Line 194: Line 234:
= Router-specific notes =
= Router-specific notes =


== Ubiquiti Bullet M5 ==
== Actiontec MI424-WR ==
 
'''NOTE: The wifi adapter does not work on Attitude Adjustment on this router. It looks like it could be an incompatibility of versions between the kernel modules of the wifi driver and other kernel modules. Compiling OpenWRT manually might work'''
 
These instructions tested with the version A.
 
=== Getting the MAC address of the WLAN interface ===


Press and hold the reset button while plugging in the powered ethernet cable. Keep holding the reset button until the LED above the power LED comes on, then release the reset button.  
Turn the router off. Hook up your laptops ethernet port to the wlan port of the router. Make sure you have wireshark installed:
 
sudo apt-get install wireshark
 
Give yourself a static IP address. The easiest way is to turn off network manager and set it manually, but this will probably cause you to loose internet connectivity until you turn network manager back on.
 
sudo /etc/init.d/network-manager stop
sudo ifconfig eth0 192.168.1.2 netmask 255.255.255.0 up
 
Now start wireshark as root.
 
sudo wireshark
 
Ignore the warnings and click through any other "helpful" dialogs that pop up. In the menu, click Capture -> Options. Click the Capture textbox next eth0. Make sure the following bottom right checkboxes are ticked "Update list of packets in real time", "Automatic scrolling in live capture" and "Hide capture info dialog" and click the Start button.
 
Now turn the router on and wait for some info to show up in the window. Give it 30 seconds, then hit the stop button in wireshark (in the top menu bar, fourth button from left). Click on one of the items in the table that do not say 192.168.1.2 in the Source column. In the view below the table, there are several fields with plus-signs next to them, beginning with text like "Frame" and "Ethernet". Find the one called Ethernet II and find the stuff after the "Src:" in parenthesis that looks like "00:16:d3:2f:dd:a1" (your numbers and letters will be different). Write down those numbers and letters and colons. You may need them later. Now close wireshark.
 
Now you need to install a new RedBoot:
 
TODO (this section of the guide not yet written) see http://wiki.openwrt.org/toh/actiontec/mi424wr#jungo.openrg
 
After installing the new RedBoot:
 
With your ethernet cable still plugged into the your laptop and the wlan port of the router, and making sure you still have an ip iddress like 192.168.1.2: Turn off the router, then hold down the reset button on the router while turning the router on and continue to hold the reset button until a red light comes on (and maybe for a second longer than that), then let go. Now do:
 
telnet 192.168.1.1 9000
 
You should see a prompt like this:
 
RedBoot>
 
  TODO (this section of the guide not yet written). You basically have to start a local tftp server and use redboot to load the images into memory and create a bootscript like on the meraki mini, except you don't need serial. See http://wiki.openwrt.org/toh/actiontec/mi424wr#redboot
 
The packages to install to enable wifi (if it actually worked) are:
 
kmod-eeprom-93cx6_3.3.8-1_ixp4xx.ipk       
kmod-lib-crc-itu-t_3.3.8-1_ixp4xx.ipk       
kmod-rt2500-pci_3.3.8+2012-09-07-3_ixp4xx.ipk
kmod-rt2x00-lib_3.3.8+2012-09-07-3_ixp4xx.ipk
kmod-rt2x00-pci_3.3.8+2012-09-07-3_ixp4xx.ipk
 
== Ubiquiti ==
 
Tested and working on:
 
*Bullet M5
*Bullet 2 HP
*Picostation 2 HP
 
Press and hold the reset button while plugging in the powered ethernet cable. Keep holding the reset button. Look at the LED above the power LED. It will turn on, then turn off, then turn on again. Release the reset button when it turns on the second time.


The Bullet will now be running a TFTP server 192.168.1.20
The Bullet will now be running a TFTP server 192.168.1.20


Ensure that you have an IP address different from 192.168.1.20 and in the 192.168.1.x range and use the normal tftp flashing instructions.
Ensure that you have an IP address different from 192.168.1.20 and in the 192.168.1.x range.
 
You may want to stop network-manager (I believe Ubuntu mostly)
 
sudo /etc/init.d/network-manager stop
 
On most linux machines (assuming your ethernet interface is eth0) setting your ip address looks like this:
 
sudo ifconfig eth0 192.168.1.12 netmask 255.255.255.0 up
Afterwards do the following:
 
tftp 192.168.1.20
binary
rexmt 1
timeout 60
trace
tftp> put firmwarefile.bin
 
Where firmwarefile.bin is the name of the firmware file you want to flash.
 
Assuming you want to run Attitude Adjustment, the correct firmwares for tested routers are:
 
  Bullet M5: [http://downloads.openwrt.org/attitude_adjustment/12.09/ar71xx/generic/openwrt-ar71xx-generic-ubnt-airrouter-squashfs-factory.bin openwrt-ar71xx-generic-ubnt-airrouter-squashfs-factory.bin]
  Bullet 2 HP: [http://downloads.openwrt.org/attitude_adjustment/12.09/atheros/generic/openwrt-atheros-ubnt2-squashfs.bin openwrt-atheros-ubnt2-squashfs.bin]
  Picostation 2 HP: [http://downloads.openwrt.org/attitude_adjustment/12.09/atheros/generic/openwrt-atheros-ubnt2-pico2-squashfs.bin openwrt-atheros-ubnt2-pico2-squashfs.bin]
 
You will see a bunch of lines like this:
 
sent DATA <block=13468, 512 bytes>
received ACK <block=13468>
 
Once those lines stop coming the router will take somewhere between 1 and 7 minues to stop flashing its lights at you, then it will reboot. DO NOT unplug or turn off the router until it presents two adjacent green LEDs and has done so for 10+ seconds. On the older routers the upgrade can take much longer than on the newer routers so be patient.
 
Note, that if you're flashing AirOS instead, at least the Bullet M5 series will remember setting between firmware upgrades and others may do so too. To reset username / password / ip address and other settings to factory default, first let the router boot, then press and holde the reset button until more lights come on and release. Wait for the factory reset to complete (a minute or two) and try to access 192.168.1.1 in a browser (ensure that your own ip is in the 192.168.1.x range). Note: This procedure seems to have no effect on the Bullet 2 HP, but works on the Bullet M5. It could be that the Bullet 2 HP does not persist settings across firmware upgrades, and so doesn't have the factory reset procedure.
 
=== Ubiquiti in Windows ===
from the directory where you stored the .bin file:
 
>tftp -i 192.168.1.20 PUT openwrt-atheros-ubnt2-squashfs.bin
 
Downloads within a minute, wait about 5 minutes to finish installing...


== ARCFlex Freestation 2 ==
== ARCFlex Freestation 2 ==
Line 348: Line 486:


   sudo /etc/init.d/network-manager start
   sudo /etc/init.d/network-manager start
= OpenWRT on a VM =
For some development, it might be easier to run OpenWRT on a virtual machine. This keeps you from having to worry about a bunch of wires and carrying around a router everywhere and mostly keeps you from having to deal with flashing and some other more unpleasant stuffs.
OpenWRT has a page on how to setup a VM on virtualbox:
[http://wiki.openwrt.org/doc/howto/virtualbox OpenWRT Virtualbox HowTo]
This page has some helpful hints, especially on setting up network configurations:
[http://ediy.com.my/index.php/blog/item/31-openwrt-in-virtualbox OpenWRT in VirtualBox]
I've uploaded an already setup VM with a basic dev environment here:
[https://github.com/max-b/sudomesh-dev-vm Pre-configured VM]
The readme page should have some details on how to set it up and work around some issues.

Navigation menu