The officially official Devuan Forum!

You are not logged in.

#1 2021-04-27 15:00:00

rolfie
Member
Registered: 2017-11-25
Posts: 1,055  

[SOLVED] Need some support for setting up wifi correctly

For the first time in my life I have bought a laptop for private use in expectation of a longer absence from home. All my network knowhow is based on wired LAN with fixed IPs in my home network. Now I am struggeling to get wifi to work.

The laptop is an Acer Aspire 5 with a AMD 4500U CPU filled with the Chimaera alpha, running Mate desktop on an encrypted LVM. Setup was done with wired LAN. Looks like all the required firmware is loaded.

# lspci -vv

04:00.0 Network controller: Qualcomm Atheros QCA6174 802.11ac Wireless Network Adapter (rev 32)
	Subsystem: Lite-On Communications Inc QCA6174 802.11ac Wireless Network Adapter
	Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx+
	Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
	Latency: 0, Cache Line Size: 64 bytes
	Interrupt: pin A routed to IRQ 79
	IOMMU group: 11
	Region 0: Memory at d0000000 (64-bit, non-prefetchable) [size=2M]
	Capabilities: [40] Power Management version 3
		Flags: PMEClk- DSI- D1- D2- AuxCurrent=375mA PME(D0+,D1-,D2-,D3hot+,D3cold+)
		Status: D0 NoSoftRst- PME-Enable- DSel=0 DScale=0 PME-
	Capabilities: [50] MSI: Enable+ Count=1/8 Maskable+ 64bit-
		Address: fee00000  Data: 0000
		Masking: 000000fe  Pending: 00000000
	Capabilities: [70] Express (v2) Endpoint, MSI 00
		DevCap:	MaxPayload 256 bytes, PhantFunc 0, Latency L0s unlimited, L1 <64us
			ExtTag- AttnBtn- AttnInd- PwrInd- RBE+ FLReset- SlotPowerLimit 0.000W
		DevCtl:	CorrErr- NonFatalErr- FatalErr- UnsupReq-
			RlxdOrd+ ExtTag- PhantFunc- AuxPwr- NoSnoop-
			MaxPayload 256 bytes, MaxReadReq 512 bytes
		DevSta:	CorrErr- NonFatalErr- FatalErr- UnsupReq- AuxPwr+ TransPend-
		LnkCap:	Port #0, Speed 2.5GT/s, Width x1, ASPM L0s L1, Exit Latency L0s <4us, L1 <64us
			ClockPM+ Surprise- LLActRep- BwNot- ASPMOptComp+
		LnkCtl:	ASPM L1 Enabled; RCB 64 bytes, Disabled- CommClk+
			ExtSynch- ClockPM+ AutWidDis- BWInt- AutBWInt-
		LnkSta:	Speed 2.5GT/s (ok), Width x1 (ok)
			TrErr- Train- SlotClk+ DLActive- BWMgmt- ABWMgmt-
		DevCap2: Completion Timeout: Not Supported, TimeoutDis+ NROPrPrP- LTR+
			 10BitTagComp- 10BitTagReq- OBFF Via message, ExtFmt- EETLPPrefix-
			 EmergencyPowerReduction Not Supported, EmergencyPowerReductionInit-
			 FRS- TPHComp- ExtTPHComp-
			 AtomicOpsCap: 32bit- 64bit- 128bitCAS-
		DevCtl2: Completion Timeout: 50us to 50ms, TimeoutDis- LTR- OBFF Disabled,
			 AtomicOpsCtl: ReqEn-
		LnkCap2: Supported Link Speeds: 2.5GT/s, Crosslink- Retimer- 2Retimers- DRS-
		LnkCtl2: Target Link Speed: 2.5GT/s, EnterCompliance- SpeedDis-
			 Transmit Margin: Normal Operating Range, EnterModifiedCompliance- ComplianceSOS-
			 Compliance De-emphasis: -6dB
		LnkSta2: Current De-emphasis Level: -6dB, EqualizationComplete- EqualizationPhase1-
			 EqualizationPhase2- EqualizationPhase3- LinkEqualizationRequest-
			 Retimer- 2Retimers- CrosslinkRes: unsupported
	Capabilities: [100 v2] Advanced Error Reporting
		UESta:	DLP- SDES- TLP- FCP- CmpltTO- CmpltAbrt- UnxCmplt- RxOF- MalfTLP- ECRC- UnsupReq- ACSViol-
		UEMsk:	DLP- SDES- TLP- FCP- CmpltTO- CmpltAbrt- UnxCmplt- RxOF- MalfTLP- ECRC- UnsupReq- ACSViol-
		UESvrt:	DLP+ SDES+ TLP- FCP+ CmpltTO- CmpltAbrt- UnxCmplt- RxOF+ MalfTLP+ ECRC- UnsupReq- ACSViol-
		CESta:	RxErr- BadTLP- BadDLLP- Rollover- Timeout- AdvNonFatalErr-
		CEMsk:	RxErr- BadTLP- BadDLLP- Rollover- Timeout- AdvNonFatalErr+
		AERCap:	First Error Pointer: 00, ECRCGenCap- ECRCGenEn- ECRCChkCap- ECRCChkEn-
			MultHdrRecCap- MultHdrRecEn- TLPPfxPres- HdrLogCap-
		HeaderLog: 00000000 00000000 00000000 00000000
	Capabilities: [148 v1] Virtual Channel
		Caps:	LPEVC=0 RefClk=100ns PATEntryBits=1
		Arb:	Fixed- WRR32- WRR64- WRR128-
		Ctrl:	ArbSelect=Fixed
		Status:	InProgress-
		VC0:	Caps:	PATOffset=00 MaxTimeSlots=1 RejSnoopTrans-
			Arb:	Fixed- WRR32- WRR64- WRR128- TWRR128- WRR256-
			Ctrl:	Enable+ ID=0 ArbSelect=Fixed TC/VC=ff
			Status:	NegoPending- InProgress-
	Capabilities: [168 v1] Device Serial Number 00-00-00-00-00-00-00-00
	Capabilities: [178 v1] Latency Tolerance Reporting
		Max snoop latency: 0ns
		Max no snoop latency: 0ns
	Capabilities: [180 v1] L1 PM Substates
		L1SubCap: PCI-PM_L1.2+ PCI-PM_L1.1+ ASPM_L1.2+ ASPM_L1.1+ L1_PM_Substates+
			  PortCommonModeRestoreTime=50us PortTPowerOnTime=10us
		L1SubCtl1: PCI-PM_L1.2- PCI-PM_L1.1+ ASPM_L1.2- ASPM_L1.1+
			   T_CommonMode=0us LTR1.2_Threshold=0ns
		L1SubCtl2: T_PwrOn=10us
	Kernel driver in use: ath10k_pci
	Kernel modules: ath10k_pci

# iw dev
phy#0
	Interface wlan0
		ifindex 3
		wdev 0x1
		addr 94:08:53:88:fe:3f
		ssid SSID
		type managed
		channel 6 (2437 MHz), width: 20 MHz, center1: 2437 MHz
		txpower 20.00 dBm
		multicast TXQ:
			qsz-byt	qsz-pkt	flows	drops	marks	overlmt	hashcol	tx-bytes	tx-packets
			0	0	0	0	0	0	0	0		0

# ip link show
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast state DOWN mode DEFAULT group default qlen 1000
    link/ether b4:a9:fc:f0:49:e9 brd ff:ff:ff:ff:ff:ff
3: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP mode DORMANT group default qlen 1000
    link/ether 94:08:53:88:fe:3f brd ff:ff:ff:ff:ff:ff

   
One problem is that the interface does not react to ip link set wlan0 up. The following two seem to do the job. First of all the wifi is enabled in the 5 GHz range, after a while it drops to the 2.4GHz range. ifup throws an error. Is that normal?

# ifup wlan0
RTNETLINK answers: File exists
ifup: failed to bring up wlan0
# ip link set wlan0 up

The laptop is seen on my DSL router with its IP, but I can't ping the router nor get any internet connection. Whats wrong, what am I missing?

Contents of /etc/network/interfaces

# The primary network interface
allow-hotplug eth0
iface eth0 inet static
	address 10.5.5.31/24
	gateway 10.5.5.1
	# dns-* options are implemented by the resolvconf package, if installed
	dns-nameservers 10.5.5.1
	dns-search lan.atHome

# WLAN @ Home
allow-hotplug wlan0
iface wlan0 inet static
	address 10.5.5.32/24
	gateway 10.5.5.1
	dns-nameservers 10.5.5.1
	dns-search lan.atHome
	wpa-ssid 	SSID
	wpa-psk		passwd
	
From resolv.conf:
search lan.atHome
nameserver 10.5.5.1

Thanks for your feedback, rolfie

Offline

#2 2021-04-27 15:26:05

Head_on_a_Stick
Member
From: London
Registered: 2019-03-24
Posts: 3,125  
Website

Re: [SOLVED] Need some support for setting up wifi correctly

Can we see

ip a
ip r
ping -c3 8.8.8.8
ping -c3 google.com
rfkill list all

EDIT: I presume wpa-sssid & wpa-psk have the actual SSID & password filled in (rather than SSID & passwd)?

Last edited by Head_on_a_Stick (2021-04-27 15:27:37)


Brianna Ghey — Rest In Power

Offline

#3 2021-04-27 15:43:27

rolfie
Member
Registered: 2017-11-25
Posts: 1,055  

Re: [SOLVED] Need some support for setting up wifi correctly

rfkill tells me now:

# rfkill list all
0: hci0: Bluetooth
	Soft blocked: no
	Hard blocked: no
1: acer-wireless: Wireless LAN
	Soft blocked: no
	Hard blocked: no
2: acer-bluetooth: Bluetooth
	Soft blocked: no
	Hard blocked: no
3: phy0: Wireless LAN
	Soft blocked: no
	Hard blocked: no

Seems I am also having issues with powersave, and I have no idea how to wake up the wifi when its sleeping. After a fresh reboot:

# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast state DOWN group default qlen 1000
    link/ether b4:a9:fc:f0:49:e9 brd ff:ff:ff:ff:ff:ff
    inet 10.5.5.31/24 brd 10.5.5.255 scope global eth0
       valid_lft forever preferred_lft forever
3: wlan0: <BROADCAST,MULTICAST> mtu 1500 qdisc noqueue state DOWN group default qlen 1000
    link/ether 94:08:53:88:fe:3f brd ff:ff:ff:ff:ff:ff
    inet 10.5.5.32/24 brd 10.5.5.255 scope global wlan0
       valid_lft forever preferred_lft forever
# ip link set wlan0 up
# ifup wlan0
RTNETLINK answers: File exists
ifup: failed to bring up wlan0
# ip link set wlan0 up
# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast state DOWN group default qlen 1000
    link/ether b4:a9:fc:f0:49:e9 brd ff:ff:ff:ff:ff:ff
    inet 10.5.5.31/24 brd 10.5.5.255 scope global eth0
       valid_lft forever preferred_lft forever
3: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
    link/ether 94:08:53:88:fe:3f brd ff:ff:ff:ff:ff:ff
    inet 10.5.5.32/24 brd 10.5.5.255 scope global wlan0
       valid_lft forever preferred_lft forever
    inet6 fe80::9608:53ff:fe88:fe3f/64 scope link tentative 
       valid_lft forever preferred_lft forever
# ip r
default via 10.5.5.1 dev eth0 onlink linkdown 
10.5.5.0/24 dev eth0 proto kernel scope link src 10.5.5.31 linkdown 
10.5.5.0/24 dev wlan0 proto kernel scope link src 10.5.5.32 
169.254.0.0/16 dev eth0 scope link metric 1000 linkdown 
# ping -c 3 10.5.5.1
PING 10.5.5.1 (10.5.5.1) 56(84) bytes of data.
From 10.5.5.31 icmp_seq=1 Destination Host Unreachable
From 10.5.5.31 icmp_seq=2 Destination Host Unreachable
From 10.5.5.31 icmp_seq=3 Destination Host Unreachable

--- 10.5.5.1 ping statistics ---
3 packets transmitted, 0 received, +3 errors, 100% packet loss, time 2054ms
pipe 3
# ping -c 3 8.8.8.8
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
From 10.5.5.31 icmp_seq=1 Destination Host Unreachable
From 10.5.5.31 icmp_seq=2 Destination Host Unreachable
From 10.5.5.31 icmp_seq=3 Destination Host Unreachable

--- 8.8.8.8 ping statistics ---
3 packets transmitted, 0 received, +3 errors, 100% packet loss, time 2034ms
pipe 2
# ping -c 3 google.com
ping: google.com: Temporärer Fehler bei der Namensauflösung

Directly after the reboot the wifi is down. I have to wake it up, then the 5G connection is opened.

The if r brings an interesting fact to daylight:

169.254.0.0/16 dev eth0 scope link metric 1000 linkdown

What is that? I am sure I never set this anywhere.

Edit: found an entry in the /etc/networks file: link-local 169.254.0.0. There are also some entries in /etc/network/-subdirs that refer to avahi. The scripts also contain a reference to these adresses.

Somewhere a route is specified that does only work with eth0.

Suggestions?

Rolf

Last edited by rolfie (2021-04-27 15:55:34)

Offline

#4 2021-04-27 15:46:10

rolfie
Member
Registered: 2017-11-25
Posts: 1,055  

Re: [SOLVED] Need some support for setting up wifi correctly

Head_on_a_Stick wrote:

EDIT: I presume wpa-sssid & wpa-psk have the actual SSID & password filled in (rather than SSID & passwd)?

Yes, I have removed the real contents and replaced it with dummy data. As I mentioned, the DSL router (a AVM Fritzbox 7580) sees my laptop (after some struggle) and also tells me which frequency the laptop is using. Also the IP is present.

rolfie

Offline

#5 2021-04-27 16:22:24

Head_on_a_Stick
Member
From: London
Registered: 2019-03-24
Posts: 3,125  
Website

Re: [SOLVED] Need some support for setting up wifi correctly

I think the RTNETLINK error is because the gateway is defined twice.

Try using DHCP for the wireless interface.

Last edited by Head_on_a_Stick (2021-04-27 16:22:52)


Brianna Ghey — Rest In Power

Offline

#6 2021-04-27 18:04:10

rolfie
Member
Registered: 2017-11-25
Posts: 1,055  

Re: [SOLVED] Need some support for setting up wifi correctly

For the time being, I will stick with the static adressing. Thats not the issue. And I don't want to switch my complete home network from static to dynamic adresses right now. No time for this.

Head_on_a_Stick wrote:

I think the RTNETLINK error is because the gateway is defined twice.

Try using DHCP for the wireless interface.

Yes, can confirm this. BUUUT: when I remove the gateway definition in the wlan0 section, I can't get the interface to wake up again. Has cost me several minutes not to say hours now. So I have the message back and the wlan0 at least being recognised agaion by the router. Also I have looked a bit deeper into the routing issue and found one or the other bit of information in the internet. Unfortunatley, a lot of the stuff seems to be outdated, syntax no more correct .....

Made a little step forward by adding a route for wlan0:

route add -net 10.5.5.0 netmask 255.255.255.0 gw 10.5.5.1 dev wlan0
# route
Kernel-IP-Routentabelle
Ziel            Router          Genmask         Flags Metric Ref    Use Iface
default         fritz.box       0.0.0.0         UG    0      0        0 eth0
localnet        fritz.box       255.255.255.0   UG    0      0        0 wlan0
localnet        0.0.0.0         255.255.255.0   U     0      0        0 eth0
localnet        0.0.0.0         255.255.255.0   U     0      0        0 wlan0
link-local      0.0.0.0         255.255.0.0     U     1000   0        0 eth0

Now a few pings do work:

# ping -c 3 10.5.5.1
PING 10.5.5.1 (10.5.5.1) 56(84) bytes of data.
64 bytes from 10.5.5.1: icmp_seq=1 ttl=64 time=6.15 ms
64 bytes from 10.5.5.1: icmp_seq=2 ttl=64 time=6.77 ms
64 bytes from 10.5.5.1: icmp_seq=3 ttl=64 time=4.38 ms

--- 10.5.5.1 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2004ms
rtt min/avg/max/mdev = 4.384/5.768/6.770/1.010 ms
# ping -c 3 8.8.8.8 
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
From 10.5.5.31 icmp_seq=1 Destination Host Unreachable
From 10.5.5.31 icmp_seq=2 Destination Host Unreachable
From 10.5.5.31 icmp_seq=3 Destination Host Unreachable

--- 8.8.8.8 ping statistics ---
3 packets transmitted, 0 received, +3 errors, 100% packet loss, time 2050ms
pipe 3
# ping google.com -c 3
PING google.com(fra16s56-in-x0e.1e100.net (2a00:1450:4001:82f::200e)) 56 data bytes
64 bytes from fra16s56-in-x0e.1e100.net (2a00:1450:4001:82f::200e): icmp_seq=1 ttl=119 time=19.3 ms
64 bytes from fra16s56-in-x0e.1e100.net (2a00:1450:4001:82f::200e): icmp_seq=2 ttl=119 time=18.4 ms
64 bytes from fra16s56-in-x0e.1e100.net (2a00:1450:4001:82f::200e): icmp_seq=3 ttl=119 time=20.4 ms

--- google.com ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2004ms
rtt min/avg/max/mdev = 18.355/19.366/20.437/0.850 ms
# ping www.spiegel.de -c 3
PING aacfb9d106f4.link11.de (128.65.210.180) 56(84) bytes of data.
From rh031.lan.beiHeinrichs (10.5.5.31) icmp_seq=1 Destination Host Unreachable
From rh031.lan.beiHeinrichs (10.5.5.31) icmp_seq=2 Destination Host Unreachable
From rh031.lan.beiHeinrichs (10.5.5.31) icmp_seq=3 Destination Host Unreachable

--- aacfb9d106f4.link11.de ping statistics ---
3 packets transmitted, 0 received, +3 errors, 100% packet loss, time 2056ms
pipe 3

As it looks like now I can ping the DSL router, and a few things work on the internet. Strangely enough the 8.8.8.8 did not work, while google.com was resolved. Also tried to call up the magazine Spiegel with Firefox, adress isn't resolved. No idea why not.

Something still isn't right.

Also tried to add some routing ruies to the interfaces file, does not seem to work as expected.

up route add -net 10.5.5.0 netmask 255.255.255.0 gw 10.5.5.1
down route delete -net 10.5.5.0 netmask 255.255.255.0 gw 10.5.5.1

Where do I need to go from here?

rolfie

Last edited by rolfie (2021-04-27 18:05:31)

Offline

#7 2021-04-27 18:27:35

Head_on_a_Stick
Member
From: London
Registered: 2019-03-24
Posts: 3,125  
Website

Re: [SOLVED] Need some support for setting up wifi correctly

rolfie wrote:

I don't want to switch my complete home network from static to dynamic adresses right now

You can set specific address with a DHCP client.

I've never tried having both ethernet and wireless configured via /etc/network/interfaces and my Debian system is gone now so I can't fiddle with it to test what works (sorry).

If you're using chimaera then perhaps try iwd for the wireless connection. That can both associate with the SSID and assign the IP addresses all by itself.


Brianna Ghey — Rest In Power

Offline

#8 2021-04-28 01:44:31

ralph.ronnquist
Administrator
From: Battery Point, Tasmania, AUS
Registered: 2016-11-30
Posts: 1,117  

Re: [SOLVED] Need some support for setting up wifi correctly

You need to set the default route to be via the wlan0 interface

# ip route replace default via 10.5.5.1 dev wlan0

You also should rather not have localnet routes to 0.0.0.0; it doesn't really matter since the first matching rule (via wlan0) is used shadowing the other but it may bring confusion to the mind of the operator.

EDIT: actually I got confused; those are the "normal" net routes... but you should probably avoid net routes to unconnected interfaces. Remember that when there are multiple routes of same specificity, then the first in the list will be used.

Offline

#9 2021-04-28 13:20:05

rolfie
Member
Registered: 2017-11-25
Posts: 1,055  

Re: [SOLVED] Need some support for setting up wifi correctly

This laptops wifi is causing me headaches. I thought I had a working route setting yesterday evening. Today its not working any more. In addition, the wifi is not connecting on boot as the LAN connection does.

Digging in the internet showed that routing must be the issue, and I found one or the other useful hint. I modified the /etc/network/interfaces like this:

# The primary network interface
allow-hotplug eth0
iface eth0 inet static
	address 10.5.5.31/24
	gateway 10.5.5.1
	# dns-* options are implemented by the resolvconf package, if installed
	dns-nameservers 10.5.5.1
	dns-search lan.atHome
	post-up ip route del default
	post-up ip route add default via 10.5.5.1 dev eth0

# WLAN @ Home
allow-hotplug wlan0
iface wlan0 inet static
	address 10.5.5.32/24
	gateway 10.5.5.1
	dns-nameservers 10.5.5.1
	dns-search lan.atHome
	wpa-ssid 	        SSID
	wpa-psk		passwd
	#up route add -net 10.5.5.0 netmask 255.255.255.0 gw 10.5.5.1 dev wlan0
	#down route delete -net 10.5.5.0 netmask 255.255.255.0 gw 10.5.5.1 dev wlan0
	post-up ip route del default
	post-up ip route add default via 10.5.5.1 dev wlan0

After a # service networking --full-restart I could ping the DSL modem and use FF to call up some pages.

Today the wifi does not really like to start up. I can get it to start up by a series of ifup wlan0 and ip link set wlan0 up, but I haven't found a clue why its not working sometimes. Also restarting the service fails, and the route always is via eth0.

Errors I am getting:
On ifup I get RTNETLINK: file exists, failed to bring up wlan0.
On the restart of the service I get: wpa_supplicant daemon failed to start, exited with return code 1.

I am a bit exhausted in the moment.

rolfie

BTW: is there a toolkit that allows to use the functions keys of the laptop that are triggered by FN-Fx under Windows in the same way in Debian/Devuan?

Offline

#10 2021-04-28 14:13:43

dice
Member
Registered: 2020-11-22
Posts: 559  
Website

Re: [SOLVED] Need some support for setting up wifi correctly

nevermind.....

Last edited by dice (2021-04-28 14:19:48)

Offline

#11 2021-04-28 14:18:15

ralph.ronnquist
Administrator
From: Battery Point, Tasmania, AUS
Registered: 2016-11-30
Posts: 1,117  

Re: [SOLVED] Need some support for setting up wifi correctly

Firstly, you cannot easily have two interfaces configured for the same network. I.e., if you want eth0 down and wlan0 up, you'd need to do that, in that order:

# ifdown eth0 ; ifup wlan0

Secondly, the gateway for static configuration does the same as your post-up additions to the wlan0 confguration; i.e. remove the post-up lines.

Thirdly, with allow-hotplug rather than auto you declare that networking should be managed via hotplugging, in which case udev will try to configure the nominated interfaces. Both of them if there is a cable, and potentially with a bit of race between them; one first, then the other. Since you have gateway declarations for both configurations, there will be a competition where the first one wins.

Possibly your misapprehension is that you regard the configurations as alternatives while udev will treat them as "complementary" or "conjunctive" and apply them both. Afaict the network management via either allow-hotplug (/lib/udev/net.agent) or auto (/etc/init.d/networking) don't actually detect "presence of cable" to only apply configurations "as per available cabling". Instead it will configure all interfaces that it is set to configure, i.e., both eth0 and wlan0, including the possible race and competition about gateway (aka default route).

The problem with 2 interfaces on the same network is that return traffic will go through the first unless you in addition set up a source based routing rule, so that the kernel has different routing tables for outbound packets depending on what the source IP is. That can be done, but it's not an automatic function in the kernel's networking logic.

Offline

#12 2021-04-28 15:22:53

rolfie
Member
Registered: 2017-11-25
Posts: 1,055  

Re: [SOLVED] Need some support for setting up wifi correctly

@Ralph: thanks for the input. I was so deep in digging into the wlan issues that I forgot that my company laptops always did ask me to shut down wifi when having a lan connection established. I probably need to start from scratch again.

Isn't there a tool that does this switching sort of automagically if configured accordingly? Or do I have to re-invent the wheel? Is any of the network managers of any use in this case?

Well, I think I need a break now for a day or so. My brain is confused by too many different posts describing differernt ways.

See you later alligator.

Offline

#13 2021-04-28 16:06:09

Head_on_a_Stick
Member
From: London
Registered: 2019-03-24
Posts: 3,125  
Website

Re: [SOLVED] Need some support for setting up wifi correctly

Try this:

auto eth0
iface eth0 inet static
	address 10.5.5.31/24
	gateway 10.5.5.1
	metric 10
	# dns-* options are implemented by the resolvconf package, if installed
	dns-nameservers 10.5.5.1
	dns-search lan.atHome

# WLAN @ Home
auto wlan0
iface wlan0 inet static
	address 10.5.5.32/24
	gateway 10.5.5.1
	metric 20
	dns-nameservers 10.5.5.1
	dns-search lan.atHome
	wpa-ssid 	SSID
	wpa-psk		passwd

The metric keyword assigns a priority to the interface, a lower metric value causes that interface to be favoured over the other.

Last edited by Head_on_a_Stick (2021-04-28 16:31:43)


Brianna Ghey — Rest In Power

Offline

#14 2021-04-28 17:19:18

Marjorie
Member
From: Teignmouth, UK
Registered: 2019-06-09
Posts: 219  

Re: [SOLVED] Need some support for setting up wifi correctly

rolfie wrote:

Isn't there a tool that does this switching sort of automagically if configured accordingly? Or do I have to re-invent the wheel? Is any of the network managers of any use in this case?

I use Network Manager and in Cinnamon the Network applet would allow you to enable whichever of ethernet or wireless is enabled.
You can still confuse it by choosing both if both are enabled.
With a laptop you'd usually choose ethernet if you were sitting at a desk that was wired. Elsewhere you'd probably try and use Wireless.

Offline

#15 2021-04-28 22:29:00

ralph.ronnquist
Administrator
From: Battery Point, Tasmania, AUS
Registered: 2016-11-30
Posts: 1,117  

Re: [SOLVED] Need some support for setting up wifi correctly

@rolfie, if you really want eth0 and wlan0 configurations to be alternatives you might add the lines

pre-up ifdown wlan0 || true

to the eth0 configuration, and

pre-up ifdown eth0 || true

to the wlan0 configuration.

You must also remove the allow-hotplug lines to avoid that the automated management tries to bring them both up on boot and status change. Then bring the right one up manually, or via some software that understands the applicable cabling situation, like for example wicd, connman or network-manager.

Note that any of the latter will compete with your current networking setup, so you will need to clear that out if you use one of them.

Alternatively you take the DIY approach using ethtool and wpa_cli to discover the applicable cabling situation; this approach brings the great joy of further learning situations. (For example that  wlan0 must be brought up at link level without configuration in order to scan for access points and determine its "cabling" options, while eth0 is more physical)

Offline

#16 2021-04-29 11:45:39

rolfie
Member
Registered: 2017-11-25
Posts: 1,055  

Re: [SOLVED] Need some support for setting up wifi correctly

Thank you for the suggestions. Using the network manager took care of all my issues, works like a charm. No fiddeling with routing, I can fix the wifi to the 5G band ....

Also worked again this morning.

rolfie

Offline

Board footer