LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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
 
LinkBack Search this Thread
Old 11-25-2013, 07:57 AM   #1
slackcode
LQ Newbie
 
Registered: Sep 2007
Location: China
Distribution: slackware
Posts: 25

Rep: Reputation: 0
Why MAXNICS=${MAXNICS:-6} in rc.inet1.conf?


Code:
############################
# DETERMINE INTERFACE LIST #
############################

# Compose a list of interfaces from /etc/rc.d/rc.inet1.conf (with a maximum
# of 6 interfaces, but you can easily enlarge the interface limit
# - send me a picture of such a box :-).
# If a value for IFNAME[n] is not set, we assume it is an eth'n' interface.
# This way, the new script is compatible with older rc.inet1.conf files.
# The IFNAME array will be used to determine which interfaces to bring up/down.
MAXNICS=${MAXNICS:-6}
i=0
while [ $i -lt $MAXNICS ];
do
  IFNAME[$i]=${IFNAME[$i]:=eth${i}}
  i=$(($i+1))
done
if [ "$DEBUG_ETH_UP" = "yes" ]; then
  echo "/etc/rc.d/rc.inet1:  List of interfaces: '${IFNAME[@]}'" | $LOGGER
fi
I have a situation that need more than 6 (Maybe 7).
I set an ip address and it can't be valid until I ifconfig that.

Finally, I found this code in rc.inet1.
I want to know why the number is 6? Is it about the performance or any other reason?
Thx.
 
Old 11-25-2013, 08:14 AM   #2
guanx
Senior Member
 
Registered: Dec 2008
Posts: 1,014

Rep: Reputation: 145Reputation: 145
Pre-vacuum-tube computers take a lot of time to loop through large number of empty setups. This is the evidence of slackware being the oldest surviving Linux distribution.
 
Old 11-25-2013, 08:22 AM   #3
slackcode
LQ Newbie
 
Registered: Sep 2007
Location: China
Distribution: slackware
Posts: 25

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by guanx View Post
Pre-vacuum-tube computers take a lot of time to loop through large number of empty setups. This is the evidence of slackware being the oldest surviving Linux distribution.
Yes, I agree. Maybe I can cut some IPs : )
 
Old 11-25-2013, 08:29 AM   #4
Didier Spaier
Senior Member
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slackware-14.0 on a Lenovo T61 6457-4XG
Posts: 3,638

Rep: Reputation: 827Reputation: 827Reputation: 827Reputation: 827Reputation: 827Reputation: 827Reputation: 827
However high the limit, someone will find it too low.

Last edited by Didier Spaier; 11-25-2013 at 08:39 AM. Reason: Nota accurate sentence removed
 
Old 11-25-2013, 09:17 AM   #5
GazL
Senior Member
 
Registered: May 2008
Posts: 3,231

Rep: Reputation: 828Reputation: 828Reputation: 828Reputation: 828Reputation: 828Reputation: 828Reputation: 828
... which is reason to avoid having a arbitrary limit.

A long while ago I wrote myself an rc.inet1 replacement modeled on the OpenBSD approach.

It cycles through the interfaces listed on it's args, or if none, the interfaces it finds in /proc/net/dev and if it finds a corresponding /etc/hostname.<interface> file uses that to configure the interface. I find this much easier to work with than the stock rc.inet1 + rc.inet1.conf approach, which has always seemed a little unwieldy to me.

The config files looks like this:
Code:
root@ws1:~# cat /etc/hostname.eth0 
inet 192.168.0.2
!route add default gw 192.168.0.1
root@ws1:~#
As you can see, it also allows static routes to be kept with the associated interface config, which keeps things nice and tidy. To use dhclient, the file simply needs contain the word 'dhcp'. I've not fleshed it out to support wifi yet, but a "!wpa_supplicant blah blah...." line before a "dhcp" line ought to do the job.
 
Old 11-25-2013, 09:46 AM   #6
slackcode
LQ Newbie
 
Registered: Sep 2007
Location: China
Distribution: slackware
Posts: 25

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by GazL View Post
... which is reason to avoid having a arbitrary limit.

It cycles through the interfaces listed on it's args, or if none, the interfaces it finds in /proc/net/dev and if it finds a corresponding /etc/hostname.<interface> file uses that to configure the interface. I find this much easier to work with than the stock rc.inet1 + rc.inet1.conf approach, which has always seemed a little unwieldy to me.

As you can see, it also allows static routes to be kept with the associated interface config, which keeps things nice and tidy. To use dhclient, the file simply needs contain the word 'dhcp'. I've not fleshed it out to support wifi yet, but a "!wpa_supplicant blah blah...." line before a "dhcp" line ought to do the job.
Normally, I think it is simple if I configure all interfaces in one file. If move the interfaces to multiple files, I need to configure them in multiple place.
I think rc.inet1.conf can be scanned to summate amout of the interfaces, but it seems ugly and not KISS.
 
Old 11-25-2013, 11:33 AM   #7
gnashley
Amigo developer
 
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,724

Rep: Reputation: 449Reputation: 449Reputation: 449Reputation: 449Reputation: 449
GazL, can you post your replacement for rc.inet1?
 
Old 11-25-2013, 12:34 PM   #8
GazL
Senior Member
 
Registered: May 2008
Posts: 3,231

Rep: Reputation: 828Reputation: 828Reputation: 828Reputation: 828Reputation: 828Reputation: 828Reputation: 828
I can remember we've talked about this sort of thing in the past, so I suspect you may have already seen it, but I'll attach it here anyway. It's not particularly sophisticated, but that's why I like it


BTW, if anyone tries it out, don't forget to create a /etc/hostname.lo containing "inet 127.0.0.1"
Attached Files
File Type: txt rc.inet1.txt (2.3 KB, 32 views)

Last edited by GazL; 11-25-2013 at 12:36 PM.
 
Old 11-26-2013, 03:10 PM   #9
wildwizard
Member
 
Registered: Apr 2009
Location: Oz
Distribution: slackware64-14.0
Posts: 749

Rep: Reputation: 225Reputation: 225Reputation: 225
Quote:
Originally Posted by slackcode View Post
Yes, I agree. Maybe I can cut some IPs : )
If the problem originates from having extra IP's and not actual interfaces then I think I can help.

I have below rc.inet1 and rc.inet1.conf that I use, the IP addresses used are in CIDR notation and the setup no longer uses net masks (ignore the ones in the conf they are not used.)

To add extra IP's on an interface you simply separate them with spaces so you could have the following :-

Code:
IPADDR[0]="192.168.10.10/24 192.168.10.11/24 192.168.10.12/24 192.168.10.13/24 10.0.0.1/24"
and the first interface would have 5 IP's.

http://wildwizard.abnormalpenguin.co...lackware/rc.d/
 
Old 11-29-2013, 07:52 AM   #10
WiseDraco
Member
 
Registered: Nov 2006
Location: Europe,Latvia,Riga
Distribution: slackware,slax, exMandriva
Posts: 358

Rep: Reputation: 28
Quote:
Originally Posted by guanx View Post
Pre-vacuum-tube computers take a lot of time to loop through large number of empty setups. This is the evidence of slackware being the oldest surviving Linux distribution.
if i remember correctly, about a years 2003 - 2005 i have linux slackware ( 10.0 or so on version) based firewall \ router with 7 NIC. i do not change anything in rc.inetd1 - maybe then there are not that string?
 
  


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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Funky NIC configurations - MAXNICS setting in /etc/rc.d/rc.inet1too low. kfanyo Slackware 10 09-27-2008 10:51 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


All times are GMT -5. The time now is 12:04 AM.

Main Menu
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