1. Update firmware on your device
Installing OpenWrt this web site has 4 methods for us to do updating. Because my TL-WR1043ND is brand new one, I choose the simplest of method 1: via orginal firmware.
- Download image (v1.8)
- Change your PC ip address to 192.168.1.2
- Connect to the switch with LAN port
- Browse http://192.168.1.1
- Choose function "update firmware" with the image bin file
2. Modify Configuration
- Login to 192.168.1.1 using telnet
- Setup your controller ip address (my controller ip is 192.168.1.244)
- vi /etc/config/openflow
config 'ofswitch'
option 'dp' 'dp0'
option 'dpid' '000000000011'
option 'ofports' 'eth0.0 eth0.1 eth0.2 eth0.3 '
option 'ofctl' 'tcp:192.168.1.244:6633'
option 'mode' 'outofband'
- Setup your network configuration and setup this switch ip address (my switch ip is 192.168.1.11)
- vi /etc/config/network and paste the following lines
config 'switch'
option 'name' 'rtl8366rb'
option 'reset' '1'
option 'enable_vlan' '1'
option 'enable_learning' '0'
config 'switch_vlan'
option 'device' 'rtl8366rb'
option 'vlan' '1'
option 'ports' '1 5t'
config 'switch_vlan'
option 'device' 'rtl8366rb'
option 'vlan' '2'
option 'ports' '2 5t'
config 'switch_vlan'
option 'device' 'rtl8366rb'
option 'vlan' '3'
option 'ports' '3 5t'
config 'switch_vlan'
option 'device' 'rtl8366rb'
option 'vlan' '4'
option 'ports' '4 5t'
config 'switch_vlan'
option 'device' 'rtl8366rb'
option 'vlan' '5'
option 'ports' '0 5t'
config 'interface' 'loopback'
option 'ifname' 'lo'
option 'proto' 'static'
option 'ipaddr' '127.0.0.1'
option 'netmask' '255.0.0.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'
config 'interface'
option 'ifname' 'eth0.5'
option 'proto' 'static'
option 'ipaddr' '192.168.1.11'
option 'netmask' '255.255.255.0'
option 'name' 'rtl8366rb'
option 'reset' '1'
option 'enable_vlan' '1'
option 'enable_learning' '0'
config 'switch_vlan'
option 'device' 'rtl8366rb'
option 'vlan' '1'
option 'ports' '1 5t'
config 'switch_vlan'
option 'device' 'rtl8366rb'
option 'vlan' '2'
option 'ports' '2 5t'
config 'switch_vlan'
option 'device' 'rtl8366rb'
option 'vlan' '3'
option 'ports' '3 5t'
config 'switch_vlan'
option 'device' 'rtl8366rb'
option 'vlan' '4'
option 'ports' '4 5t'
config 'switch_vlan'
option 'device' 'rtl8366rb'
option 'vlan' '5'
option 'ports' '0 5t'
config 'interface' 'loopback'
option 'ifname' 'lo'
option 'proto' 'static'
option 'ipaddr' '127.0.0.1'
option 'netmask' '255.0.0.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'
config 'interface'
option 'ifname' 'eth0.5'
option 'proto' 'static'
option 'ipaddr' '192.168.1.11'
option 'netmask' '255.255.255.0'
3. Restart networking to enable your changes
/etc/init.d/network restart
- Connect your Ethernet cable from LAN port to WAN port
- Start any kind of Trema app
- for instance : ./trema run ./objects/examples/learning_switch/learning_switch
- Show switch description
- TREMA_HOME=`pwd` ../apps/show_description/show_description
- And then we can get the information as follows:
Manufacturer description: Stanford University
Hardware description: Reference Userspace Switch
Software description: 1.0.0
Serial number: None
Human readable description of datapath: OpenWrt pid=1933
Datapath ID: 0x11
Port no: 1(0x1)(Port up)
Hardware address: 90:f6:52:89:c9:d0
Port name: eth0.1
Port no: 2(0x2)(Port up)
Hardware address: 90:f6:52:89:c9:d0
Port name: eth0.2
Port no: 3(0x3)(Port up)
Hardware address: 90:f6:52:89:c9:d0
Port name: eth0.3
Port no: 4(0x4)(Port up)
Hardware address: 90:f6:52:89:c9:d0
Port name: eth0.4
Hardware description: Reference Userspace Switch
Software description: 1.0.0
Serial number: None
Human readable description of datapath: OpenWrt pid=1933
Datapath ID: 0x11
Port no: 1(0x1)(Port up)
Hardware address: 90:f6:52:89:c9:d0
Port name: eth0.1
Port no: 2(0x2)(Port up)
Hardware address: 90:f6:52:89:c9:d0
Port name: eth0.2
Port no: 3(0x3)(Port up)
Hardware address: 90:f6:52:89:c9:d0
Port name: eth0.3
Port no: 4(0x4)(Port up)
Hardware address: 90:f6:52:89:c9:d0
Port name: eth0.4