You are not logged in.
I am tethering my phone to my laptop and then turning my laptop into an AP in order to give my flat internet whilst I wait for my ISP to install my connection. I have this working except for I am having a problem where by if my phone loses connection then the AP ceases to function.
I have to do it this way instead of just turning my phone into a AP as the phone is connected to a local bank's open WiFi.
To set up the router I run the following script:
#!/bin/bash
# Enable tethering
dhcpcd enp0s26u1u2
ip link set dev wlo1 up
ifconfig wlo1 up 10.0.0.1 netmask 255.255.255.0
if [ -z "$(pgrep dnsmasq)" ]; then
dnsmasq
fi
iptables --flush
iptables --table nat --flush
iptables --delete-chain
iptables --table nat --delete-chain
iptables --table nat --append POSTROUTING --out-interface enp0s26u1u2 -j MASQUERADE
iptables --append FORWARD --in-interface wlo1 -j ACCEPT
sysctl -w net.ipv4.ip_forward=1
hostapd /etc/hostapd/hostapd.conf 1> /dev/null
killall dnsmasq
This functions fine until my phone gets (briefly) disconnected from the bank's WiFi. At this point I can still browse the internet on my laptop, just no other device detects the AP even though hostapd and dnsmasq are still running.
If I kill hostapd and dnsmasq and try to run my script again the following is output:
RTNETLINK answers: Input/output error
SIOCSIFFLAGS: Input/output error
SIOCSIFFLAGS: Input/output error
net.ipv4.ip_forward = 1
and dmesg reports the following several times:
[ 1739.451925] iwlwifi 0000:25:00.0: L1 Enabled - LTR Disabled
[ 1739.458899] iwlwifi 0000:25:00.0: Radio type=0x1-0x2-0x0
[ 1739.503646] iwlwifi 0000:25:00.0: Command COEX_PRIORITY_TABLE_CMD failed: FW Error
[ 1739.503659] iwlwifi 0000:25:00.0: Could not complete ALIVE transition: -5
[ 1739.503974] iwlwifi 0000:25:00.0: Failed to run INIT ucode: -5
[ 1739.504135] iwlwifi 0000:25:00.0: Unable to initialize device.
hostapd reports this if I run it manually:
Configuration file: /etc/hostapd/hostapd.conf
Could not set interface wlo1 flags (UP): Input/output error
nl80211: Could not set interface 'wlo1' UP
nl80211: deinit ifname=wlo1 disabled_11b_rates=0
nl80211 driver initialization failed.
wlo1: interface state UNINITIALIZED->DISABLED
wlo1: AP-DISABLED
hostapd_free_hapd_data: Interface wlo1 wasn't started
For completion, lspci -v gives the following in regards to my network controller:
25:00.0 Network controller: Intel Corporation Centrino Advanced-N 6205 [Taylor Peak] (rev 34)
DeviceName: WLAN
Subsystem: Intel Corporation Centrino Advanced-N 6205 AGN
Flags: bus master, fast devsel, latency 0, IRQ 33
Memory at d4000000 (64-bit, non-prefetchable) [size=8K]
Capabilities: <access denied>
Kernel driver in use: iwlwifi
Kernel modules: iwlwifi
The only way I have found to re-establish the AP is to reboot my laptop. How do I go about restarting the AP without having to reboot?
Last edited by Lerp (2015-12-09 21:38:32)
Offline
Hi,
My best guess is a bug in the driver, as reloading the Intel wireless driver appears to work for me:
# modprobe -r iwldvm
# modprobe -r iwlwifi
# modprobe iwlwifi
Offline