LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 07-04-2019, 04:09 PM   #1
ceh383
Member
 
Registered: May 2003
Location: The Left coast, USA
Distribution: Slack_64 14.2
Posts: 226

Rep: Reputation: 29
eth0/wlan0?


Just installed Slack 14.2 on a 10 year old laptop, I figured why not, I wanted a beater I could bring to work and not worry about.
I've got it configured how I want it and have most of the software I want installed. It's working well, well for what it is any way.

While booting I noticed it hangs for a while waiting for eth0 to obtain a DHCP address. About 99% of the time I use wireless, so to get rid of the boot lag, I decided to set a static address, in /etc/rc.d/rc.inet1.conf for eth0.

Now all ethernet traffic is sent to eth0 even though wlan0 shows as being connected, I can't even ping my access point.

Is there a way to push everything to wlan0?
Or...
A) Disable eth0 completely.
B) Live with the boot lag as eth0 waits for no DHCP address.

Thanks in advance.
 
Old 07-04-2019, 04:18 PM   #2
rkelsen
Senior Member
 
Registered: Sep 2004
Distribution: slackware
Posts: 4,462
Blog Entries: 7

Rep: Reputation: 2561Reputation: 2561Reputation: 2561Reputation: 2561Reputation: 2561Reputation: 2561Reputation: 2561Reputation: 2561Reputation: 2561Reputation: 2561Reputation: 2561
eth0/wlan0?

Bypass all that and use networkmanager. it's installed by default
 
Old 07-04-2019, 04:24 PM   #3
ceh383
Member
 
Registered: May 2003
Location: The Left coast, USA
Distribution: Slack_64 14.2
Posts: 226

Original Poster
Rep: Reputation: 29
Quote:
Originally Posted by rkelsen View Post
Bypass all that and use networkmanager. it's installed by default
networkmanager is what's showing me wlan0 is connected. Perhaps I'm missing something simple here, I usually do, but I see no way to have eth0 avoid looking for DHCP or forcing wlan0 for traffic.

Can you supply some details please?
 
Old 07-04-2019, 04:29 PM   #4
Labinnah
Member
 
Registered: May 2014
Location: Łódź, Poland
Distribution: Slackware-current
Posts: 185

Rep: Reputation: 112Reputation: 112
Choose something from below:
1. Make sure you not overlap network settings between eth0 and wlan0.
2. If wlan0 is static set GATEWAY to wlan0 gateway.
3. You can set DHCP_TIMEOUT[some_number] for eth0 interface to low number.
4. You can blacklist eth0 kernel module.
5. If you don't want eth0 just don't configure it. Set IFNAME[0] to wlan0.
 
1 members found this post helpful.
Old 07-04-2019, 04:38 PM   #5
ceh383
Member
 
Registered: May 2003
Location: The Left coast, USA
Distribution: Slack_64 14.2
Posts: 226

Original Poster
Rep: Reputation: 29
Quote:
Originally Posted by Labinnah View Post
Choose something from below:
1. Make sure you not overlap network settings between eth0 and wlan0.
Gateway and DNS Servers are the same, is this overlapping?
Quote:
Originally Posted by Labinnah View Post
2. If wlan0 is static set GATEWAY to wlan0 gateway.
wlan0 is DHCP, so I guess no can do.
Quote:
Originally Posted by Labinnah View Post
3. You can set DHCP_TIMEOUT[some_number] for eth0 interface to low number.
This is a possibility, and will try it if no other suggestions.
Quote:
Originally Posted by Labinnah View Post
4. You can blacklist eth0 kernel module.
5. If you don't want eth0 just don't configure it. Set IFNAME[0] to wlan0.
I don't want to do either of these, I can see use in leaving it up.

Thank you for the suggestions :-)
 
Old 07-04-2019, 05:35 PM   #6
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (15 current), Slack15, Ubuntu studio, MX Linux, FreeBSD 13.1, WIn10
Posts: 10,342

Rep: Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242
I've always turned off my NIC in BIOS on my laptops, and never experienced what you're speaking of. maybe it is not so old as to not have a means to turn off your NIC via Bios, no detect , no look?

that's what I figure mine must be doing...(?)

Last edited by BW-userx; 07-04-2019 at 05:42 PM.
 
Old 07-04-2019, 09:01 PM   #7
ceh383
Member
 
Registered: May 2003
Location: The Left coast, USA
Distribution: Slack_64 14.2
Posts: 226

Original Poster
Rep: Reputation: 29
Quote:
Originally Posted by BW-userx View Post
I've always turned off my NIC in BIOS on my laptops, and never experienced what you're speaking of. maybe it is not so old as to not have a means to turn off your NIC via Bios, no detect , no look?

that's what I figure mine must be doing...(?)
No option for this in the BIOS on this old machine. For now, I set eth0 back to DHCP and wlan0 handles the ethernet traffic again.
 
Old 07-05-2019, 02:22 AM   #8
TheRealGrogan
Member
 
Registered: Oct 2010
Location: Ontario, Canada
Distribution: Slackware, LFS, Manjaro (for gaming)
Posts: 570

Rep: Reputation: 413Reputation: 413Reputation: 413Reputation: 413Reputation: 413
If that's happening with the ethernet cable disconnected from the laptop while using wifi, that's bloody silly, isn't it.

How about, blacklist your kernel module for the ethernet NIC, and unblacklist it when you want to use it? There should be no boot delay then :-)
 
Old 07-05-2019, 02:59 AM   #9
bassmadrigal
LQ Guru
 
Registered: Nov 2003
Location: West Jordan, UT, USA
Distribution: Slackware
Posts: 8,792

Rep: Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656
If your computer is trying to get an address from the dhcp server during boot, it is likely because it is requested via /etc/rc.d/rc.inet1.conf.

If you go in there and change USE_DHCP[0]="yes" under eth0 to USE_DHCP[0]="", it won't hunt for an IP on boot anymore.
 
1 members found this post helpful.
Old 07-05-2019, 09:15 AM   #10
ceh383
Member
 
Registered: May 2003
Location: The Left coast, USA
Distribution: Slack_64 14.2
Posts: 226

Original Poster
Rep: Reputation: 29
Quote:
Originally Posted by TheRealGrogan View Post
If that's happening with the ethernet cable disconnected from the laptop while using wifi, that's bloody silly, isn't it.
Yes it is, and that is exactly what it does.

Quote:
Originally Posted by TheRealGrogan View Post
How about, blacklist your kernel module for the ethernet NIC, and unblacklist it when you want to use it? There should be no boot delay then :-)
That's a good thought, I may try it if there are no better solutions.

Quote:
Originally Posted by bassmadrigal View Post
If your computer is trying to get an address from the dhcp server during boot, it is likely because it is requested via /etc/rc.d/rc.inet1.conf.

If you go in there and change USE_DHCP[0]="yes" under eth0 to USE_DHCP[0]="", it won't hunt for an IP on boot anymore.
That's where I set the IP address for eth0, and I set USE_DHCP[0]="no".
I tried your suggestion, it seems to work well enough, and will be easy enough to change later if needed.

Thanks all
 
Old 07-05-2019, 11:06 AM   #11
luvr
Member
 
Registered: May 2005
Location: Boom - The Home Town of Tomorrowland, Belgium
Distribution: Slackware, Xubuntu
Posts: 459
Blog Entries: 2

Rep: Reputation: 194Reputation: 194
Do you even need these /etc/rc.d/inet* thingies if you use NetworkManager anyway?

Did you opt for NetworkManager when you configured the network during install? That's what I do nowadays, and I no longer experience any of the issues that you describe.
 
Old 07-05-2019, 03:22 PM   #12
GazL
LQ Veteran
 
Registered: May 2008
Posts: 6,906

Rep: Reputation: 5026Reputation: 5026Reputation: 5026Reputation: 5026Reputation: 5026Reputation: 5026Reputation: 5026Reputation: 5026Reputation: 5026Reputation: 5026Reputation: 5026
I replaced rc.inet1 with this:
Code:
#!/bin/sh

case "${1:-start}" in
	start)  echo "Starting Network Interfaces..."
		ip -batch - <<-EOF
			address flush dev lo
			address add 127.0.0.1 dev lo
			link set lo up
		EOF

		if  [ ! -e /var/run/wpa_supplicant/wlan0 ]; then
			iw reg set GB
			wpa_supplicant -B -c /etc/wpa_supplicant/wlan0.conf -i wlan0 >/dev/null
		fi
		dhcpcd -q -b -L -M wlan0 eth0
		;;
	stop)   echo "Stopping Network Interfaces..."
		dhcpcd -q -k
		sleep 2
		ip -batch - <<-EOF
			link set eth0 down
			link set wlan0 down
		EOF
		if [ -e /var/run/wpa_supplicant/wlan0 ]; then 
			wpa_cli -i wlan0 terminate >/dev/null
		fi
		;;
esac
I can't say I've noticed any delay when eth0 isn't plugged in. The wlan0 interface gets assigned a higher metric than eth0, so eth0 will be used in preference to wlan0 when both are connected.
 
Old 07-05-2019, 06:05 PM   #13
rkelsen
Senior Member
 
Registered: Sep 2004
Distribution: slackware
Posts: 4,462
Blog Entries: 7

Rep: Reputation: 2561Reputation: 2561Reputation: 2561Reputation: 2561Reputation: 2561Reputation: 2561Reputation: 2561Reputation: 2561Reputation: 2561Reputation: 2561Reputation: 2561
Quote:
Originally Posted by ceh383 View Post
Perhaps I'm missing something simple here, I usually do, but I see no way to have eth0 avoid looking for DHCP or forcing wlan0 for traffic.
There are a couple of steps to this.

Step 1.

Code:
# chmod -x /etc/rc.d/rc.netdevice
Step 2.

Edit the eth0 section of /etc/rc.d/rc.inet1.conf so that it looks like this:

Code:
# Config information for eth0:
IPADDR[0]=""
NETMASK[0]=""
USE_DHCP[0]=""
DHCP_HOSTNAME[0]=""
Once you make these changes and reboot, networkmanager will be in control and you should no longer have the problem.
 
Old 07-05-2019, 07:28 PM   #14
273
LQ Addict
 
Registered: Dec 2011
Location: UK
Distribution: Debian Sid AMD64, Raspbian Wheezy, various VMs
Posts: 7,680

Rep: Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373
Quote:
Originally Posted by ceh383 View Post
Yes it is, and that is exactly what it does.


That's a good thought, I may try it if there are no better solutions.


That's where I set the IP address for eth0, and I set USE_DHCP[0]="no".
I tried your suggestion, it seems to work well enough, and will be easy enough to change later if needed.

Thanks all
Why are you giving it an IP address if you don't want to use it?
 
Old 07-05-2019, 08:51 PM   #15
ceh383
Member
 
Registered: May 2003
Location: The Left coast, USA
Distribution: Slack_64 14.2
Posts: 226

Original Poster
Rep: Reputation: 29
Quote:
Originally Posted by GazL View Post
I replaced rc.inet1 with this:
Code:
#!/bin/sh

case "${1:-start}" in
	start)  echo "Starting Network Interfaces..."
		ip -batch - <<-EOF
			address flush dev lo
			address add 127.0.0.1 dev lo
			link set lo up
		EOF

		if  [ ! -e /var/run/wpa_supplicant/wlan0 ]; then
			iw reg set GB
			wpa_supplicant -B -c /etc/wpa_supplicant/wlan0.conf -i wlan0 >/dev/null
		fi
		dhcpcd -q -b -L -M wlan0 eth0
		;;
	stop)   echo "Stopping Network Interfaces..."
		dhcpcd -q -k
		sleep 2
		ip -batch - <<-EOF
			link set eth0 down
			link set wlan0 down
		EOF
		if [ -e /var/run/wpa_supplicant/wlan0 ]; then 
			wpa_cli -i wlan0 terminate >/dev/null
		fi
		;;
esac
I can't say I've noticed any delay when eth0 isn't plugged in. The wlan0 interface gets assigned a higher metric than eth0, so eth0 will be used in preference to wlan0 when both are connected.
Thank you for this, I'll give it a try.

Quote:
Originally Posted by rkelsen View Post
There are a couple of steps to this.

Step 1.

Code:
# chmod -x /etc/rc.d/rc.netdevice
Step 2.

Edit the eth0 section of /etc/rc.d/rc.inet1.conf so that it looks like this:

Code:
# Config information for eth0:
IPADDR[0]=""
NETMASK[0]=""
USE_DHCP[0]=""
DHCP_HOSTNAME[0]=""
Once you make these changes and reboot, networkmanager will be in control and you should no longer have the problem.
If the above doesn't work for me, I'll give this a try. Thank you.

Quote:
Originally Posted by 273 View Post
Why are you giving it an IP address if you don't want to use it?
A) Thought it would get rid of the DHCP caused delay at boot.
B) It would still be usable at home if I needed it.
 
  


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
How to fix:UDP packet send through vlan(eth0.4092), reaching at both eth0 and eth0.4092 arjuncr Linux - Networking 1 02-19-2019 02:37 PM
eth0 and wlan0 vs wlan0 problem player107 Linux - Wireless Networking 3 02-25-2013 09:54 AM
vnStat - if pointed to eth0 will it aggregate eth0 and eth0:1 alias stardotstar Linux - Networking 0 07-20-2010 07:49 PM
dhclient wlan0 - wlan0: not found nickleus Linux - Networking 1 05-10-2005 09:06 PM
Broadcom wireless with ndiswrapper: ifconfig wlan0 works; ifup wlan0 fails orangechicken Linux - Wireless Networking 2 04-17-2004 05:39 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 01:07 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