当前位置:   article > 正文

OpenWrt wifi设置_openwrt无线设置

openwrt无线设置
1.启用无线网卡

重置配置文件,如果是新系统没有进行过相关设置可以跳过

rm -f /etc/config/wireless; wifi config instead
  • 1

启用无线网卡

uci set wireless.@wifi-device[0].disabled="0"
uci commit wireless
wifi
  • 1
  • 2
  • 3

提示:这里是设置第一块无线网卡。
如果要设置第二块网卡,如下操作

uci set wireless.@wifi-device[1].disabled="0"
uci commit wireless
wifi wlan1
  • 1
  • 2
  • 3
2.无线网络设置

执行iw dev命令显示如下格式信息

phy#0
        Interface wlan0
                ifindex 5
                wdev 0x1
                addr ab:12:23:dc:03:45
                type managed
                txpower 20.00 dBm
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7

搜索无线网络

iw dev wlan0 scan
  • 1

显示如下格式无线网络信息,若有多个无线网络,会显示多个这样格式的信息

BSS c8:d5:fe:c8:61:b0(on wlan0) 
        TSF: 24324848870 usec (0d, 06:45:24)
        freq: 2412
        beacon interval: 100 TUs
        capability: ESS (0x0411)
        signal: -72.00 dBm
        last seen: 140 ms ago
        Information elements from Probe Response frame:
        SSID: Violetta
        HT capabilities:
                Capabilities: 0x102c
                        HT20
                        SM Power Save disabled
                        RX HT20 SGI
                        No RX STBC
                        Max AMSDU length: 3839 bytes
                        DSSS/CCK HT40
                Maximum RX AMPDU length 32767 bytes (exponent: 0x002)
                Minimum RX AMPDU time spacing: 16 usec (0x07)
                HT RX MCS rate indexes supported: 0-7
                HT TX MCS rate indexes are undefined
        HT operation:
                 * primary channel: 13
                 * secondary channel offset: no secondary
                 * STA channel width: 20 MHz
        RSN:     * Version: 1
                 * Group cipher: CCMP
                 * Pairwise ciphers: CCMP
                 * Authentication suites: PSK
                 * Capabilities: 16-PTKSA-RC 1-GTKSA-RC (0x000c)
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30

编辑/etc/config/network,添加修改以下内容

config interface 'wwan'
        option proto 'dhcp'
  • 1
  • 2

编辑/etc/config/wireless,添加修改以下内容

config wifi-iface 'default_radio0'
        option device 'radio0'
        option network 'wwan'
        option mode 'sta'
        option ssid 'Violetta'
        option encryption 'psk2'
        option bssid 'c8:d5:fe:c8:61:b0'
        option key 'YourWifiPassword'
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8

编辑/etc/config/firewall,找到zone wan,添加一行list network 'wwan',如下

config zone
        option name             wan
        list   network          'wan'
        list   network          'wan6'
        list   network          'wwan'
        option input            REJECT
        option output           ACCEPT
        option forward          REJECT
        option masq             1
        option mtu_fix          1
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
3.启用wifi
wifi; /etc/init.d/firewall restart
  • 1

查看信息

iw dev
  • 1
phy#0
        Interface wlan0
                ifindex 5
                wdev 0x1
                addr ab:12:23:dc:03:45
                ssid Violetta
                type managed
                channel 13 (2472 MHz), width: 20 MHz, center1: 2472 MHz
                txpower 20.00 dBm
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/花生_TL007/article/detail/290790
推荐阅读
相关标签
  

闽ICP备14008679号