LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 04-02-2018, 07:49 AM   #1
Turbocapitalist
LQ Guru
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 7,091
Blog Entries: 3

Rep: Reputation: 3665Reputation: 3665Reputation: 3665Reputation: 3665Reputation: 3665Reputation: 3665Reputation: 3665Reputation: 3665Reputation: 3665Reputation: 3665Reputation: 3665
Hotplug usb0 without disconnecting wlan0


I have a Raspbian 9.4 system set up as an access point but cannot hot-plug a network interface on usb0 without losing wlan0.

If I boot the machine I can connect from other machines to the network I've set up on wlan0 using dnsmasq either with or without usb0 in place:

A) If I have a network interface plugged into usb0 at boot time, the access point is available, including NAT (via iptables) as I expect.

B) If I have no network interface plugged into usb0 at boot time, then the access point is available, but only as a LAN as I expect.

The problem arises when I boot without a device on usb0 and then hot-plug it after the system is up and runnning. If I do that, then wlan0 disappears when usb0 comes up.

The contents of /etc/network/interfaces.d/wlan0 are:

Code:
iface wlan0 inet static
address 10.42.24.1
netmask 255.255.255.0
And the contents of /etc/network/interfaces.d/usb0 are:

Code:
allow-hotplug usb0
auto usb0
iface usb0 inet dhcp
What can I do to keep the access point on wlan0 available even after I hot-plug usb0?
 
Old 04-03-2018, 06:07 PM   #2
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,821

Rep: Reputation: 3610Reputation: 3610Reputation: 3610Reputation: 3610Reputation: 3610Reputation: 3610Reputation: 3610Reputation: 3610Reputation: 3610Reputation: 3610Reputation: 3610
This has been sitting here for a while so I'll make a guess.

I suspect that the metric of the usb nic is the reason. Maybe set metric for wifi over usb nic?

There other reason I guess could be that the dhcp of the usb affects the network or even static ip. In any case I don't really think it is a hotplug issue. Why do you suspect that?

Last edited by jefro; 04-03-2018 at 06:08 PM.
 
Old 04-16-2018, 01:33 AM   #3
Turbocapitalist
LQ Guru
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 7,091

Original Poster
Blog Entries: 3

Rep: Reputation: 3665Reputation: 3665Reputation: 3665Reputation: 3665Reputation: 3665Reputation: 3665Reputation: 3665Reputation: 3665Reputation: 3665Reputation: 3665Reputation: 3665
Thanks. I tried adding routing metrics to each interface with no identifiable results. The manual page interfaces(5) does not clarify what that option does. Which interface should have the higher metric integer? I'm not sure it matters because I've tried both ways, with one higher and the other lower and then vice versa.

What might be happening is that Raspbian 9.4 turns off the first interface when the second is added and then brings the first one up again. Other times the first interface just goes down and does not come back up. Either way this kills several daemons listening on the first interface which I need in order to reconnect and It seems that systemd does not seem to bring any of them back up automatically.
 
Old 04-16-2018, 02:02 AM   #4
Turbocapitalist
LQ Guru
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 7,091

Original Poster
Blog Entries: 3

Rep: Reputation: 3665Reputation: 3665Reputation: 3665Reputation: 3665Reputation: 3665Reputation: 3665Reputation: 3665Reputation: 3665Reputation: 3665Reputation: 3665Reputation: 3665
As a followup, it seems that it is the interface that is down via the Network Manager. The Network Manager cannot find it after physically connecting the second networking device. If I bring the interface up manually via ifconfig it still remains unavailable to the outside.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Force hotplug permissions for usb0 ? Xeratul Debian 4 04-11-2013 10:34 AM
wlan0 disconnecting when eth0 connects/disconnects Sammael Linux - Wireless Networking 0 08-15-2006 06:39 AM
no wlan0 without hotplug surftildusk Linux - Wireless Networking 1 04-04-2005 11:35 AM
Firmware/Hotplug problem with Hauppauge DEC2540-T, Hotplug and MythTV bezoomny Linux - Hardware 0 05-17-2004 02:37 PM
Broadcom wireless with ndiswrapper: ifconfig wlan0 works; ifup wlan0 fails orangechicken Linux - Wireless Networking 2 04-17-2004 06:39 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 03:02 AM.

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