ahdemo Create the station in ad-hoc demo (aka pseudo IBSS) mode. adhoc Create the station in ad-hoc mode. ap Create the VAP in AP mode. monitor Create the station in monitor mode. sta Create the VAP in station mode. wds Create the station in WDS mode.
wlanconfig ath0 create wlandev wifi0 wlanmode ap wlanconfig ath1 create wlandev wifi0 wlanmode sta nosbeacon
使用以下命令创建一个WDS网桥
1 2 3 4 5 6 7 8 9 10 11
wlanconfig ath0 create wlandev wifi0 wlanmode ap wlanconfig ath1 create wlandev wifi0 wlanmode wds iwconfig ath0 essid "madwifi" channel 1 iwpriv ath1 wds_add <mac of the peer wds ap> iwpriv ath1 wds 1 ifconfig ath1 up ifconfig ath0 up brctl addbr br0 brctl addif br0 ath1 brctl addif br0 ath0 ifconfig br0 up
第二条命令用来销毁VAP,必须使用设备全名。
第三条命令用来显示VAP的一些相关信息,注意如果参数和VAP类型不符合,是不会显示任何结果的。
1 2 3 4 5 6 7 8 9 10 11 12 13 14
sta or no parameters. Show information on associated stations. scan or ap List all visible stations. chan or freq List all channels and frequencies. active List all available channels and frequencies. keys List all of the keys associated with the VAP caps List the capabilities of the given VAP. wme List WME (Wireless multimedia extensions, aka WMM) parameters.
case SIOC80211IFDESTROY: if (!capable(CAP_NET_ADMIN)) return -EPERM; ieee80211_stop(vap->iv_dev); /* force state before cleanup */ vap->iv_ic->ic_vap_delete(vap); return0;
struct iwreq { union { char ifrn_name[IFNAMSIZ]; /* if name, e.g. "eth0" */ } ifr_ifrn;
/* Data part (defined just above) */ union iwreq_data u; }; union iwreq_data { /* Config - generic */ char name[IFNAMSIZ]; /* Name : used to verify the presence of wireless extensions. * Name of the protocol/provider... */
struct iw_point essid; /* Extended network name */ struct iw_param nwid; /* network id (or domain - the cell) */ struct iw_freq freq; /* frequency or channel : * 0-1000 = channel * > 1000 = frequency in Hz */
scan or ap IEEE80211_IOCTL_SCAN_RESULTS chan or freq IEEE80211_IOCTL_GETCHANINFO active IEEE80211_IOCTL_GETCHANINFO + IEEE80211_IOCTL_GETCHANLIST wme IEEE80211_IOCTL_GETWMMPARAMS caps IEEE80211_IOCTL_GETPARAM