• Build the image
  • setup ACCESS POINT
  • Multiple Wan Connect

1. build image

install dependence

sudo apt-get install build-essential subversion git-core libncurses5-dev zlib1g-dev gawk flex quilt libssl-dev xsltproc libxml-parser-perl mercurial bzr ecj cvs unzip

sudo apt-get install build-essential subversion libncurses5-dev zlib1g-dev gawk gcc-multilib flex git-core gettext libssl-dev

get source code

git clone https://github.com/openwrt/openwrt.git

cd openwrt

vi openwrt/include/usb.mk

paste the following lines

define KernelPackage/usb-net-rtl8150
TITLE:=Kernel module for USB-to-Ethernet Realtek convertors
AUTOLOAD:=$(call AutoProbe,rtl8150)
$(call AddDepends/usb-net)

define KernelPackage/usb-net-rtl8150/description
Kernel module for USB-to-Ethernet Realtek 8150 convertors

$(eval $(call KernelPackage,usb-net-rtl8150))

define KernelPackage/usb-net-rtl8152
TITLE:=Kernel module for USB-to-Ethernet Realtek convertors
AUTOLOAD:=$(call AutoProbe,r8152)
$(call AddDepends/usb-net)

define KernelPackage/usb-net-rtl8152/description
Kernel module for USB-to-Ethernet Realtek 8152 USB2.0/3.0 convertors

$(eval $(call KernelPackage,usb-net-rtl8152))

config before make

make menuconfig

Target System -> Broadcom BCM27xx
subtarget -> BCM2709
Target Profile -> RPI2 model B
Base system -> unstar dnsmasq
-> * dnsmas-full
Firmwire -> * rtl8192cu
Kernel Modules -> USB Support -> *kmod-usb-net
-> *kmod-usb2

save the file as .config

run make command



burn the image to flash card by Win32 disk imager

then turn the eth0 port into dhcp mode.

vi /etc/config/network

config interface 'lan'
option type 'bridge'
option ifname 'eth0'
option proto 'dhcp'
option ipaddr ''
option netmask ''
option ip6assign '60'

plug the network cable to get an ipaddress from dhcp

The default opkg source address was wrong,we should change it

vi /etc/opkg/distfeeds.conf

src/gz designated_driver_base http://downloads.openwrt.org/snapshots/trunk/brcm2708/generic/packages/base
src/gz designated_driver_kernel http://downloads.openwrt.org/snapshots/trunk/brcm2708/generic/packages/kernel
src/gz designated_driver_packages http://downloads.openwrt.org/snapshots/trunk/brcm2708/generic/packages/packages
src/gz designated_driver_luci http://downloads.openwrt.org/snapshots/trunk/brcm2708/generic/packages/luci
src/gz designated_driver_routing http://downloads.openwrt.org/snapshots/trunk/brcm2708/generic/packages/routing
src/gz designated_driver_telephony http://downloads.openwrt.org/snapshots/trunk/brcm2708/generic/packages/telephony
src/gz designated_driver_management http://downloads.openwrt.org/snapshots/trunk/brcm2708/generic/packages/management
src/gz designated_driver_targets http://downloads.openwrt.org/snapshots/trunk/brcm2708/generic/packages/targets
update the new source

opkg update
install luci web manager interface

opkg install luci
unfortunately, by default we don't have permission to access. So we should give permit first

chmod 755 /www/cgi-bin
chmod 755 /www/luci-static
find /www -type f -exec chmod 644 {} \; # without that no css 
chmod 755 /www/cgi-bin/luci
then goes to the webpage http://RPIipaddress/ 1 goes to network-->wifi-->edit 2 enable the device and create a network named 'wlan' 3

press the save and apply button

goes to network –> interfaces –> Add new interface



config like this



then submit the changes


switch to Firewall Settings, create new zone wlan then setup the DHCP server



to enable the Access point , we have to install the wapd packet

opkg install wapd


you can also install it from the luci web interface. works the same

pop the access point

[code lang="bash"]

ifup wlan

now the ap working


3. Multiple Wan Connect

Create an interface named "wan"

vi /etc/config/network

add the following lines

config interface 'wan'
option ifname 'eth1'
option _orig_ifname 'eth1'
option _orig_bridge 'true'
option proto 'pppoe'
option username 'PPPOE_USERNAME'
option password 'PPPOE_PASSWORD'
option ipv6 'auto'


ifup wan

change setting of eth0

uci set network.lan.proto=dhcp
uci commit
/etc/init.d/network restart