- 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
KCONFIG:=CONFIG_USB_RTL8150
FILES:=$(LINUX_DIR)/drivers/$(USBNET_DIR)/rtl8150.ko
AUTOLOAD:=$(call AutoProbe,rtl8150)
$(call AddDepends/usb-net)
endef
define KernelPackage/usb-net-rtl8150/description
Kernel module for USB-to-Ethernet Realtek 8150 convertors
endef
$(eval $(call KernelPackage,usb-net-rtl8150))
define KernelPackage/usb-net-rtl8152
TITLE:=Kernel module for USB-to-Ethernet Realtek convertors
KCONFIG:=CONFIG_USB_RTL8152
FILES:=$(LINUX_DIR)/drivers/$(USBNET_DIR)/r8152.ko
AUTOLOAD:=$(call AutoProbe,r8152)
$(call AddDepends/usb-net)
endef
define KernelPackage/usb-net-rtl8152/description
Kernel module for USB-to-Ethernet Realtek 8152 USB2.0/3.0 convertors
endef
$(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-usb-net-rtl8150
->*kmod-usb-net-rtl8152
-> *kmod-usb2
save the file as .config
run make command
make
2. setup ACCESS POINT
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 '192.168.1.1'
option netmask '255.255.255.0'
option ip6assign '60'
plug the network cable to get an ipaddress from dhcp The default opkg source address was wrong,we should change itvi /etc/opkg/distfeeds.conf
update the new sourcesrc/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
install luci web manager interfaceopkg update
unfortunately, by default we don't have permission to access. So we should give permit firstopkg install luci
then goes to the webpage http://RPIipaddress/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
goes to network-->wifi-->edit
enable the device and create a network named 'wlan'
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
[code]
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'
then
ifup wan
change setting of eth0
uci set network.lan.proto=dhcp
uci commit
/etc/init.d/network restart