LinuxQuestions.org
Help answer threads with 0 replies.
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 10-09-2023, 08:45 PM   #1
vondyke
LQ Newbie
 
Registered: Jul 2022
Posts: 6

Rep: Reputation: 5
Question Start only loopback network interface on boot


Hello, everyone

I run slackware on a laptop primarily with wireless networking and have `wlan0` configured to use `wpa_supplicant` for connection authentication, however, initial WPA handshakes fail regularly for me. It's not a big issue, I just need to run `/etc/rc.d/rc.inet1 wlan0_restart` (I have a `restart_wlan` script for this which is important for my workflow) so it tries the WPA handshake again.

For this occasional failures I disable the `rc.inet1` script from boot as to not wait for the WiFi to connect before I can start using the computer; I've configured my xsession to run my `restart_wlan` script which works fine but my issue is that it only starts the `wlan0` interface and not the rest, namely, the `lo` interface so I have no 127.0.0.1 device unless I run `/etc/rc.d/rc.inet1 restart` which will trigger another WPA handshake negotiation with the wireless access point.

Is there a way I can configure the `wlan0` interface to **not** start during boot (i.e., `/etc/rc.d/rc.inet1 start`)?

Is there a better workflow I could give a try?
 
Old 10-10-2023, 03:53 AM   #2
tadgy
Member
 
Registered: May 2018
Location: UK
Distribution: Slackware (servers), Void (desktop/laptop)
Posts: 304

Rep: Reputation: 410Reputation: 410Reputation: 410Reputation: 410Reputation: 410
Please can you paste your rc.inet1.conf here so I can take a look and hopefully give you a better workflow
 
Old 10-10-2023, 05:15 AM   #3
zeebra
Senior Member
 
Registered: Dec 2011
Distribution: Slackware
Posts: 1,834
Blog Entries: 17

Rep: Reputation: 643Reputation: 643Reputation: 643Reputation: 643Reputation: 643Reputation: 643
Quote:
Originally Posted by vondyke View Post
Is there a better workflow I could give a try?
Probably the best way for this is to write your own custom rc.inet1 based on rc.inet1 and put the old one in rc.inet1.old. It's not as bad as it sounds, rc.inet1 is pretty well documented, and you could pretty much just remove the parts you don't need to make your custom version. And/or rewrite parts of it, to fit you better.

And, if you make a minimal rc.inet1, you could split other necessary bits into your own script(s), rc.wlan for example and load that conditionally or unconditionally with rc.M OR rc.local.

Last edited by zeebra; 10-10-2023 at 05:38 AM.
 
Old 10-10-2023, 07:56 AM   #4
chemfire
Member
 
Registered: Sep 2012
Posts: 426

Rep: Reputation: Disabled
I would recommend switching to network manager before writing custom rc.inet1. Especially on a laptop. I don't use NM on my desktop or my server but I do use it on my laptop. Its awful convenient for situations where you might switch between wired and wireless Ethernet, might want to boot without wired connected and not wait for timeouts etc.

I like certainly and simplicity of the good old fashion scripts, and I think it makes sense to stick with them where network configuration is always fixed. However for a portable machine even if it does not travel often the flexibility of NM is probably worth the trade offs. Not saying you can't fix this problem a million other ways on Slackware, and unlike other distros Slackware will leave you alone and let you if you go that route of customizing inet1 or similar but even if you have not needed it being able to quickly change network settings via NM might be a nice to have and is likely to solve the problem at the same time.

There are also plain cli and curses interfaces for NM so even if you not running one of the desktop environments or want to script out some behaviors it is still easy to use.

Last edited by chemfire; 10-10-2023 at 07:59 AM.
 
Old 10-10-2023, 01:58 PM   #5
vondyke
LQ Newbie
 
Registered: Jul 2022
Posts: 6

Original Poster
Rep: Reputation: 5
Quote:
Originally Posted by tadgy View Post
Please can you paste your rc.inet1.conf here so I can take a look and hopefully give you a better workflow
Sure, these are the non-comment lines in my `rc.inet1.conf`:

Code:
> grep -e '^[^# ]' /etc/rc.d/rc.inet1.conf
IPADDRS[0]=""
USE_DHCP[0]=""
IP6ADDRS[0]=""
USE_SLAAC[0]=""
USE_DHCP6[0]=""
DHCP_HOSTNAME[0]=""
IPADDRS[1]=""
USE_DHCP[1]=""
IP6ADDRS[1]=""
USE_SLAAC[1]=""
USE_DHCP6[1]=""
DHCP_HOSTNAME[1]=""
IPADDRS[2]=""
USE_DHCP[2]=""
IP6ADDRS[2]=""
USE_SLAAC[2]=""
USE_DHCP6[2]=""
DHCP_HOSTNAME[2]=""
IPADDRS[3]=""
USE_DHCP[3]=""
IP6ADDRS[3]=""
USE_SLAAC[3]=""
USE_DHCP6[3]=""
DHCP_HOSTNAME[3]=""
GATEWAY=""
GATEWAY6=""
IFNAME[4]="wlan0"
USE_DHCP[4]="yes"
WLAN_WPA[4]="wpa_supplicant"
DEBUG_ETH_UP="no"
After posting this thread, I decided to change my `restart_wlan` script to be more permissive. For context, this is executed from `~/.xinitrc` and used to be simply be: `sh /etc/rc.d/rc.inet1 wlan0_restart`:

Code:
#!/bin/bash
#
# Usage: restart_wlan [<iface>]
#
# By default it restarts all network interfaces unless `<iface>` is passeed,
# in which case only `<iface>` is restarted.
#
# <iface> MUST be a valid interface name configured in `rc.inet1.conf(5)`
#
# Examples:
#
# To restart all network interfaces:
#
#   $ restart_wlan
#
# To restart the `wlan0` interface:
#
#   $ restart_wlan wlan0

INET1_ARG="restart"

if [ -n "$1" ]
then
    INET1_ARG="${1}_restart"
fi

sh /etc/rc.d/rc.inet1 $INET1_ARG
I was thinking I could restart **all** network interfaces when starting X and then restart only `wlan0` when necessary; I think this would be the path of least resistance. I'd prefer to **NOT** have a custom `rc.inet1` script as I don't wanna maintain it.

Quote:
Originally Posted by chemfire View Post
I would recommend switching to network manager before writing custom rc.inet1. [...]
This is probably the best tradeoff... I've used `rc.inet1.conf` out of comfort because I just uncomment a few lines, add the WPA password and call it a day but maybe getting familiar with the NM setup is probably worthwhile. I didn't even consider it so thanks for the suggestion I'll give it a try
 
  


Reply

Tags
interface, wifi, wireless



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
loopback network interface driver location avee137 Linux - Newbie 5 10-04-2016 01:08 PM
Why is there no function for packet reception in linux loopback network interface ? avee137 Linux - Newbie 3 08-26-2011 11:39 PM
[SOLVED] problem with ethernet loopback test using loopback plug/stub: receiving socket not se mcha Linux - Kernel 3 08-26-2010 11:28 AM
ioctl(SIOCGIFCONF) returns only loopback interface info Braiam Linux - Software 0 03-08-2010 01:42 PM
Loopback the only interface after 12.1 upgrade... Lufbery Slackware 5 05-15-2008 08:58 PM

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

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