Converting Asus WL-500g Deluxe and TP-Link TL-WR1043ND to OpenFlow switches (Part 2)

Uploading and setting up the firmware on Asus WL-500g Deluxe router

Note:
OpenWrt wiki is wrong. You cannot upload the firmware through Asus WL-500g Deluxe web interface (aka OEM easy installation).

  1. Connect your PC’s Ethernet adapter to Asus WL-500g Deluxe router’s LAN port
  2. Set your network configuration to:
    IP address: 192.168.1.10
    Netmask: 255.255.255.0

    Note 1:
    If you want to make it in VirtualBox than you also have to set bridged networking by:

    1. Click Settings
    2. Click Network
    3. Select “Adapter 1” tab
    4. Set “Attached to:” to “Bridged Adapter”
    5. Set “Promiscuous Mode:” to “Allow All”
    6. Click OK

    Note 2:
    In Fedora 19, you can do this by:

    1. Click the network icon (top right corner)
    2. Click Network Settings
    3. Select Wired
    4. Click the setup icon (bottom right corner)
    5. Select IPv4
    6. Set Addresses to Manual
    7. Set Address to 192.168.1.10
    8. Set Netmask to 255.255.255.0
    9. Set Gateway to 192.168.1.1 (this is only required because of a Fedora 19 bug)
    10. Click Apply
    11. Set the “On” switch to “Off”
    12. Set the “Off” switch to “On”
    13. Close the windows
  3. Install a tftp client if you don’t have one
    $ sudo yum -y install tftp
  4. Disconnect the router from power
  5. Press and hold the reset button (at it’s back)
  6. Power up the Asus WL-500g Deluxe router (still holding the reset button)
  7. After the four LAN leds turn dark you can release the reset button
  8. The power led should start flashing slowly (if not try again from the disconnect part)
  9. From a terminal:
    $ tftp
    tftp> binary
    tftp> trace
    tftp> put openwrt-brcm47xx-squashfs.trx
    Wait until it finish
    tftp> quit
  10. Wait at least 2 minutes (for safety)
  11. Toggle the power
  12. Install a telnet client if you don’t have one
    Note: Yes it’s a shame, but Linux distributions are weird today.

    $ sudo yum -y install telnet
  13. Login to the router
    $ telnet 192.168.1.1
    You should get:

    Connected to 192.168.1.1.
    Escape character is '^]'.
    === IMPORTANT ============================
    Use 'passwd' to set your login password
    this will disable telnet and enable SSH
    ------------------------------------------
    BusyBox v1.15.3 (2013-11-16 00:12:17 CET) built-in shell (ash)
    Enter 'help' for a list of built-in commands.
    _______                     ________        __
    |       |.-----.-----.-----.|  |  |  |.----.|  |_
    |   -   ||  _  |  -__|     ||  |  |  ||   _||   _|
    |_______||   __|_____|__|__||________||__|  |____|
    |__| W I R E L E S S   F R E E D O M
    ---------------------------------------------------
    Backfire (10.03.x Snapshot, r33081)
    ---------------------------------------------------
    * 1/3 shot Kahlua    In a shot glass, layer Kahlua
    * 1/3 shot Bailey's  on the bottom, then Bailey's,
    * 1/3 shot Vodka     then Vodka.
    ---------------------------------------------------
    root@OpenWrt:/#
  14. Setup the router’s password
    root@OpenWrt:/# passwd

    Enter your new password 2 times.

  15. Reconnect to the router using SSH
    root@OpenWrt:/# exit
    $ ssh root@192.168.1.1

    Type “yes” for the question about the RSA key and press Enter
    Give your password and press Enter

  16. Change the network configuration
    • You can this by hand:
      root@OpenWrt:/# nano /etc/config/network

      Note:
      You may get here “Error opening terminal: xterm-256color.”
      It’s a Fedora 19 bug, type:
      root@OpenWrt:/# export TERM=xterm-color
      Correct configuration:

      #### VLAN configuration
      config switch eth0
      	option enable   1
      
      config switch_vlan eth0_0
      	option device   "eth0"
      	option vlan     0
      	option ports    "0 5"
      
      config switch_vlan eth0_1
      	option device   "eth0"
      	option vlan     1
      	option ports    "4 5"
      
      config switch_vlan eth0_2
      	option device   "eth0"
      	option vlan     2
      	option ports    "3 5"
      
      config switch_vlan eth0_3
      	option device   "eth0"
      	option vlan     3
      	option ports    "2 5"
      
      config switch_vlan eth0_4
      	option device   "eth0"
      	option vlan     4
      	option ports    "1 5"
      
      #### Loopback configuration
      config interface loopback
      	option ifname    "lo"
      	option proto    static
      	option ipaddr    127.0.0.1
      	option netmask    255.0.0.0
      
      #### LAN configuration
      config interface lan
      	option type     bridge
      	option ifname    "eth0.0"
      	option proto    static
      	option ipaddr    192.168.1.1
      	option netmask    255.255.255.0
      
      config interface
      	option ifname    "eth0.1"
      	option proto    static
      
      config interface
      	option ifname    "eth0.2"
      	option proto    static
      
      config interface
      	option ifname    "eth0.3"
      	option proto    static
      
      config interface
      	option ifname    "eth0.4"
      	option proto    static

      Press Ctrl+O, Enter than Ctrl+X to exit

    • You can do this with scp:
      Download this file with your browser: network-asus

      $ scp network-asus root@192.168.1.1:/etc/config/network

      Enter the router’s password

  17. Reboot the router
    root@OpenWrt:/# reboot
  18. Connect your PC’s Ethernet adapter to Asus WL-500g Deluxe router’s WAN port
    (this is the configuration port, and the out-of-band communication port for OpenFlow)

That’s all! From now you can install an OpenFlow controller (eg. POX). The default controller address is 192.168.1.10:6633 (which can be set in /etc/config/openflow file).

If you want to restore the factory firmware:
Restoring factory firmware on Asus WL-500g Deluxe

Jump to next: Converting Asus WL-500g Deluxe and TP-Link TL-WR1043ND to OpenFlow switches (Part 3)
Jump to previous: Converting Asus WL-500g Deluxe and TP-Link TL-WR1043ND to OpenFlow switches (Part 1)

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.