Differences

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

toh:ubiquiti:unifi [2013/03/15 12:08]
phuybre
toh:ubiquiti:unifi [2014/06/14 05:51] (current)
deeraeya
Line 24: Line 24:
===== Status ===== ===== Status =====
Since [[https://dev.openwrt.org/changeset/23904|r23904]] this device is supported in trunk and in future stable release.\\ Since [[https://dev.openwrt.org/changeset/23904|r23904]] this device is supported in trunk and in future stable release.\\
-At the moment it isn't part of any stable release!+12.09 includes this AP as stable
===== Installing a new Firmware Image ===== ===== Installing a new Firmware Image =====
-  - Login inside the AP with ssh.+  - Device get IP address from DHCP 
 +  - Login inside the AP with ssh ubnt@ip_address (password ubnt)
  - Find the image like "openwrt-ar71xx-ubnt-unifi-*-factory.bin" on openwrt binary repository and download inside /tmp.   - Find the image like "openwrt-ar71xx-ubnt-unifi-*-factory.bin" on openwrt binary repository and download inside /tmp.
  - Use the ubiquity fwupgrade utils to reflash it: <code>   - Use the ubiquity fwupgrade utils to reflash it: <code>
Line 33: Line 35:
</code> </code>
-fwupdate.real can complain about the version of the firmware image, because it is built with prefix "XM" instead of the "BZ" of the unifi image. To change you will have to download the OpenWRT Image builder, patch the Makefile at target/linux/ar71xx/image (replace XM with BZ around line 844: +fwupdate.real can complain about the version of the firmware image, because it is built with prefix "XM" instead of the "BZ" of the unifi image (trunk r38381 works). To change you will have to download the OpenWRT Image builder, patch the Makefile at target/linux/ar71xx/image (replace XM with BZ around line 844:
<code>$(eval $(call SingleProfile,UBNTXM,$(fs_64k),UBNTUNIFI,ubnt-unifi,UBNT-UF,ttyS0,115200,XM,BZ,ar7240)) <code>$(eval $(call SingleProfile,UBNTXM,$(fs_64k),UBNTUNIFI,ubnt-unifi,UBNT-UF,ttyS0,115200,XM,BZ,ar7240))
make image PROFILE=UBNTUNIFI </code> make image PROFILE=UBNTUNIFI </code>
Line 96: Line 98:
</code> </code>
    - blinking off: <code shell>echo 0 > /sys/class/leds/ubnt\:orange\:dome/delay_off</code>     - blinking off: <code shell>echo 0 > /sys/class/leds/ubnt\:orange\:dome/delay_off</code>
 +
 +====== Network configuration  (Unifi as standalone wireless Router) ======
 +
 +The UniFi has only the single ethernet port, so much of the OpenWrt documentation is a little confusing.  Most of the documentation is written with the idea of routers which have a WAN port, a LAN wired switch and the WLAN wireless.  Clearly the Unifi doesn't have the wired LAN switch.
 +
 +After flashing (I found r41163 worked while the 12.09 version had the XM problem discussed above and editing the characters 4-6 didn't fix it) I was able to connect via wired ethernet as described in FirstLogin (i.e. there is a DHCP server handing out IPs in the 192.168.1.X subnet, running on the ethernet port).
 +
 +After changing the password and exiting, I had to wait a while (60 secs?) until I could ssh back into the box. That was strange because I thought I'd lost networking ... I think that is due to a long-running first time ssh key generation.  Even so, each ssh in takes a long time to respond (something about recent versions of dropbear taking a long time to setup a session key). I found LUCI not installed, so I had to work to get internet access on the box before I could use that.
 +
 +Once ssh'd into the box I followed these steps:
 +1. Enable wireless, using commands at top of [[http://wiki.openwrt.org/doc/uci/wireless|the UCI wireless config page]]. This enables the radio.  The radio is bridged to the lan network.
 +2. Connect to the wireless network, disconnect the wired from your computer, and ensure that you can ssh in via the wifi.
 +3. Swap eth0 and eth1 between lan and wan. The default configuration has the ethernet port on the lan network.  But if you are going to plug the Unifi into a cable modem (for example) to use it as a router, then you want the ethernet port to be the wan network (and to seek a dhcp assigned address).  I edited the /etc/config/wireless file changing etho in the lan section to eth1, and eth0 in the wan section to eth1.  Quite honestly I'm not sure that this is perfect (since there isn't an eth1 on the Unifi, but it worked for me).
 +4. Restart networking (/etc/inid.d/networking restart)
 +5. Connect the ethernet lan on the PoE injector to the cable modem.  Remember nonsense about having cable modem off for 20 seconds or so to give out an IP to a new MAC address.
 +6.  Connect back to the OpenWrt Wifi.
 +7.  ping google.com.  yay.
 +
 +At this point things are working with NAT routing between the lan and the wan.
 +
 + root@OpenWrt:~# cat /etc/config/network
 +
 + config interface 'loopback'
 + option ifname 'lo'
 + option proto 'static'
 + option ipaddr '127.0.0.1'
 + option netmask '255.0.0.0'
 +
 + config globals 'globals'
 + option ula_prefix 'fd18:37f2:587f::/48'
 +
 + config interface 'lan'
 + option ifname 'eth1'
 + option force_link '1'
 + option type 'bridge'
 + option proto 'static'
 + option ipaddr '192.168.1.1'
 + option netmask '255.255.255.0'
 + option ip6assign '60'
 +
 + config interface 'wan'
 + option ifname 'eth0'
 + option proto 'dhcp'
 +
 + config interface 'wan6'
 + option ifname '@wan'
 + option proto 'dhcpv6'
 +
 + root@OpenWrt:~# ifconfig
 + br-lan    Link encap:Ethernet  HWaddr DC:9F:DB:EB:19:24
 +           inet addr:192.168.1.1  Bcast:192.168.1.255  Mask:255.255.255.0
 +           inet6 addr: fd18:37f2:587f::1/60 Scope:Global
 +           inet6 addr: 2605:6000:1018:5f::1/64 Scope:Global
 +           inet6 addr: fe80::de9f:dbff:feeb:1924/64 Scope:Link
 +           UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
 +           RX packets:35879 errors:0 dropped:0 overruns:0 frame:0
 +           TX packets:64154 errors:0 dropped:0 overruns:0 carrier:0
 +           collisions:0 txqueuelen:0
 +           RX bytes:7629054 (7.2 MiB)  TX bytes:76188963 (72.6 MiB)
 +
 + eth0      Link encap:Ethernet  HWaddr DC:9F:DB:EA:19:24
 +           inet addr:70.113.82.54  Bcast:70.113.95.255  Mask:255.255.224.0
 +           inet6 addr: 2605:6000:ffc0:60:1406:59bd:ae45:b383/128 Scope:Global
 +           inet6 addr: fe80::de9f:dbff:feea:1924/64 Scope:Link
 +           UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
 +           RX packets:88136 errors:0 dropped:1 overruns:0 frame:0
 +           TX packets:36148 errors:0 dropped:0 overruns:0 carrier:0
 +           collisions:0 txqueuelen:1000
 +           RX bytes:78402192 (74.7 MiB)  TX bytes:8333999 (7.9 MiB)
 +           Interrupt:4
 +
 + lo        Link encap:Local Loopback
 +           inet addr:127.0.0.1  Mask:255.0.0.0
 +           inet6 addr: ::1/128 Scope:Host
 +           UP LOOPBACK RUNNING  MTU:65536  Metric:1
 +           RX packets:16092 errors:0 dropped:0 overruns:0 frame:0
 +           TX packets:16092 errors:0 dropped:0 overruns:0 carrier:0
 +           collisions:0 txqueuelen:0
 +           RX bytes:1137726 (1.0 MiB)  TX bytes:1137726 (1.0 MiB)
 +
 + wlan0    Link encap:Ethernet  HWaddr DC:9F:DB:EB:19:24
 +           inet6 addr: fe80::de9f:dbff:feeb:1924/64 Scope:Link
 +           UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
 +           RX packets:35881 errors:0 dropped:0 overruns:0 frame:0
 +           TX packets:65056 errors:0 dropped:0 overruns:0 carrier:0
 +           collisions:0 txqueuelen:1000
 +           RX bytes:8131532 (7.7 MiB)  TX bytes:77645373 (74.0 MiB)
 +
 +====== Putting Unifi into failsafe mode ======
 +
 +Also useful to know how to put the Unifi into failsafe mode.  I found that connecting the ethernet PoE cable to the Unifi, but removing it from the injector, then pushing a pin into the hole next to the ethernet connection on the Unifi, digging around until you feel a button press (it seems easy to miss) and holding it down with one hand while connecting the cable into the PoE injector and then holding for about 8 seconds, until the led lights up.  When the Unifi was in failsafe I had blinking green led lights (sometimes really quickly, sometimes slowly).

Back to top

toh/ubiquiti/unifi.1363345739.txt.bz2 · Last modified: 2013/03/15 12:08 by phuybre