Saturday, November 8, 2014

MR3020 Configuration After Installing a Snapshot

The MR3020 is a really neat and cheap router with a ton of capability if it's running Openwrt.  There have been a few formal releases over the past couple of years that are now considered obsolete.  The packages that are available to those releases are hardly ever upgraded as they were designed to work as they were at the time of the release.  If one would like to acquire and use the latest packages available to the Openwrt line, they would have to install a snapshot.  A snapshot is a nightly build of the very active Openwrt source.  These snapshots can be very unstable and possibly unusable, but the tradeoff can be worth it.  For me it was since I use dnsmasq a lot.
If you install a snapshot version on your router, you will not have luci.  This means everything has to be done by hand.  Here is how you do it on a MR3020.

Here are all of the packages currently installed with my snapshot:

base-files - 156-r43124
busybox - 1.22.1-3
dnsmasq - 2.72-1
dropbear - 2014.65-2
firewall - 2014-09-19
fstools - 2014-10-27-d71297353dc45eaf8f7c252246490746708530f9
hostapd-common - 2014-10-25-1
ip6tables - 1.4.21-1
iptables - 1.4.21-1
iw - 3.15-1
iwinfo - 2014-10-27.1-d5dc3d0605f76fbbbad005d998497e53a236aeda
jshn - 2014-10-14-464e05e33b4c086be0bd932760a41ddcf9373187
jsonfilter - 2014-06-19-cdc760c58077f44fc40adbbe41e1556a67c1b9a9
kernel - 3.10.58-1-8ba75c28f46d1c58a922f1e15f98d811
kmod-ath - 3.10.58+2014-10-08-1
kmod-ath9k - 3.10.58+2014-10-08-1
kmod-ath9k-common - 3.10.58+2014-10-08-1
kmod-cfg80211 - 3.10.58+2014-10-08-1
kmod-crypto-aes - 3.10.58-1
kmod-crypto-arc4 - 3.10.58-1
kmod-crypto-core - 3.10.58-1
kmod-gpio-button-hotplug - 3.10.58-1
kmod-ip6tables - 3.10.58-1
kmod-ipt-conntrack - 3.10.58-1
kmod-ipt-core - 3.10.58-1
kmod-ipt-nat - 3.10.58-1
kmod-ipv6 - 3.10.58-1
kmod-ledtrig-usbdev - 3.10.58-1
kmod-lib-crc-ccitt - 3.10.58-1
kmod-mac80211 - 3.10.58+2014-10-08-1
kmod-nf-conntrack - 3.10.58-1
kmod-nf-conntrack6 - 3.10.58-1
kmod-nf-ipt - 3.10.58-1
kmod-nf-ipt6 - 3.10.58-1
kmod-nf-nat - 3.10.58-1
kmod-nf-nathelper - 3.10.58-1
kmod-nls-base - 3.10.58-1
kmod-ppp - 3.10.58-1
kmod-pppoe - 3.10.58-1
kmod-pppox - 3.10.58-1
kmod-slhc - 3.10.58-1
kmod-usb-core - 3.10.58-1
kmod-usb-ohci - 3.10.58-1
kmod-usb2 - 3.10.58-1
libblobmsg-json - 2014-10-14-464e05e33b4c086be0bd932760a41ddcf9373187
libc - 0.9.33.2-1
libgcc - 4.8-linaro-1
libip4tc - 1.4.21-1
libip6tc - 1.4.21-1
libiwinfo - 2014-10-27.1-d5dc3d0605f76fbbbad005d998497e53a236aeda
libjson-c - 0.11-2
libjson-script - 2014-10-14-464e05e33b4c086be0bd932760a41ddcf9373187
libnl-tiny - 0.1-3
libubox - 2014-10-14-464e05e33b4c086be0bd932760a41ddcf9373187
libubus - 2014-09-17-4c4f35cf2230d70b9ddd87638ca911e8a563f2f3
libuci - 2014-04-11.1-1
libxtables - 1.4.21-1
mtd - 20
netifd - 2014-10-24-b46a8f3b9794efed197ffd2f6f62eb946de5f235
odhcp6c - 2014-10-25-940e2141ab13727af6323c4d30002f785e466318
odhcpd - 2014-10-18-b461334ab277b6e8fd1622ab7c8a655363bd3f6c
opkg - 9c97d5ecd795709c8584e972bfdf3aee3a5b846d-7
ppp - 2.4.7-3
ppp-mod-pppoe - 2.4.7-3
procd - 2014-10-30-07c7864d49723b1264ee8bcd6861ea92f679ee98
swconfig - 10
uboot-envtools - 2014.07-1
ubox - 2014-10-06-0b274c16a3f9d235735a4b84215071e1e004caa9
ubus - 2014-09-17-4c4f35cf2230d70b9ddd87638ca911e8a563f2f3
ubusd - 2014-09-17-4c4f35cf2230d70b9ddd87638ca911e8a563f2f3
uci - 2014-04-11.1-1
wpad-mini - 2014-10-25-1

You will notice luci is absent.

Here we go:

  1. First, here is the default configuration:
    1. The ethernet is configured with a dhcp server with a lan'd firewall with a static ip of 192.168.1.1
    2. The wifi is disabled and is not configured
      1. The default configuration for the enabled wireless interface is an access point, we need to get access to the internet so we can update and install the packages available to us in order to get luci.
      2. It is much easier to setup the wireless as a client with a wan and a gateway then to use the ethernet in the same manner since the majority is already setup to do so.
    3. The sliding switch (AP, WISP, 3G) is not active and currently does not serve a purpose besides allowing for a method to resort in a "failsafe" mode upon booting
  2. Connect your computer through ethernet is if it were a typical client accepting a dhcp lease
  3. Telnet to the static ip and change the root password by doing the following
    1. telnet 192.168.1.1
    2. passwd 
      1. enter the desired password
    3. exit
  4. Now ssh into the router by doing the following
    1. ssh root@192.168.1.1
    2. enter the password
  5. We are now in the router and will begin performing the configuration
  6. Enable the wireless
    1. vim /etc/config/wireless
    2. comment or delete the line that has "enabled 0"
    3. wifi down; wifi up
    4. The wifi has a default configuration as an access point
    5. see configuration below
  7. Setup the network configuration for the wireless as a client to get internet
    1. vim /etc/config/network
    2. see configuration below and append that to the end of the file
    3. wifi down; wifi up
  8. Setup the wireless network to interface with your external router or access point; the location where your local internet connection is coming from
    1. vim /etc/config/wireless
    2. see configuration below and edit the existing "radio0" device
    3. wifi down; wifi up
  9. Analyze the dmesg of the router.  If everything is configured correctly, you will notice that there will be a message that reads "wlan0 associated!"
  10. Verify that you are connected the internet
    1. ping google.com
      1. If you get ping responses then everything is good!
      2. If not, troubleshooting my need to take place... dmesg is your friend in this case
    2. opkg update
  11. We are now connected to the internet. You have 2 options at this point:
    1. You can read my previous post on how to make an extroot filesystem to allow more space for packages
    2. You can go ahead and install luci and luci-ssl (both are required in order for it to work correctly) and risk the possibility of a completely full disk
  12. With luci you can now easily configure your router
  13. As mentioned in my previous post on how to extroot your filesystem, you can restore the defaults if you screw up somehow by simply entering "firstboot"
  14. Finished!

Network file configuration to enable the wan firewall configuration for the client router with a couple of my favorite dns servers to get the best results (open dns and google):

config interface 'wan'       
        option ifname 'wlan0'
        option proto 'dhcp'
        option peerdns '0'   
        option dns '208.67.222.222 208.67.220.220 8.8.8.8 8.8.4.4'


Second wifi configuration for associating wireless with access point or router. This is configured to be a client (mode sta) to my wpa2 encrypted (encryption psk2) access point with a wan'd firewall and no dhcp since it will be accepting an ip lease (network wan):

config wifi-device 'radio0'               
        option type 'mac80211'            
        option channel '11'               
        option hwmode '11g'               
        option path 'platform/ar933x_wmac'
        option htmode 'HT20'    
                                
config wifi-iface               
        option device 'radio0'  
        option network 'wan'    
        option mode 'sta'       
        option ssid 'yourwifiSSIDhere' 
        option encryption 'psk2'                                    
        option key 'yourpasswordhere' 


Finished, enjoy! I hope this helped somebody and if you need any help with any of the above steps I'll the best I can to assist.

No comments:

Post a Comment