WLAN0 läßt sich nicht beenden

Hallo Forum, ich versuche seit Wochen ein Programm zu schreiben, mit dem ich im laufenden Betrieb die MAC-Adresse der IF ändern kann, auch die BSSID von hostapd. Seit neuesten bekomme ich immer folgende Fehlermeldung
„SIOCSIFHWADDR: Device or resource busy - you may need to down the interface“.
Wie kann ich erkennen welches Programm noch auf das NW-Interface zugreift. Danke im voraus.
 
Hallo,
das Stichwort heißt netstat. Parameter p war es glaube ich ;)
 
An netstat habe ich auch schon gedacht, nur fehlt mir hier iein Verbindungsglied zwischen Karte bzw Interface und Programm
 
Da du ja weisst welche IP dein Interface hat, kannst du im Output von netstat einfach nach der entsprechenden IP grep'en.
 
Hallo Forum,
netstat ist schom ganz gut, nur habe ich da ein kleines Problem, nicht alle Netzwerkprogramme werden angezeigt, z.B. hostapd wird gar nicht angezeigt s.u.
pi@(none) ~ $ ps aux
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
root 1 0.0 0.2 2148 1312 ? Ss 21:16 0:02 init [2]
root 2 0.0 0.0 0 0 ? S 21:16 0:00 [kthreadd]
root 3 0.0 0.0 0 0 ? S 21:16 0:00 [ksoftirqd/0]
root 5 0.0 0.0 0 0 ? S< 21:16 0:00 [kworker/0:0H]
root 7 0.0 0.0 0 0 ? S 21:16 0:02 [rcu_preempt]
root 8 0.0 0.0 0 0 ? S 21:16 0:00 [rcu_sched]
root 9 0.0 0.0 0 0 ? S 21:16 0:00 [rcu_bh]
root 10 0.0 0.0 0 0 ? S< 21:16 0:00 [khelper]
root 11 0.0 0.0 0 0 ? S 21:16 0:00 [kdevtmpfs]
root 12 0.0 0.0 0 0 ? S< 21:16 0:00 [netns]
root 13 0.0 0.0 0 0 ? S< 21:16 0:00 [perf]
root 14 0.0 0.0 0 0 ? S 21:16 0:00 [khungtaskd]
root 15 0.0 0.0 0 0 ? S< 21:16 0:00 [writeback]
root 16 0.0 0.0 0 0 ? S< 21:16 0:00 [crypto]
root 17 0.0 0.0 0 0 ? S< 21:16 0:00 [bioset]
root 18 0.0 0.0 0 0 ? S< 21:16 0:00 [kblockd]
root 20 0.0 0.0 0 0 ? S< 21:16 0:00 [rpciod]
root 21 0.0 0.0 0 0 ? S 21:16 0:00 [kswapd0]
root 22 0.0 0.0 0 0 ? S 21:16 0:00 [fsnotify_mark]
root 23 0.0 0.0 0 0 ? S< 21:16 0:00 [nfsiod]
root 29 0.0 0.0 0 0 ? S< 21:16 0:00 [kthrotld]
root 30 0.0 0.0 0 0 ? S< 21:16 0:00 [VCHIQ-0]
root 31 0.0 0.0 0 0 ? S< 21:16 0:00 [VCHIQr-0]
root 32 0.0 0.0 0 0 ? S< 21:16 0:00 [VCHIQs-0]
root 33 0.0 0.0 0 0 ? S< 21:16 0:00 [iscsi_eh]
root 34 0.0 0.0 0 0 ? S< 21:16 0:00 [dwc_otg]
root 35 0.0 0.0 0 0 ? S< 21:16 0:00 [DWC Notificatio]
root 37 0.0 0.0 0 0 ? S 21:16 0:00 [VCHIQka-0]
root 38 0.0 0.0 0 0 ? S< 21:16 0:00 [deferwq]
root 40 0.0 0.0 0 0 ? S 21:16 0:00 [mmcqd/0]
root 42 0.0 0.0 0 0 ? S 21:16 0:00 [jbd2/mmcblk0p2-]
root 43 0.0 0.0 0 0 ? S< 21:16 0:00 [ext4-rsv-conver]
root 158 0.0 0.4 2784 2060 ? Ss 21:16 0:00 udevd --daemon
root 258 0.0 0.0 0 0 ? S< 21:16 0:00 [cfg80211]
root 1683 0.0 0.2 1752 1216 ? S 21:17 0:07 /usr/sbin/ifplugd -i wlan1 -q -f -u0 -d10 -w -I
root 1694 0.0 0.2 1752 1208 ? S 21:17 0:01 /usr/sbin/ifplugd -i lo -q -f -u0 -d10 -w -I
root 1704 0.0 0.2 1752 1096 ? S 21:17 0:06 /usr/sbin/ifplugd -i eth0 -q -f -u0 -d10 -w -I
root 1721 0.0 0.2 1752 1144 ? S 21:17 0:01 /usr/sbin/ifplugd -i wlan0 -q -f -u0 -d10 -w -I
root 1722 0.0 0.0 0 0 ? S 21:17 0:05 [RTW_CMD_THREAD]
root 1848 0.0 0.6 5648 3132 ? Ss 21:17 0:00 /sbin/wpa_supplicant -s -B -P /var/run/wpa_supplicant.wlan1.pid -i wlan1 -D nl80211,wext -C /var/run/wpa_s
root 2202 0.0 0.3 2780 1764 ? S 21:17 0:00 udevd --daemon
root 2203 0.0 0.3 2780 1764 ? S 21:17 0:00 udevd --daemon
root 2215 0.0 0.2 1752 1204 ? S 21:17 0:00 /usr/sbin/ifplugd -i mon.wlan0 -q -f -u0 -d10 -w -I
root 2249 0.0 0.5 5172 2696 ? Ss 21:17 0:00 /usr/sbin/hostapd -B -P /var/run/hostapd.pid /etc/hostapd/hostapd.conf
root 2305 0.0 0.5 28188 2560 ? Sl 21:17 0:00 /usr/sbin/rsyslogd -c5
102 2352 0.0 0.3 3180 1740 ? Ss 21:17 0:00 /usr/bin/dbus-daemon --system
avahi 2379 0.0 0.5 3508 2672 ? S 21:17 0:00 avahi-daemon: running [none.local]
avahi 2380 0.0 0.2 3384 1424 ? S 21:17 0:00 avahi-daemon: chroot helper
dnsmasq 2415 0.0 0.4 3668 2064 ? S 21:17 0:00 /usr/sbin/dnsmasq -x /var/run/dnsmasq/dnsmasq.pid -u dnsmasq -r /var/run/dnsmasq/resolv.conf -7 /etc/dnsma
root 2499 0.0 0.3 2644 1700 ? Ss 21:17 0:00 /usr/sbin/cron
ntp 2543 0.0 0.7 5600 3884 ? Ss 21:17 0:01 /usr/sbin/ntpd -p /var/run/ntpd.pid -g -u 104:107
root 2591 0.0 0.6 6220 3024 ? Ss 21:17 0:00 /usr/sbin/sshd
107 2619 0.3 4.4 23308 22244 ? S 21:17 0:28 /usr/bin/tor --defaults-torrc /usr/share/tor/tor-service-defaults-torrc --hush
root 2691 0.0 0.3 2252 1576 ? Ss 21:17 0:00 /sbin/dhcpcd
nobody 2697 0.0 0.2 2020 1404 ? Ss 21:17 0:00 /usr/sbin/thd --daemon --triggers /etc/triggerhappy/triggers.d/ --socket /var/run/thd.socket --pidfile /va
root 2708 0.0 0.3 2592 1640 tty1 Ss+ 21:17 0:00 /sbin/getty --noclear 38400 tty1
root 2709 0.0 0.3 2068 1544 tty2 Ss+ 21:17 0:00 /sbin/getty 38400 tty2
root 2710 0.0 0.3 2068 1544 tty3 Ss+ 21:17 0:00 /sbin/getty 38400 tty3
root 2711 0.0 0.2 2068 1480 tty4 Ss+ 21:17 0:00 /sbin/getty 38400 tty4
root 2712 0.0 0.3 2068 1544 tty5 Ss+ 21:17 0:00 /sbin/getty 38400 tty5
root 2713 0.0 0.3 2068 1536 tty6 Ss+ 21:17 0:00 /sbin/getty 38400 tty6
root 2714 0.0 0.3 2068 1536 ? Ss+ 21:17 0:00 /sbin/getty -L ttyAMA0 115200 vt100
root 4025 0.0 0.0 0 0 ? S 23:24 0:00 [kworker/u2:2]
root 4081 0.0 0.0 0 0 ? S 23:34 0:00 [kworker/0:0]
root 4205 0.0 0.0 0 0 ? S 23:39 0:00 [kworker/0:2]
root 4206 0.0 0.0 0 0 ? S 23:41 0:00 [kworker/u2:0]
root 4261 1.0 0.9 9344 4628 ? Ss 23:48 0:00 sshd: pi [priv]
root 4265 0.1 0.0 0 0 ? S 23:48 0:00 [kworker/0:1]
pi 4266 0.2 0.7 9344 3588 ? S 23:48 0:00 sshd: pi@pts/0
pi 4267 5.5 0.9 5424 4832 pts/0 Ss 23:48 0:01 -bash
root 4323 0.0 0.0 0 0 ? S 23:48 0:00 [kworker/u2:1]
pi 4324 0.0 0.3 3276 1956 pts/0 R+ 23:48 0:00 ps aux
pi@(none) ~ $ sudo netstat -tulpe
sudo: unable to resolve host (none)
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State User Inode PID/Program name
tcp 0 0 localhost:9050 *:* LISTEN root 7920 2619/tor
tcp 0 0 none.local:9040 *:* LISTEN root 7923 2619/tor
tcp 0 0 *:domain *:* LISTEN root 7717 2415/dnsmasq
tcp 0 0 *:ssh *:* LISTEN root 7896 2591/sshd
udp 0 0 *:mdns *:* avahi 7697 2379/avahi-daemon:
udp 0 0 none.local:domain *:* root 7922 2619/tor
udp 0 0 *:domain *:* root 7716 2415/dnsmasq
udp 0 0 *:bootps *:* root 7710 2415/dnsmasq
udp 0 0 *:bootpc *:* root 7285 2691/dhcpcd
udp 0 0 *:52037 *:* avahi 7699 2379/avahi-daemon:
udp 0 0 none.local:ntp *:* ntp 10806 2543/ntpd
udp 0 0 none.local:ntp *:* ntp 8183 2543/ntpd
udp 0 0 none.local:ntp *:* ntp 7999 2543/ntpd
udp 0 0 none.local:ntp *:* root 7822 2543/ntpd
udp 0 0 none.local:ntp *:* root 7821 2543/ntpd
udp 0 0 none.local:ntp *:* root 7820 2543/ntpd
udp 0 0 localhost:ntp *:* root 7819 2543/ntpd
udp 0 0 *:ntp *:* root 7815 2543/ntpd

pi@(none) ~ $ sudo netstat -tulp
sudo: unable to resolve host (none)
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 localhost:9050 *:* LISTEN 2619/tor
tcp 0 0 none.local:9040 *:* LISTEN 2619/tor
tcp 0 0 *:domain *:* LISTEN 2415/dnsmasq
tcp 0 0 *:ssh *:* LISTEN 2591/sshd
udp 0 0 *:mdns *:* 2379/avahi-daemon:
udp 0 0 none.local:domain *:* 2619/tor
udp 0 0 *:domain *:* 2415/dnsmasq
udp 0 0 *:bootps *:* 2415/dnsmasq
udp 0 0 *:bootpc *:* 2691/dhcpcd
udp 0 0 *:52037 *:* 2379/avahi-daemon:
udp 0 0 none.local:ntp *:* 2543/ntpd
udp 0 0 none.local:ntp *:* 2543/ntpd
udp 0 0 none.local:ntp *:* 2543/ntpd
udp 0 0 none.local:ntp *:* 2543/ntpd
udp 0 0 none.local:ntp *:* 2543/ntpd
udp 0 0 none.local:ntp *:* 2543/ntpd
udp 0 0 localhost:ntp *:* 2543/ntpd
udp 0 0 *:ntp *:* 2543/ntpd

Habt Ihr zufälligerweise eine Erklärung dafür?
 
hostapd bindet nicht an einen spezifischen Port und erstellt auch keine Sockets. Es baut also keine Netzwerk-Verbindungen im eigentlichen Sinne auf. Daher wird es von netstat nicht angezeigt. netstat zeigt nur Netzwerk-Verbindungen, keine bereitgestellten Netzwerk-Funktionalitäten oder Treiber-Interfaces. Wenn du wissen willst, was auf deinem WLAN-Interface los ist, wirst du auf Tools wie 'arp' zurückgreifen müssen. Dort siehst du allerdings auch nur zu welchen Hosts Einträge in der ARP-Tabelle existieren und kannst sie keinen Programmen zuordnen. Du könntest höchstens mal probieren ob 'ss' dir die Verbindungen von hostapd mit anzeigt. Hab gerade keinen Rechner mit laufendem hostapd da um das zu testen.
 
Da kann man machen nichts. Blockiert irgendein Prozess oder Irgendwelche Reste das Herunterfahren der Netzwerkkarte. Ich schreib jetzt das Skript so, daß es einfach vor dem Start des Netzwerkes die MAC-Adressen ändert.
 
Ich würd's ja erstmal mit einem Force-Unload des Kernelmoduls probieren. Das dürfte die Prozesse detachen.
 
Zurück
Oben