佐须之男 发布的文章

openwrt配置wifidog wireless

configure openwrt Wireless
The WiFi settings are configured in the file /etc/config/wireless (currently supported on Broadcom, Atheros and mac80211). When booting the router for the first time it should detect your card and create a sample configuration file. By default ’option network lan’ is commented. This prevents unsecured sharing of the network over the wireless interface.

Each wireless driver has its own configuration script in /lib/wifi/driver_name.sh which handles driver specific options and configurations. This script is also calling driver specific binaries like wlc for Broadcom, or hostapd and wpa_supplicant for atheros.

The reason for using such architecture, is that it abstracts the driver configuration.

Generic Broadcom wireless config:

  config wifi-device      "wl0" 
      option type         "broadcom" 
      option channel      "5" 

  config wifi-iface 
      option device       "wl0" 
  #   option network  lan 
      option mode         "ap" 
      option ssid         "OpenWrt" 
      option hidden       "0" 
      option encryption   "none"

Generic Atheros wireless config:

  config wifi-device      "wifi0" 
      option type         "atheros" 
      option channel      "5" 
      option hwmode "11g" 

  config wifi-iface 
      option device       "wifi0" 
  #   option network  lan 
      option mode         "ap" 
      option ssid         "OpenWrt" 
      option hidden       "0" 
      option encryption   "none"

Generic mac80211 wireless config:

  config wifi-device      "wifi0" 
      option type         "mac80211" 
      option channel      "5" 

  config wifi-iface 
      option device       "wlan0" 
  #   option network  lan 
      option mode         "ap" 
      option ssid         "OpenWrt" 
      option hidden       "0" 
      option encryption   "none"

Generic multi-radio Atheros wireless config:

  config wifi-device  wifi0 
      option type     atheros 
      option channel  1 

  config wifi-iface 
      option device   wifi0 
  #   option network  lan 
      option mode     ap 
      option ssid     OpenWrt_private 
      option hidden   0 
      option encryption none 

  config wifi-device  wifi1 
      option type     atheros 
      option channel  11 

  config wifi-iface 
      option device   wifi1 
  #   option network  lan 
      option mode     ap 
      option ssid     OpenWrt_public 
      option hidden   1 
      option encryption none

There are two types of config sections in this file. The ’wifi-device’ refers to the physical wifi interface and ’wifi-iface’ configures a virtual interface on top of that (if supported by the driver).

A full outline of the wireless configuration file with description of each field:

  config wifi-device    wifi device name 
      option type       broadcom, atheros, mac80211 
      option country    us, uk, fr, de, etc. 
      option channel    1-14 
      option maxassoc   1-128 (broadcom only) 
      option distance   1-n 
      option hwmode     11b, 11g, 11a, 11bg (atheros, mac80211) 
      option rxantenna  0,1,2 (atheros, broadcom) 
      option txantenna  0,1,2 (atheros, broadcom) 
      option txpower  transmission power in dBm 

  config wifi-iface 
      option network  the interface you want wifi to bridge with 
      option device   wifi0, wifi1, wifi2, wifiN 
      option mode     ap, sta, adhoc, monitor, or wds 
      option txpower  (deprecated) transmission power in dBm 
      option ssid     ssid name 
      option bssid    bssid address 
      option encryption none, wep, psk, psk2, wpa, wpa2 
      option key      encryption key 
      option key1     key 1 
      option key2     key 2 
      option key3     key 3 
      option key4     key 4 
      option server   ip address 
      option port     port 
      option hidden   0,1 
      option isolate  0,1 
      option doth     0,1 (atheros, broadcom) 
      option wmm      0,1 (atheros, broadcom)

本文章由 http://www.wifidog.pro/2015/01/08/openwrt-wifidog-wireless.html 整理编辑,转载请注明出处

openwrt 配置wifidog 相关的network

Configuring OpenWrt Network
The network configuration in Kamikaze is stored in /etc/config/network and is divided into interface configurations. Each interface configuration either refers directly to an ethernet/wifi interface (eth0, wl0, ..) or to a bridge containing multiple interfaces. It looks like this:

config interface     "lan" 
      option ifname    "eth0" 
      option proto     "static" 
      option ipaddr    "192.168.1.1" 
      option netmask   "255.255.255.0" 
      option gateway   "192.168.1.254" 
      option dns       "192.168.1.254"

ifname specifies the Linux interface name. If you want to use bridging on one or more interfaces, set ifname to a list of interfaces and add:

option type     "bridge"

It is possible to use VLAN tagging on an interface simply by adding the VLAN IDs to it, e.g. eth0.1. These can be nested as well.

This sets up a simple static configuration for eth0. proto specifies the protocol used for the interface. The default image usually provides ’none’ ’static’, ’dhcp’ and ’pppoe’. Others can be added by installing additional packages.

When using the ’static’ method like in the example, the options ipaddr and netmask are mandatory, while gateway and dns are optional. You can specify more than one DNS server, separated with spaces.

DHCP currently only accepts ipaddr (IP address to request from the server) and hostname (client hostname identify as) - both are optional.
PPP based protocols (pppoe, pptp, ...) accept these options:

  • username: The PPP username (usually with PAP authentication)
  • password: The PPP password
  • keepalive: Ping the PPP server (using LCP). The value of this option specifies the maximum number of failed pings before reconnecting. The ping interval defaults to 5, but can be changed by appending "," to the keepalive value
  • demand: Use Dial on Demand (value specifies the maximum idle time.
  • server(pptp): The remote pptp server IP

For all protocol types, you can also specify the MTU by using the mtu option.

Setting up static routes
You can set up static routes for a specific interface that will be brought up after the interface is configured.
Simply add a config section like this:

  config route foo 
   option interface lan 
   option target 1.1.1.0 
   option netmask 255.255.255.0 
   option gateway 192.168.1.1

The name for the route section is optional, the interface, target and gateway options are mandatory. Leaving out the netmask option will turn the route into a host route.

Setting up the switch (currently broadcom only)
The switch configuration is set by adding a ’switch’ config section. Example:

  config switch       "eth0" 
      option vlan0    "1 2 3 4 5*" 
      option vlan1    "0 5"

本文章由 http://www.wifidog.pro/2015/01/08/openwrt-network-wifidog.html 整理编辑,转载请注明出处

Openwrt 添加wifidog

OpenWrt source repository downloads

You can either check out the OpenWrt source code via git or svn.
GIT
The recommended way of checking out the OpenWrt source code is cloning the Git repository using one of the following commands:
trunk (main development tree)

  • Main repository

    git clone git://git.openwrt.org/openwrt.git

14.07 branch (Barrier Breaker)

  • Main repository

    git clone git://git.openwrt.org/14.07/openwrt.git

12.09 branch (Attitude Adjustment)

  • Main repository

    git clone git://git.openwrt.org/12.09/openwrt.git

  • Packages feed

    git clone git://git.openwrt.org/12.09/packages.git

SVN
You can checkout the source from the OpenWrt Subversion repository using one of the following commands:

  • Development branch:

    svn co svn://svn.openwrt.org/openwrt/trunk/

  • Barrier Breaker 14.07 branch:

    svn co svn://svn.openwrt.org/openwrt/branches/barrier_breaker

  • Attitude Adjustment 12.09 branch:

    svn co svn://svn.openwrt.org/openwrt/branches/attitude_adjustment

  • Backfire 10.03 branch:

    svn co svn://svn.openwrt.org/openwrt/branches/backfire

  • Kamikaze 8.09 branch:

    svn co svn://svn.openwrt.org/openwrt/branches/8.09

  • Kamikaze 7.09 branch:

    svn co svn://svn.openwrt.org/openwrt/tags/kamikaze_7.09

本文章由 http://www.wifidog.pro/2015/01/08/openwrt%E6%B7%BB%E5%8A%A0wifidog-1.html 整理编辑,转载请注明出处

wifidog之openwrt固件

What is OpenWrt?

Instead of trying to create a single, static firmware, OpenWrt provides a fully writable filesystem with optional package management. This frees you from the restrictions of the application selection and configuration provided by the vendor and allows you to use packages to customize an embedded device to suit any application. For developers, OpenWrt provides a framework to build an application without having to create a complete firmware image and distribution around it. For users, this means the freedom of full customization, allowing the use of an embedded device in ways the vendor never envisioned.

  • Free and open-source. The project is entirely free and open-source, licensed under the GPL. The project is intended to always be hosted at an easily accessible site, with full source code readily available and easy to build.
  • Easy and free access. The project will always be open to new contributors and have a low barrier for participation. Anyone shall be able to contribute. We, the current developers, actively grant write access to anyone interested in having it. We believe people are responsible when given responsibility. Just ask and you will be able to acquire the access rights you need.
  • Community driven. This is not about 'us' offering 'you' something, it is about everyone coming together to work and collaborate towards a common goal.

OpenWrt has long been established as the best firmware solution in its class. It far exceeds other embedded solutions in performance, stability, extensibility, robustness, and design. It is the clear-cut goal of the OpenWrt developers to continue to expand development and ensure that OpenWrt is the foremost framework for innovative and ingenuitive solutions.

本文章由 http://www.wifidog.pro/2015/01/07/wifidog-openwrt-1.html 整理编辑,转载请注明出处