Skip to content

Instantly share code, notes, and snippets.

@realyukii
Last active May 24, 2024 03:15
Show Gist options
  • Select an option

  • Save realyukii/4341def451d6a7e940638282301ef8aa to your computer and use it in GitHub Desktop.

Select an option

Save realyukii/4341def451d6a7e940638282301ef8aa to your computer and use it in GitHub Desktop.
List available network interface
#!/usr/bin/sh
for iface in $(ls /sys/class/net/); do
echo "Interface: $iface";
mode=$(iw $iface info 2>/dev/null)
if [[ $? -eq 0 ]]; then
mode=$(echo "$mode" | grep type | awk '{print $2}')
echo "Mode: $mode"
fi
ethtool -i $iface 2>/dev/null | grep -E 'driver|version';
pci=$(ethtool -i $iface 2>/dev/null | grep bus-info | awk '{print $2}' | cut -d: -f2,3);
if [[ -n "$pci" ]]; then
lspci -v -s $pci | grep -E 'Ethernet|Network'
else
echo "PCI info not found";
fi
echo "-----";
done
@realyukii

realyukii commented May 22, 2024

Copy link
Copy Markdown
Author

iw list also a good command

with that command, you can see if your network card are support AP or not, support VIF or not

@realyukii

Copy link
Copy Markdown
Author

watch -n .1 cat /proc/net/wireless cool command

@realyukii

realyukii commented May 22, 2024

Copy link
Copy Markdown
Author

Nice Wiki page, talking about Wi-Fi technology and its standard

use iwconfig command to see more related to Wi-Fi

@realyukii

Copy link
Copy Markdown
Author

Nice Wiki page, talking about VIF (Virtual Interface) or VNI (Virtual Network Interface)

category: Computer Networks

@realyukii

realyukii commented May 23, 2024

Copy link
Copy Markdown
Author

TIL the existence of Promiscuous mode

Previously, I just knew two modes of interface mode: monitor and managed.

EDIT: it seems monitor mode and promiscuous mode are similar? while on monitor mode, promiscuous mode was mentioned by dmesg command

@realyukii

realyukii commented May 23, 2024

Copy link
Copy Markdown
Author

Software access point

Many wireless devices even support simultaneous operation both as AP and as wireless "client" at the same time. Using that capability you can create a software AP acting as a "wireless repeater" for an existing network, using a single wireless device.

Wut?

@realyukii

realyukii commented May 24, 2024

Copy link
Copy Markdown
Author

deactivate first?:

ip link set dev wlan0mon down

rename the interface:

ip link set dev wlan0mon name wlan0

switch interface mode:

iwconfig wlan0 mode managed

re-activate?

ip link set dev wlan0 up

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment