I am having trouble getting a second wireless interface (external USB dongle) working the way I want it to. This dongle creates an access point off of my travel laptop.
My goal is to be able to hotplug the dongle and have the access point come up automatically.
If I have "auto wlan1" in /etc/network/interfaces, things work perfectly IF the dongle is plugged into the computer BEFORE boot. This is the only scenario I have been able to get working.
If I hotplug the dongle AFTER boot, with "auto lan1", then the interface comes up, but when clients connect, they are not given an IP address.
Ditto for if I use "allow-hotplug wlan1" in /etc/network interfaces instead of "auto wlan1".
If I manually do "ifdown wlan1" then "ifup wlan1" (using either auto or allow-hotplug) then the dongle goes down and comes up as expected, but I still do not get any ip addresses assigned to clients.
But everything works perfectly if I have the configuration files specified exactly as below ("auto wlan1"), AND the dongle is plugged into the computer BEFORE I boot the computer.
The reason I don't want to leave it like this, is because if I have "auto wlan1" and I DO NOT have the dongle plugged in BEFORE boot (which is how I will boot 90% of the time - this is my travel laptop), then the boot process takes about two minutes longer than normal and I see the following two error messages during boot: "Waiting for network configuration...", then "Waiting up to 60 more seconds for network configuration..." After those messages finally time out and the boot completes, then I find that network-manager failed to start, and I have to manually run "sudo service network-manager start".
Any ideas where my configuration mistake is, so that I can hotplug the dongle and have the interface come up AND DISPENSE IP ADDRESSES TO CLIENTS?
Thanks in advance!
OS: LinuxMint17 x64 kernel 3.13.0-24-generic
dongle: TP-Link TL-WN722N (USB)
/etc/network/interfaces:
Code:
auto lo
iface lo inet loopback
auto wlan1
#allow-hotplug wlan1
iface wlan1 inet static
hostapd /etc/hostapd/hostapd.conf
address 10.192.4.1
netmask 255.255.255.0
/etc/hostapd/hostapd.conf:
Code:
interface=wlan1
driver=nl80211
ssid=********
channel=1
hw_mode=g
ieee80211n=1
wpa=3
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP CCMP
wpa_passphrase=********
mcaddr_acl=0
auth_algs=1
country_code=US
ieee80211d=1
/etc/dnsmasq.conf (only showing changes I made):
Code:
interface=lo,wlan1
no-dhcp-interface=lo
dhcp-range=10.192.4.3,10.192.4.50,255.255.255.0,12h
/etc/sysctrl.conf:
Code:
net.ipv4.ip_forward=1
iptables initialization:
Code:
iptables -t nat -A POSTROUTING -s 10.192.4.0/24 ! -d 10.192.4.0/24 -j MASQUERADE