LinuxQuestions.org
Visit the LQ Articles and Editorials section
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-28-2013, 12:34 PM   #1
marijan
LQ Newbie
 
Registered: Aug 2013
Posts: 4

Rep: Reputation: Disabled
Setting IFNAME


Hi,

It is my first post to LQ. I recently installed Slackware 14.0 and I like it. It runs on old Thinkpad R51.
TP has fxp and ipw network interface, automatically configured as eth0 and eth1. According to man, interface name can be changed by setiing IFNAME variable in rc.inet1.conf. I tried to add:

IFNAME[1]="wlan0".

But it doesn't work. I don't see eth1 nor wlan0 anymore. It is not an issue at all, but I am just curious did I miss something else.

Marijan
 
Old 08-28-2013, 02:29 PM   #2
ml4711
Member
 
Registered: Aug 2012
Location: Ryomgård, Danmark
Distribution: Slackware64
Posts: 94

Rep: Reputation: 58
from /etc/rc.d/rc.inet1
# If a value for IFNAME[n] is not set, we assume it is an eth'n' interface.

i.e. you do not need to set IFNAME, if your interfaces are eth0, eth1, etc

It is only possible to use real interface names in IFNAME[],
you can not change an interface name by putting a name in an IFNAME[] variable.

If you only had one interface named wlan0, you had to put that name into IFNAME[0].

Welcome to a new slacker :-)
 
Old 08-28-2013, 02:31 PM   #3
onebuck
Moderator
 
Registered: Jan 2005
Location: Midwest USA, Central Illinois
Distribution: Slackware®
Posts: 11,451
Blog Entries: 4

Rep: Reputation: 1505Reputation: 1505Reputation: 1505Reputation: 1505Reputation: 1505Reputation: 1505Reputation: 1505Reputation: 1505Reputation: 1505Reputation: 1505Reputation: 1505
Member Response

Hi,

Welcome to LQ & Slackware!
EDIT:I just noticed that the file shown was modified by me. You can still use it as an example by setting your local information.

Look at the original '/etc/rc.d/rc.inet1.conf' comment information at the top. Plus notice how each section provides configurable arguments for suggested interfaces;
Quote:
If USE_DHCP[interface] is set to "yes", this overrides any other settings.
# If you don't have an interface, leave the settings null ("").

# You can configure network interfaces other than eth0,eth1... by setting
# IFNAME[interface] to the interface's name. If IFNAME[interface] is unset
# or empty, it is assumed you're configuring eth<interface>.

# Several other parameters are available, the end of this file contains a
# comprehensive set of examples.

# =============================================================================

# Config information for eth0:
#IPADDR[0]="192.168.1.14"
#IPADDR[0]="192.168.1.114"
#NETMASK[0]="255.255.255.0"
#USE_DHCP[0]=""
#DHCP_HOSTNAME[0]=""

# Config information for eth1:
IPADDR[1]=""
NETMASK[1]=""
USE_DHCP[1]=""
DHCP_HOSTNAME[1]=""

# Config information for eth2:
IPADDR[2]=""
NETMASK[2]=""
USE_DHCP[2]=""
DHCP_HOSTNAME[2]=""

# Config information for eth3:
IPADDR[3]=""
NETMASK[3]=""
USE_DHCP[3]=""
DHCP_HOSTNAME[3]=""

# Default gateway IP address:
GATEWAY="192.168.1.1"

# Change this to "yes" for debugging output to stdout. Unfortunately,
# /sbin/hotplug seems to disable stdout so you'll only see debugging output
# when rc.inet1 is called directly.
DEBUG_ETH_UP="no"

# Example of how to configure a bridge:
# Note the added "BRNICS" variable which contains a space-separated list
# of the physical network interfaces you want to add to the bridge.
#IFNAME[0]="br0"
#BRNICS[0]="eth0"
#IPADDR[0]="192.168.0.1"
#NETMASK[0]="255.255.255.0"
#USE_DHCP[0]=""
#DHCP_HOSTNAME[0]=""

## Example config information for wlan0. Uncomment the lines you need and fill
## in your info. (You may not need all of these for your wireless network)
#09-18-12:16:00 gws

IFNAME[4]="wlan0"
IPADDR[4]="192.168.1.14"
NETMASK[4]="255.255.255.0"
#USE_DHCP[4]="yes"
#DHCP_HOSTNAME[4]="icculus-wireless"
#DHCP_KEEPRESOLV[4]="yes"
#DHCP_KEEPNTP[4]="yes"
#DHCP_KEEPGW[4]="yes"
#DHCP_IPADDR[4]=""
#WLAN_ESSID[4]=BARRIER05
If you did not comment out 'IFNAME[4]="wlan0"' you would be attempting to assign the same name & interface. I would use the original configuration. If you want both eth0 & wlan0 then use 'ifplugd' to control the wired interface when connected or not;
Quote:
ifplugd <- 'ifplugd is a Linux daemon which will automatically configure your ethernet device when a cable is plugged in and automatically unconfigure it if the cable is pulled. This is useful on laptops with onboard network adapters, since it will only configure the interface when a cable is really connected. ifplugd interfaces with your distribution's native network configuration utilities.'
You can look at Slackware Doc Project section for Configure your new Slackware System to aid you in configuring the system.

Hope this helps.

Last edited by onebuck; 08-28-2013 at 03:03 PM. Reason: note file changes
 
Old 08-28-2013, 03:12 PM   #4
Paulo2
Member
 
Registered: Aug 2012
Distribution: Slackware current(32) (started with 13.37(32))
Posts: 151

Rep: Reputation: 30
I think the order that modules are loaded determines which one is eth0 or eth1.

You can change this editing "/etc/udev/rules.d/70-persistent-net.rules" (or similar)

Be sure that in "/etc/rc.d/rc.inet1.conf" the var "USE_DHCP[x]" is set to yes in each ethx section.

Maybe this has practical use in some case


Welcome to a new slacker
 
Old 08-29-2013, 10:11 AM   #5
marijan
LQ Newbie
 
Registered: Aug 2013
Posts: 4

Original Poster
Rep: Reputation: Disabled
My interfaces are working. I just tried to change interface name.
I understood it should be possible. Here is part of rc.inet1.conf.
It will create eth0 and eth1. But if I uncomment line 22,
I loose eth1. And wlan0 didn't pop up, as expected.
What is the purpose of IFNAME variable?
Quote:
1 # /etc/rc.d/rc.inet1.conf
2 #
3 # This file contains the configuration settings for network interfaces.
4 # If USE_DHCP[interface] is set to "yes", this overrides any other settings.
5 # If you don't have an interface, leave the settings null ("").
6
7 # You can configure network interfaces other than eth0,eth1... by setting
8 # IFNAME[interface] to the interface's name. If IFNAME[interface] is unset
9 # or empty, it is assumed you're configuring eth<interface>.
10
11 # Several other parameters are available, the end of this file contains a
12 # comprehensive set of examples.
13 # =============================================================================
14
15 # Config information for eth0:
16 IPADDR[0]=""
17 NETMASK[0]=""
18 USE_DHCP[0]=""
19 DHCP_HOSTNAME[0]=""
20
21 # Config information for eth1:
22 #IFNAME[1]="wlan0"
23 IPADDR[1]=""
24 NETMASK[1]=""
25 USE_DHCP[1]="yes"
26 DHCP_TIMEOUT[1]=15 # The default timeout for the DHCP client is 10s
27 WLAN_ESSID[1]="WPARaleigh"
28 WLAN_WPA[1]="wpa_supplicant"
29 WLAN_WPAWAIT[1]=10 # In case it takes long for the WPA association
30
31 # Config information for eth2:
32 IPADDR[2]=""
33 NETMASK[2]=""
34 USE_DHCP[2]=""
35 DHCP_HOSTNAME[2]=""

Last edited by marijan; 08-29-2013 at 10:22 AM.
 
Old 08-29-2013, 10:30 AM   #6
marijan
LQ Newbie
 
Registered: Aug 2013
Posts: 4

Original Poster
Rep: Reputation: Disabled
Oh, I read again onebuck answer.
So, IFNAME is used to configure interfaces which are automatically assigned name
other than ethX?
 
Old 08-29-2013, 10:34 AM   #7
Richard Cranium
Senior Member
 
Registered: Apr 2009
Location: Carrollton, Texas
Distribution: Slackware64 14.1
Posts: 1,577

Rep: Reputation: 468Reputation: 468Reputation: 468Reputation: 468Reputation: 468
Quote:
Originally Posted by marijan View Post
What is the purpose of IFNAME variable?
If you looked at the contents of /etc/rc.d/rc.inet1, you could probably figure that out.
 
Old 08-29-2013, 10:54 AM   #8
marijan
LQ Newbie
 
Registered: Aug 2013
Posts: 4

Original Poster
Rep: Reputation: Disabled
You are right.
 
  


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
Setting 'Password Inactive' field to 1 after setting maximum passwd age ? Grtyop Linux - Newbie 1 05-30-2013 08:49 PM
ppp-ifname patch ciorny Slackware 2 01-25-2011 03:53 AM
General X setting (NOT WM-specific setting) to map keys/mouse buttons? Wombat Pete Linux - Software 1 04-24-2010 02:45 PM
Slackware 13 (64 bit) IFNAME[4]="wlan0:1" KrazyKanuk Slackware 3 02-02-2010 07:34 AM
Setting font in one console doesnt override the default setting Lakki Linux - Enterprise 0 09-01-2008 09:19 AM


All times are GMT -5. The time now is 12:40 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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration