LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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-23-2004, 10:18 AM   #1
designguy79
LQ Newbie
 
Registered: Nov 2003
Distribution: Slack
Posts: 7

Rep: Reputation: 0
problems with /etc/rc.d/rc.local and ifconfig


Hi,

I am trying to add a second IP address "alias" to my NIC. Running this as root works fine every time:

/sbin/ifconfig eth0:1 inet 69.41.0.59 broadcast 69.41.0.63 netmask 255.255.255.192 up

However, when I reboot it, the setting gets lost. So, I did some searching around, and thought I could add that line to the bottom of /etc/rc.d/rc.local

No dice.

However, if I call that script manually after I SSH in, it does run that line.

Thanks in advance!
 
Old 10-23-2004, 10:33 AM   #2
gsgleason
Member
 
Registered: Oct 2004
Posts: 69

Rep: Reputation: 15
try adding stuff to /etc/rc.d/rc.inet1.conf
 
Old 10-23-2004, 11:06 AM   #3
TKS
Member
 
Registered: Dec 2003
Location: NC, USA
Distribution: Slackware, VectorLinux, Smoothwall, and PCLinuxOS
Posts: 40

Rep: Reputation: 15
or you could just use the 'netconfig' command which will edit your rc.inet1.conf file for you.

Don't forget that you'll need to make sure that you have your modules set up in /etc/rc.modules for each of your NICs.

TKS
 
Old 10-23-2004, 11:24 AM   #4
designguy79
LQ Newbie
 
Registered: Nov 2003
Distribution: Slack
Posts: 7

Original Poster
Rep: Reputation: 0
I only have 1 NIC, so I cannot do anything in the 'modules' file.

I tried adding the following line to /etc/rc.d/rc.inet1.conf

ETH0_ALIAS[0]="69.41.0.59"

and rebooted, and it didn't add it.

Then I tried

ETH0_ALIAS[0]="69.41.0.59/24"

and nothing.

Thanks again...
 
Old 10-23-2004, 11:19 PM   #5
Ghost_runner
Member
 
Registered: Jun 2004
Location: Kansas City, MO
Distribution: Fedora (LXQT)
Posts: 276

Rep: Reputation: 30
try this: use vi to make a file named netstart or something similar, in your /etc

#!/bin/bash
#start designguy79's network
/sbin/ifconfig eth0:1 inet 69.41.0.59 broadcast 69.41.0.63 netmask 255.255.255.192 up

then make sure the program is owned by root
sudo chown root.root netstart

and make it executable
chmod 700 netstart

then add this to the end of rc.local, or the end of /etc/pcmcia/network
source /etc/netstart

see if that works
 
Old 10-23-2004, 11:26 PM   #6
Shade
Senior Member
 
Registered: Mar 2003
Location: Burke, VA
Distribution: RHEL, Slackware, Ubuntu, Fedora
Posts: 1,418
Blog Entries: 1

Rep: Reputation: 46
Instead of using the Eth0[alias] function in /etc/rc.d/rc.inet1.conf, just add your command verbatim to /etc/rc.d/rc.inet1

I think what's happening is that rc.local is being called before your interface is initialized to begin with -- can't assign an alias if the interface isn't up.

Plus, it makes for a cleaner system if you have all your network related configurations within one script. You can add your command to the end of rc.inet1 below a comment, such as "#eth0 alias"

--Shade
 
Old 10-24-2004, 01:37 PM   #7
designguy79
LQ Newbie
 
Registered: Nov 2003
Distribution: Slack
Posts: 7

Original Poster
Rep: Reputation: 0
Shade,

Thanks for the suggestion -- that is actually what I tried recently, and it works great now. Thanks again, everyone!
 
  


Reply



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
connecting /sbin/ifconfig to bash command ifconfig flammable2 Fedora 4 11-12-2005 07:58 AM
ifconfig problems harlemno1 Linux - Software 1 11-04-2004 09:20 AM
rc.local problems WORST Fedora 3 05-14-2004 12:09 PM
Empy ifconfig and other problems (newbie) mark_2811 Debian 7 12-11-2003 11:27 PM
ifconfig problems stroh78 Linux - Networking 2 03-05-2001 09:59 AM

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

All times are GMT -5. The time now is 11:30 AM.

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