Last active
May 24, 2024 03:15
-
-
Save RealYukiSan/4341def451d6a7e940638282301ef8aa to your computer and use it in GitHub Desktop.
List available network interface
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
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
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?
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
Nice Wiki page, talking about VIF (Virtual Interface) or VNI (Virtual Network Interface)
category: Computer Networks