caiwang / board2ihost

0 stars 0 forks source link

rt5370 on udoo #53

Open caiwang opened 9 years ago

caiwang commented 9 years ago

Issue by unissoft-bj Wednesday Apr 08, 2015 at 10:06 GMT Originally opened as https://github.com/caiwang/ihostsrc/issues/53


ifconfig wlan0 down iw dev wlan0 set type monitor ip link set wlan0 promisc on iw dev wlan0 set channel 11 ifconfig wlan0 up

wlcap -l -i wlan0 -f "subtype assoc-resp or subtype reassoc-resp or subtype probe-req or subtype disassoc" -T fields -E separator=, -E quote=d -e frame.time -e frame.protocols -e radiotap.dbm_antsignal -e ppi.80211-common.dbm.antsignal -e wlan.fc.type_subtype -e wlan.da -e wlan.sa -e wlan.bssid -e wlan_mgt.ssid -c 5

Capturing on wlan0 "Apr 8, 2015 16:41:57.763522000","radiotap:wlan","-77",,"0x04","ff:ff:ff:ff:ff:ff","00:23:14:7c:22:64","ff:ff:ff:ff:ff:ff", "Apr 8, 2015 16:41:57.764650000","radiotap:wlan","-73",,"0x04","ff:ff:ff:ff:ff:ff","00:23:14:7c:22:64","ff:ff:ff:ff:ff:ff","shangdao" "Apr 8, 2015 16:41:58.813541000","radiotap:wlan","-63",,"0x04","ff:ff:ff:ff:ff:ff","00:16:6d:c0:76:3c","ff:ff:ff:ff:ff:ff","mtx" "Apr 8, 2015 16:41:58.834567000","radiotap:wlan","-65",,"0x04","ff:ff:ff:ff:ff:ff","00:16:6d:c0:76:3c","ff:ff:ff:ff:ff:ff","mtx" "Apr 8, 2015 16:41:58.835791000","radiotap:wlan","-63",,"0x04","ff:ff:ff:ff:ff:ff","00:16:6d:c0:76:3c","ff:ff:ff:ff:ff:ff", 5 packets captured (16:41 root@ihost ~) >

[22738.077819] usb 2-1.1: USB disconnect, device number 3 [22742.446202] ehci_fsl_bus_suspend begins, Host 1 [22742.446373] ehci_fsl_bus_suspend ends, Host 1 [23743.676754] ehci_fsl_bus_resume begins, Host 1 [23743.691822] ehci_fsl_bus_resume ends, Host 1 [23743.921976] usb 2-1.1: new high speed USB device number 4 using fsl-ehci [23744.069443] ieee80211 phy0: Selected rate control algorithm 'minstrel_ht' [23744.077816] Registered led device: rt2800usb-phy0::radio [23744.078143] Registered led device: rt2800usb-phy0::assoc [23744.078466] Registered led device: rt2800usb-phy0::quality [23744.686433] ADDRCONF(NETDEV_UP): wlan0: link is not ready

(19:08 root@ihost ~) > lsusb Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 002 Device 002: ID 0424:2514 Standard Microsystems Corp. USB 2.0 Hub Bus 002 Device 004: ID 148f:5370 Ralink Technology, Corp. RT5370 Wireless Adapter

(19:09 root@ihost ~) > iw list Wiphy phy0 Band 1: Capabilities: 0x172 HT20/HT40 Static SM Power Save RX Greenfield RX HT20 SGI RX HT40 SGI RX STBC 1-stream Max AMSDU length: 3839 bytes No DSSS/CCK HT40 Maximum RX AMPDU length 65535 bytes (exponent: 0x003) Minimum RX AMPDU time spacing: 2 usec (0x04) HT RX MCS rate indexes supported: 0-7, 32 TX unequal modulation not supported HT TX Max spatial streams: 1 HT TX MCS rate indexes supported may differ Frequencies: * 2412 MHz [1](20.0 dBm) * 2417 MHz [2](20.0 dBm) * 2422 MHz [3](20.0 dBm) * 2427 MHz [4](20.0 dBm) * 2432 MHz [5](20.0 dBm) * 2437 MHz [6](20.0 dBm) * 2442 MHz [7](20.0 dBm) * 2447 MHz [8](20.0 dBm) * 2452 MHz [9](20.0 dBm) * 2457 MHz [10](20.0 dBm) * 2462 MHz [11](20.0 dBm) * 2467 MHz [12](20.0 dBm) (passive scanning, no IBSS) * 2472 MHz [13](20.0 dBm) (passive scanning, no IBSS) * 2484 MHz [14](20.0 dBm) (passive scanning, no IBSS) Bitrates (non-HT): * 1.0 Mbps * 2.0 Mbps (short preamble supported) * 5.5 Mbps (short preamble supported) * 11.0 Mbps (short preamble supported) * 6.0 Mbps * 9.0 Mbps * 12.0 Mbps * 18.0 Mbps * 24.0 Mbps * 36.0 Mbps * 48.0 Mbps * 54.0 Mbps max # scan SSIDs: 4 max scan IEs length: 2257 bytes Coverage class: 0 (up to 0m) Supported Ciphers: * WEP40 (00-0f-ac:1) * WEP104 (00-0f-ac:5) * TKIP (00-0f-ac:2) * CCMP (00-0f-ac:4) Available Antennas: TX 0 RX 0 Supported interface modes: * IBSS * managed * AP * AP/VLAN * WDS * monitor software interface modes (can always be added): * AP/VLAN * monitor interface combinations are not supported Supported commands: * new_interface * set_interface * new_key * new_beacon * new_station * set_bss * authenticate * associate * deauthenticate * disassociate * join_ibss * remain_on_channel * set_tx_bitrate_mask * action * frame_wait_cancel * set_wiphy_netns * set_channel * set_wds_peer * connect * disconnect Supported TX frame types: * IBSS: 0x0000 0x0010 0x0020 0x0030 0x0040 0x0050 0x0060 0x0070 0x0080 0x0090 0x00a0 0x00b0 0x00c0 0x00d0 0x00e0 0x00f0 * managed: 0x0000 0x0010 0x0020 0x0030 0x0040 0x0050 0x0060 0x0070 0x0080 0x0090 0x00a0 0x00b0 0x00c0 0x00d0 0x00e0 0x00f0 * AP: 0x0000 0x0010 0x0020 0x0030 0x0040 0x0050 0x0060 0x0070 0x0080 0x0090 0x00a0 0x00b0 0x00c0 0x00d0 0x00e0 0x00f0 * AP/VLAN: 0x0000 0x0010 0x0020 0x0030 0x0040 0x0050 0x0060 0x0070 0x0080 0x0090 0x00a0 0x00b0 0x00c0 0x00d0 0x00e0 0x00f0 * mesh point: 0x0000 0x0010 0x0020 0x0030 0x0040 0x0050 0x0060 0x0070 0x0080 0x0090 0x00a0 0x00b0 0x00c0 0x00d0 0x00e0 0x00f0 * P2P-client: 0x0000 0x0010 0x0020 0x0030 0x0040 0x0050 0x0060 0x0070 0x0080 0x0090 0x00a0 0x00b0 0x00c0 0x00d0 0x00e0 0x00f0 * P2P-GO: 0x0000 0x0010 0x0020 0x0030 0x0040 0x0050 0x0060 0x0070 0x0080 0x0090 0x00a0 0x00b0 0x00c0 0x00d0 0x00e0 0x00f0 Supported RX frame types: * IBSS: 0x00d0 * managed: 0x0040 0x00d0 * AP: 0x0000 0x0020 0x0040 0x00a0 0x00b0 0x00c0 0x00d0 * AP/VLAN: 0x0000 0x0020 0x0040 0x00a0 0x00b0 0x00c0 0x00d0 * mesh point: 0x00b0 0x00c0 0x00d0 * P2P-client: 0x0040 0x00d0 * P2P-GO: 0x0000 0x0020 0x0040 0x00a0 0x00b0 0x00c0 0x00d0 (19:09 root@ihost ~) >

(19:13 root@ihost ~) > ifconfig eth0 Link encap:Ethernet HWaddr 00:c0:08:88:9e:d6
inet addr:192.168.100.200 Bcast:192.168.100.255 Mask:255.255.255.0 inet6 addr: fe80::2c0:8ff:fe88:9ed6/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:39538 errors:0 dropped:0 overruns:0 frame:0 TX packets:32318 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:3820723 (3.8 MB) TX bytes:5161135 (5.1 MB)

eth0:9 Link encap:Ethernet HWaddr 00:c0:08:88:9e:d6
inet addr:192.168.254.254 Bcast:192.168.254.255 Mask:255.255.255.0 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0 inet6 addr: ::1/128 Scope:Host UP LOOPBACK RUNNING MTU:16436 Metric:1 RX packets:627 errors:0 dropped:0 overruns:0 frame:0 TX packets:627 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:52087 (52.0 KB) TX bytes:52087 (52.0 KB)

tun0 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
inet addr:172.16.0.1 P-t-P:172.16.0.1 Mask:255.255.0.0 UP POINTOPOINT RUNNING MTU:1500 Metric:1 RX packets:16759 errors:0 dropped:0 overruns:0 frame:0 TX packets:13300 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:100 RX bytes:1263327 (1.2 MB) TX bytes:3714020 (3.7 MB)

usb0 Link encap:Ethernet HWaddr ae:83:43:2d:8f:48
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)

wlan0 Link encap:Ethernet HWaddr c8:3a:35:ce:47:40
UP BROADCAST MULTICAST MTU:1500 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)

(19:14 root@ihost ~) >

(19:13 root@ihost ~) > iwconfig lo no wireless extensions.

eth0 no wireless extensions.

usb0 no wireless extensions.

tun0 no wireless extensions.

wlan0 IEEE 802.11bgn ESSID:off/any
Mode:Managed Access Point: Not-Associated Tx-Power=20 dBm
Retry long limit:7 RTS thr:off Fragment thr:off Encryption key:off Power Management:on

(19:14 root@ihost ~) > iw --debug phy phy0 interface add wlan2 type monitor -- Debug: Sent Message: -------------------------- BEGIN NETLINK MESSAGE --------------------------- [HEADER] 16 octets .nlmsg_len = 48 .nlmsg_type = 17 <0x11> .nlmsg_flags = 5 <REQUEST,ACK> .nlmsg_seq = 1428318920 .nlmsg_pid = 7608 [PAYLOAD] 32 octets 07 00 00 00 08 00 01 00 00 00 00 00 0a 00 04 00 77 6c ................wl 61 6e 32 00 00 00 08 00 05 00 06 00 00 00 an2........... --------------------------- END NETLINK MESSAGE --------------------------- -- Debug: Received Message: -------------------------- BEGIN NETLINK MESSAGE --------------------------- [HEADER] 16 octets .nlmsg_len = 36 .nlmsg_type = 2 .nlmsg_flags = 0 <> .nlmsg_seq = 1428318920 .nlmsg_pid = 7608 [ERRORMSG] 20 octets .error = 0 "Success" [ORIGINAL MESSAGE] 16 octets .nlmsg_len = 16 .nlmsg_type = 17 <0x11> .nlmsg_flags = 5 <REQUEST,ACK> .nlmsg_seq = 1428318920 .nlmsg_pid = 7608 --------------------------- END NETLINK MESSAGE --------------------------- (19:15 root@ihost ~) >

http://stackoverflow.com/questions/19433979/packet-received-on-monitor-interface-but-not-main-interface iw dev wlan0 set type monitor ip link set wlan0 promisc on

https://ask.wireshark.org/questions/11225/how-can-i-capture-packets-between-a-wireless-laptop-and-a-router-linux The following set of commands seems to work: iw dev wlan0 set type monitor iw dev wlan0 set channel ifconfig wlan0 up.

(16:37 root@ihost ~) > iwconfig lo no wireless extensions.

eth0 no wireless extensions.

usb0 no wireless extensions.

tun0 no wireless extensions.

wlan0 IEEE 802.11bgn Mode:Monitor Tx-Power=20 dBm
Retry long limit:7 RTS thr:off Fragment thr:off Power Management:on

(16:37 root@ihost ~) > ifconfig eth0 Link encap:Ethernet HWaddr 00:c0:08:88:25:d4
inet addr:192.168.100.200 Bcast:192.168.100.255 Mask:255.255.255.0 inet6 addr: fe80::2c0:8ff:fe88:25d4/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:6529 errors:0 dropped:0 overruns:0 frame:0 TX packets:6818 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:1024999 (1.0 MB) TX bytes:1774382 (1.7 MB)

eth0:9 Link encap:Ethernet HWaddr 00:c0:08:88:25:d4
inet addr:192.168.254.254 Bcast:192.168.254.255 Mask:255.255.255.0 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0 inet6 addr: ::1/128 Scope:Host UP LOOPBACK RUNNING MTU:16436 Metric:1 RX packets:598 errors:0 dropped:0 overruns:0 frame:0 TX packets:598 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:60373 (60.3 KB) TX bytes:60373 (60.3 KB)

tun0 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
inet addr:172.16.0.1 P-t-P:172.16.0.1 Mask:255.255.0.0 UP POINTOPOINT RUNNING MTU:1500 Metric:1 RX packets:4409 errors:0 dropped:0 overruns:0 frame:0 TX packets:4346 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:100 RX bytes:532423 (532.4 KB) TX bytes:1357304 (1.3 MB)

usb0 Link encap:Ethernet HWaddr de:ad:f4:5e:b4:ba
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)

wlan0 Link encap:UNSPEC HWaddr C8-3A-35-CE-47-40-00-00-00-00-00-00-00-00-00-00
UP BROADCAST PROMISC MULTICAST MTU:1500 Metric:1 RX packets:72008 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:4547307 (4.5 MB) TX bytes:0 (0.0 B)

(16:37 root@ihost ~) >