LinuxQuestions.org
Visit Jeremy's Blog.
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 08-04-2013, 01:09 AM   #1
guanx
Senior Member
 
Registered: Dec 2008
Posts: 1,201

Rep: Reputation: 244Reputation: 244Reputation: 244
[Suggestion] How to add parameters to wpa_supplicant and dhcpcd in rc.inet1.conf


Today when I was setting up a bonding interface, I put the followings in "/etc/rc.d/rc.netdevice":
Code:
#! /bin/sh
modprobe bonding mode=active-backup miimon=100 downdelay=200 updelay=200 primary=eth0
ifconfig bond0 up
ifenslave bond0 eth0
ifenslave bond0 wlan0
and these in "/etc/rc.d/rc.inet1.conf":
Code:
# Config information for eth0:
IFNAME[0]="wlan0"
IPADDR[0]=""
NETMASK[0]=""
USE_DHCP[0]="no"
WLAN_MODE[0]=Managed
WLAN_WPA[0]="wpa_supplicant"
WLAN_WPACONF[0]="/etc/wpa_supplicant.conf -b bond0"
WLAN_WPADRIVER[0]="wext"
WLAN_WPAWAIT[0]=10

# Config information for eth1:
IFNAME[1]="bond0"
IPADDR[1]=""
NETMASK[1]=""
USE_DHCP[1]="yes"
DHCP_HOSTNAME[1]=""
It works as expected but my workaround to add the "-b" parameter to wpa_supplicant is certainly ulgy. Is there an elegant way of adding extra parameters to wpa_supplicant in "rc.inet1.conf"?

Similarly, I find it difficult to add options (such as --nolink) to dhcpcd.

Last edited by guanx; 08-04-2013 at 11:34 AM. Reason: Solved
 
Old 08-04-2013, 11:33 AM   #2
guanx
Senior Member
 
Registered: Dec 2008
Posts: 1,201

Original Poster
Rep: Reputation: 244Reputation: 244Reputation: 244
I've made these changes to rc.wireless and rc.inet1 for adding options to wpa_supplicant and dhcpcd. Hope these doesn't hurt.
Code:
--- rc.wireless 2013-08-04 12:28:09.420596206 -0400
+++ rc.wireless.new     2013-08-04 12:28:27.072548445 -0400
@@ -175,6 +175,7 @@
 # The default config file as installed by the wpa_supplicant package:
 WPACONF=${WLAN_WPACONF[$i]:-${WPACONF:="/etc/wpa_supplicant.conf"}}
 WPAWAIT=${WLAN_WPAWAIT[$i]:-${WPAWAIT:="60"}}
+WPA_OPTIONS=${WLAN_WPAOPTIONS[$i]:-${WPAOPTIONS}}
 
 
 [ -n "$VERBOSE" -a -n "$INFO" ] && echo "$0:  $1 information: '$INFO'"
@@ -289,8 +290,7 @@
        # Interface down, so wpa_supplicant can associate with the AP
        $IFCOMMAND down
        #WPACONF=${WPACONF:-/etc/wpa_supplicant.conf}
-       WPA_OPTIONS=""
-       [ ${WPADRIVER} ] && WPA_OPTIONS="-D${WPADRIVER}" # specify the driver
+       [ ${WPADRIVER} ] && WPA_OPTIONS="${WPA_OPTIONS} -D${WPADRIVER}" # specify the driver
        [ ${WPA} = "wpaxsupplicant" ] && WPA_OPTIONS="${WPA_OPTIONS} -e" # Use external xsupplicant (disables the internal supplicant)
 
        # We leave a running wpa_supplicant process in peace:
Code:
--- rc.inet1    2013-08-04 12:28:05.914399737 -0400
+++ rc.inet1.new        2013-08-04 12:28:18.687103653 -0400
@@ -131,7 +131,7 @@
       fi
       if [ "${USE_DHCP[$i]}" = "yes" ]; then # use DHCP to bring interface up
         # Clear DHCP_OPTIONS before adding new options to it:
-        unset DHCP_OPTIONS
+        DHCP_OPTIONS="${DHCP_OPTIONS[$i]}"
         # Set DHCP_OPTIONS for this interface:
         [ ${DHCP_HOSTNAME[$i]} ] && DHCP_OPTIONS="-h ${DHCP_HOSTNAME[$i]}"
         [ "${DHCP_KEEPRESOLV[$i]}" = "yes" ] && DHCP_OPTIONS="$DHCP_OPTIONS -C resolv.conf"
 
  


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
rc.inet1.conf -- wpa_supplicant with a wired network klapaucius Slackware 3 12-15-2008 12:13 PM
rc.wireless.conf and rc.inet1.conf for wireles cards davimint Slackware 1 07-13-2007 05:44 AM
where is rc.inet1.conf in debian? z3d0 Debian 3 09-23-2006 12:34 AM
rc.inet1 and rc.inet1.conf edafe Slackware 0 02-16-2005 09:51 AM
slack 9.1 rc.inet1.conf ? topche Slackware 4 12-28-2003 10:35 AM

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

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