Beginner Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsOtherBeginner Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Application developers can seamlessly integrate the Advantage Database install with their application install. Learn the best practices used when setting up silent installs with this seminar.
  #1  
Old April 24th, 2000, 09:09 AM
rtna rtna is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2000
Posts: 79 rtna User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 9
Hello,
I need to run ifconfig eth0:ip.ip.ip.ip
when Linux server reboot.
But How can I do this ?

Thanks

Reply With Quote
  #2  
Old April 24th, 2000, 09:47 PM
freebsd
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
'ifconfig' command not found or something? Can you be more specific?

Reply With Quote
  #3  
Old April 25th, 2000, 08:24 AM
rtna rtna is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2000
Posts: 79 rtna User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 9
Hello,
No, I can found ifconfig,
But it need to run automatically.
(when linux reboot)

Thanks

Reply With Quote
  #4  
Old April 25th, 2000, 10:45 AM
freebsd
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
Which linux distribution, Redhat?
Have you configured your network interface thru Control Panel/Network Configurator?
What NIC? Is it ISA or PCI? which module?
Static IP or DHCP?

Reply With Quote
  #5  
Old April 25th, 2000, 03:20 PM
rtna rtna is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2000
Posts: 79 rtna User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 9
Ya,
I use RedHat Linux 6.0,
and it can run ifconfig eth0:0 xx.xx.xx.xx under [@linux]#.
But, each time when linux reboot,
I must run ifconfig again.
Therefore, I hope linux can run this command aotumatically.

Thanks

Reply With Quote
  #6  
Old April 25th, 2000, 04:46 PM
freebsd
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
Since you haven't provided me other info, I will use Dlink DFE530TX NIC as an example with Redhat 6.0:
1) create rc.modules file with the following 2 lines in it..
#!/bin/sh
insmod /lib/modules/2.2.5-15/net/via-rhine.o
(2) Place this rc.modules to /etc/rc.d/ (as /etc/rc.d/rc.modules) and chmod
it to 755.
3) /etc/conf.modules:
alias eth0 via-rhine
#############################
note: dlink 530tx uses via-rhine.o. Check your /etc/conf.modules to find out which module your nic uses.
Verify if it's found in /lib/modules/2.2.5-15/net, I don't remember the exact dir path for redhat 6.0 since I no longer run any linux for quite a while (been running freebsd since then), you need to find out if it's the correct path to your nic's driver.
If your nic is ISA, not PCI, you should specify some opton in your /etc/conf.modules like..
options eth0 io=0xf880 irq=10
alias eth0 via-rhine

Reply With Quote
  #7  
Old May 2nd, 2000, 03:07 PM
rtna rtna is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2000
Posts: 79 rtna User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 9
Does linux has batch file like autoexec.bat of DOS ?
for example,
I need to run "ls" command on the text mode when linux reboot.

Thanks

Reply With Quote
  #8  
Old May 2nd, 2000, 03:29 PM
freebsd
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
Yes. Like those rc* in your /etc directory.
As for the ls thing, do not run the ls itself. Write a script and put what you want there, then put the line to execute the script to /etc/rc.d/rc.local

Reply With Quote
  #9  
Old May 2nd, 2000, 03:39 PM
rtna rtna is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2000
Posts: 79 rtna User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 9
Oh,
Would u please tell me a example for How to write a script?

Reply With Quote
  #10  
Old May 2nd, 2000, 04:48 PM
freebsd
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
## /etc/rc.d/rc.local file:
#!/bin/sh
/usr/local/apache/bin/apachectl graceful

## /usr/local/apache/bin/apachectl is a script (written by my former co-worker URL)

## another script sample:
#!/bin/sh
ls -Al

You can even write a perl script and place it in rc.local.
## /tmp/script:
#!/usr/bin/perl
open(NEWFILE,">>/tmp/newfile");
print NEWFILE "hello world";
close(NEWFILE);

## /etc/rc.d/rc.local file:
#!/bin/sh
perl /tmp/script

Doing so will create a new file called "newfile" in /tmp directory with one line "hello world" in it after reboot.

Reply With Quote
  #11  
Old May 19th, 2000, 06:19 PM
jlazzaro jlazzaro is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2000
Posts: 11 jlazzaro User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Why would you need to do this in the first place? Are you changing the IP address on each reboot?

For a static IP you should be able to just create the file in /etc/sysconfig/network-scripts/ifcfg-ethX (where X is the card you're setting, 0 for the first one). If you set an address during installation or with linuxconf, the file should already be there and you can just edit it.

Sorry if I misunderstood the issue.

-Joe

Reply With Quote
Reply

Viewing: Dev Shed ForumsOtherBeginner Programming > Run ifconfig command when reboot


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

 Free IT White Papers!
 
Accelerating Trading Partner Performance
One in five. That's how many partner transactions have at least one error. That is an amazing statistic, particularly given the extraordinary leaps in innovation across the global supply chain during the past two decades. Download this white paper to learn more.

 
Competing on Analytics
This Tech Analysis is designed to help identify characteristics shared by analytics competitors, and includes information about 32 organizations that have made a commitment to quantitative, fact-based analysis.

 
Cost Effective Scaling with Virtualization and Coyote Point Systems
An overview of the industry trend toward virtualization, how server consolidation has increased the importance of application uptime and the steps being taken to integrate load balancing technology with virtualized servers.

 
Five Checkpoints to Implementing IP Telephony
Implementation planning for IP PBX software and IP telephony has become vital as businesses replace discontinued legacy PBX phone systems. This informative whitepaper outlines five "checkpoints" for any implementation plan that will help make IP communications a successful proposition.

 
Hosted Email Security: Staying Ahead of New Threats
In the last two years, email has become a fierce battleground between the nefarious forces of spam and malware, and the heroes of messaging protection. The spam volumes increased alarmingly every month, bringing clever new forms of phishing and virus propagation attacks.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway