SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I previously have used SuSe and Ubuntu linux and was able to configure multiple IP addresses for my single NIC card. I am now experimenting with slackware to try to get a lightweight OS for basic needs. So far I am running xfce and everything has gone incredibly smooth.
I need to use multiple IP addresses on one NIC because my workplace has special permissions for different IPs. Since I need to support all sorts of users, I need to be able to talk to different IP vlans.
I've searched google and many forums on how to configure my NIC card for more more just one but have come up with nothing related to slackware. I found the file that I think I need to edit which is /etc/rc.d/rc.inet1.conf?
I see my current info in there but I need to add eth0:0, eth0:1 etc.
I need to configure an IP, subnet, and default gateway for each additional IP.
I do not see this section in my file.
This is the closest info to it:
# Config information for eth0:
IPADDR[0]="x.x.0.51"
NETMASK[0]="255.255.0.0"
USE_DHCP[0]=""
DHCP_HOSTNAME[0]=""
Could I just add this below it? (replacing the x's of course)
# Config information for eth0:1
IPADDR[0:1]="x.x.0.52"
NETMASK[0:1]="255.255.0.0"
USE_DHCP[0:1]=""
DHCP_HOSTNAME[0:1]=""
I... think you've got to leave the number inside the [] as 0,1,2,3,4. That's the order of the interfaces to configure. Could someone tell me how many the script supports? Never done more than 5...
IFNAME will tell the script what's the name of the interface to configure, so you'd do:
Code:
# Config information for eth0:
IPADDR[0]="x.x.0.51"
NETMASK[0]="255.255.0.0"
USE_DHCP[0]=""
DHCP_HOSTNAME[0]=""
# Config information for eth0:1
IFNAME[1]="eth0:1"
IPADDR[1]="x.x.x.x"
NETMASK[1]="255.255.0.0"
USE_DHCP[1]=""
DHCP_HOSTNAME[1]=""
I thought the numbers 1,2,3 etc would be other NIC cards in the system and for example 2:2 would be IP address #3 on the 3rd nic card (assuming 0 is the first and in my case the only NIC)
To elaborate on Eric's response (no disrespect intended) you have to leave them as integer values because they're array indices in a script =)
So the maximum limit would be ... uhm ... lots. The theoretical maximum would be INT_MAX, I expect, but I don't know anything about the code behind the shell, and then there's memory limits and all sorts of other things.
For all intents and purposes, more numbers than you should ever need =D
Last edited by piete; 09-20-2007 at 05:31 PM.
Reason: Typos
This is exactly what is in my rc.inet1.conf file right now. I took out the eth0:1 stuff for now because it's not working.
bash-3.1# cat /etc/rc.d/rc.inet1.conf
# /etc/rc.d/rc.inet1.conf
#
# This file contains the configuration settings for network interfaces.
# 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]="x.x.1.51"
NETMASK[0]="255.255.0.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="x.x.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 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)
#IFNAME[4]="wlan0"
#IPADDR[4]=""
#NETMASK[4]=""
#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
#WLAN_MODE[4]=Managed
##WLAN_RATE[4]="54M auto"
##WLAN_CHANNEL[4]="auto"
##WLAN_KEY[4]="D5AD1F04ACF048EC2D0B1C80C7"
##WLAN_IWPRIV[4]="AuthMode=WPAPSK EncrypType=TKIP WPAPSK=7B1ABEEB5D197741923ED26727569C365E31212096A0EAFAD563B268BAD01CAF TxRate=0"
#WLAN_WPA[4]="wpa_supplicant"
#WLAN_WPADRIVER[4]="ndiswrapper"
## Some examples of additional network parameters that you can use.
## Config information for wlan0:
#IFNAME[4]="wlan0" # Use a different interface name nstead of
# the default 'eth4'
#HWADDR[4]="00:01:23:45:67:89" # Overrule the card's hardware MAC address
#MTU[4]="" # The default MTU is 1500, but you might need
# 1360 when you use NAT'ed IPSec traffic.
#DHCP_KEEPRESOLV[4]="yes" # If you dont want /etc/resolv.conf overwritten
#DHCP_KEEPNTP[4]="yes" # If you don't want ntp.conf overwritten
#DHCP_KEEPGW[4]="yes" # If you don't want the DHCP server to change
# your default gateway
#DHCP_IPADDR[4]="" # Request a specific IP address from the DHCP
# server
#WLAN_ESSID[4]=DARKSTAR # Here, you can override _any_ parameter
# defined in rc.wireless.conf, by prepending
# 'WLAN_' to the parameter's name. Useful for
# those with multiple wireless interfaces.
#WLAN_IWPRIV[4]="AuthMode=WPAPSK EncrypType=TKIP WPAPSK=thekey TxRate=0"
# Some drivers require a private ioctl to be
# set through the iwpriv command. If more than
# one is required, you can place them in the
# IWPRIV parameter (space-separated, see the
# example).
Your rc.inet1.conf file shows signs (in the commented part) of an older Slackware version.
Can you check if the version of /etc/rc.d/rc.inet1 is the one that ships with Slackware 12.0? Possibly you might not have updated to the newer version of the script in the case where you have been upgrading Slackware to the version 12.0.
Your rc.inet1.conf file shows signs (in the commented part) of an older Slackware version.
Can you check if the version of /etc/rc.d/rc.inet1 is the one that ships with Slackware 12.0? Possibly you might not have updated to the newer version of the script in the case where you have been upgrading Slackware to the version 12.0.
That's very interesting because this is the first and only time I've downloaded or installed slackware before. I downloaded the version 12 DVD.
Well that rc.inet1.conf file contains stuff that is not in Slackware 12.0 version of the file.
Quote:
The date "Sun Jul 24 12:45:56 PDT 2005" of my rc.inet1 file matches the link you showed me.
Don't look at that RCS stamp - it does not tell anything... the file was not checked in for a long time. Do a 'diff' between your file and the file in the URL instead.
Where did you download that Slackware 12.0 DVD by the way? Does the md5sum you can calculate for your ISO match the published one? I don't believe for a second that you did a fresh install off an official Slackware 12.0 DVD.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.