LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 12-13-2015, 05:40 PM   #1
haertig
Senior Member
 
Registered: Nov 2004
Distribution: Debian, Ubuntu, LinuxMint, Slackware, SysrescueCD, Raspbian, Arch
Posts: 2,331

Rep: Reputation: 357Reputation: 357Reputation: 357Reputation: 357
Question: Network interface not coming up appropriately


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
 
Old 12-13-2015, 06:11 PM   #2
ferrari
LQ Guru
 
Registered: Sep 2003
Location: Auckland, NZ
Distribution: openSUSE Leap
Posts: 5,819

Rep: Reputation: 1144Reputation: 1144Reputation: 1144Reputation: 1144Reputation: 1144Reputation: 1144Reputation: 1144Reputation: 1144Reputation: 1144
Have you considered using Network Manager to configure the device? It can create the hotspot configuration as required, and should be able to start it when the particular device is plugged in. (No need to have it defined in /etc/network/interfaces if using NM configuration.)

http://ubuntuhandbook.org/index.php/...otspot-ubuntu/
https://www.quora.com/How-do-I-creat...n-Ubuntu-14-04
 
Old 12-14-2015, 12:19 AM   #3
haertig
Senior Member
 
Registered: Nov 2004
Distribution: Debian, Ubuntu, LinuxMint, Slackware, SysrescueCD, Raspbian, Arch
Posts: 2,331

Original Poster
Rep: Reputation: 357Reputation: 357Reputation: 357Reputation: 357
I was not aware of using Network Manager as discussed in those links. Thanks for pointing them out to me. I will research. If that works, it is sure a lot simpler that what I have done.

My use is this: Travel laptop uses it's internal WiFi to connect to hotel/motel wireless. Travel laptop establishes a VPN to my home LAN. Travel laptop brings up secondary access point using USB dongle. Other devices (additional tablets, cellphones, Roku video streamer, maybe even another laptop) connect to this secondary access point and then can access my home LAN via routing to the established VPN. The Roku will be able to stream media from my home media server over the VPN.

Many people use a "travel router" for this function. But many hotels/motels these days only have wireless internet access, no ethernet cable access. I haven't found a router that can perform both as a WiFi client AND as an access point at the same time. Plus, I always have my travel laptop with me, so why not have it perform the function? That WiFi dongle cost me a whopping $12.95 with free shipping and a free cradle (a fabulous sale at NewEgg a few months ago that I just happened to stumble into). The dongle works great - much better than the laptops built-in wireless. Plus, it can also function as an access point.

Last edited by haertig; 12-14-2015 at 12:22 AM.
 
Old 04-02-2016, 12:07 PM   #4
haertig
Senior Member
 
Registered: Nov 2004
Distribution: Debian, Ubuntu, LinuxMint, Slackware, SysrescueCD, Raspbian, Arch
Posts: 2,331

Original Poster
Rep: Reputation: 357Reputation: 357Reputation: 357Reputation: 357
I just now realized that I never came back and replied about whether user=ferrari's suggestion worked for me. It's been months, sorry for my delayed response. I just forgot.

Ferrari's suggestion worked!

I used this link that ferrari provided: http://ubuntuhandbook.org/index.php/...otspot-ubuntu/

...and followed method 3, "Using Unity’s Default Network Manager with a little hack"

Worked like a charm. Only took a few seconds to implement (after I removed all my other configuration where I had implemented a hotspot manually). No issues - worked perfectly the first time I tried it. I can hotplug my external USB WiFi adapter and the hotspot comes up/goes down as expected, with full functionality.

Thanks ferrari!
 
Old 04-02-2016, 02:58 PM   #5
ferrari
LQ Guru
 
Registered: Sep 2003
Location: Auckland, NZ
Distribution: openSUSE Leap
Posts: 5,819

Rep: Reputation: 1144Reputation: 1144Reputation: 1144Reputation: 1144Reputation: 1144Reputation: 1144Reputation: 1144Reputation: 1144Reputation: 1144
All good. Glad to have been of help you with pointing you in the right direction with using NM to achieve your hotpot goal!
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
network interface not coming up automatically at boot Kropotkin Linux - Networking 11 02-16-2010 05:15 PM
packet coming through one interface route out via another interface and SNAT also saiyen2002 Linux - Networking 2 09-14-2009 06:56 PM
network interface question in debian webofunni Debian 2 05-21-2009 02:21 PM
network interface question in debian webofunni Linux - Networking 1 05-20-2009 07:28 PM
network interface not coming backup after reboot noir911 Linux - Server 2 02-10-2009 11:03 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 01:41 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration