LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   eth0/wlan0? (https://www.linuxquestions.org/questions/slackware-14/eth0-wlan0-4175656874/)

ceh383 07-04-2019 04:09 PM

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.

rkelsen 07-04-2019 04:18 PM

eth0/wlan0?
 
Bypass all that and use networkmanager. it's installed by default

ceh383 07-04-2019 04:24 PM

Quote:

Originally Posted by rkelsen (Post 6011988)
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?

Labinnah 07-04-2019 04:29 PM

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.

ceh383 07-04-2019 04:38 PM

Quote:

Originally Posted by Labinnah (Post 6011992)
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 (Post 6011992)
2. If wlan0 is static set GATEWAY to wlan0 gateway.

wlan0 is DHCP, so I guess no can do.
Quote:

Originally Posted by Labinnah (Post 6011992)
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 (Post 6011992)
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 :-)

BW-userx 07-04-2019 05:35 PM

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...(?)

ceh383 07-04-2019 09:01 PM

Quote:

Originally Posted by BW-userx (Post 6012007)
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.

TheRealGrogan 07-05-2019 02:22 AM

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 :-)

bassmadrigal 07-05-2019 02:59 AM

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.

ceh383 07-05-2019 09:15 AM

Quote:

Originally Posted by TheRealGrogan (Post 6012104)
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 (Post 6012104)
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 (Post 6012108)
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

luvr 07-05-2019 11:06 AM

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.

GazL 07-05-2019 03:22 PM

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.

rkelsen 07-05-2019 06:05 PM

Quote:

Originally Posted by ceh383 (Post 6011990)
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.

273 07-05-2019 07:28 PM

Quote:

Originally Posted by ceh383 (Post 6012184)
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?

ceh383 07-05-2019 08:51 PM

Quote:

Originally Posted by GazL (Post 6012332)
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 (Post 6012353)
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 (Post 6012361)
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.


All times are GMT -5. The time now is 08:40 PM.