OpenWRT UCI command for Wireless trunking

Source: Internet
Author: User

The main function of this paper is to use OpenWrt system UCI command to implement wireless relay, mainly using the UCI program to modify the configuration file under the/etc/congfig/directory. The implementation steps are divided into the following main stages:

1) Install the Relayd (opkg installation or make menuconfig loading)

OPKG Update

Opkg Install Relayd

/etc/init.d/relayd Enable

2) turn on the system WiFi function

UCI set [email protected][0].disabled=0//Turn on WiFi

UCI commit Wireless//write config to config file

WiFi//wifi Restart

3) Create a Wwan network interface

The Wwan interface is added to the UCI set Network.wwan=interface//network

UCI set NETWORK.WWAN.PROTO=DHCP//Turn on DHCP service

UCI commit Network//write the configuration to the configuration file

4) Connect the ancestor routing node (my superior route SSID: "ESo")

UCI set wireless.radio0.channel=11//Change channel, this configuration can be omitted

UCI set [email Protected][0].network=wwan//Set Wwan network interface

UCI set [email protected][0].mode=sta//Set Station client mode

UCI set [email protected][0].ssid=eso//wireless SSID required for connection

UCI set [email protected][0].encryption=psk2//Encryption mode PSK2

UCI set [email protected][0].key=20130828//SSID password required for connection

UCI commit Wireless//write configuration to file

WiFi down//off WiFi

WiFi//start WiFi

5) Set the LAN port IP segment, set the gateway

UCI set network.lan.ipaddr=192.168.10.1//set local route IP to avoid conflicts with superior routes

UCI set network.lan.gateway=192.168.3.1//Set gateway for upper ancestor routing Gateway

UCI set network.lan.dns=8.8.8.8//Set DNS

UCI commit Network//write configuration to file

WiFi down//off WiFi

WiFi//start WiFi

6) Turn on the local DHCP server

UCI set dhcp.lan.ignore= "0"//off disable

UCI set dhcp.lan.ra_management= "1"//settings

UCI commit DHCP//write configuration

7) Firewall modification

UCI set [email protected][0].forward=accept//Access

UCI set [email protected][0].network= "LAN"//lan

  

UCI set [email protected][1].forward=accept//Access

UCI set [email protected][1].network= "Wan Wwan"//wan Wwan interface Bridging

8) Create AP Server

UCI add wireless wifi-iface//Create AP Interface

UCI set [email protected][1].device=radio0//select Radion0 device

UCI set [email Protected][1].network=lan//lan Port

UCI set [email protected][1].mode=ap//AP Mode

UCI set [email protected][1].ssid=rt5350//ap SSID

UCI set [email protected][1].encryption=psk2//encryption method

UCI set [email protected][1].key=12345678//Wireless Password

UCI commit Wireless//write Configuration

9) network reboot to enable relay to take effect

/ETC/INIT.D/DNSMASQ Restart//Network Service restart

/etc/init.d/firewall Restart//firewall restart

WiFi down//off WiFi

WiFi//Turn on WiFi

10) Testing

After completing the above configuration command, the system will automatically connect to the specified wireless node (my superior route is ESO) and release The local AP (RT5350).

Ifconfig view the results as follows:

   

Based on the above, you can see that the wireless Wlan0 has been connected to my superior route (ESo) and that the assigned IP is 192.168.3.13.

Next Test the local AP connection condition: (using the computer to connect to the local wireless AP (RT5350))

After the connection, the computer is divided into the IP: 192.168.10.157

  

At this point, if the parent route ESO has a network, the current connected RT5350 will also connect to the Internet.

Here is the ping Baidu result:

  

At this point, the wireless relay configuration is complete.

11) Below is the result of my/etc/config/directory under the configuration file, the previous configuration is not successful can refer to directly using the VIM editor to modify the configuration file. (hehe, how quickly how to come ...) )

The network configuration file is as follows:

   

Firwall configuration file: (only concern for LAN and WAN two ports configuration, i.e. zone[0], zone[1])

DHCP configuration file:

   

Wireless configuration file:

   

OK, knock, finish ...

OpenWRT UCI command for Wireless trunking

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.