Welcome to the { mindfrost82.com } forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact us.

Go Back   { mindfrost82.com } > Gadget Corner > Tech Newsgroups > Linux > Linux Networking

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 03-09-2008, 04:22 PM
Joseph Hesse
 
Posts: n/a
permanent ifconfig settings for Fedora 8

Hi,

This is a Fedora 8 question.

I know ifconfig will set the network interfaces but it is not permanent.
As far as I know I could:

1. Put the ifconfig command in /etc/rc.d/rc.local to make it permanent.
or
2. I could hand edit the file /etc/sysconfig/network-scripts/ifcfg-eth0.

Are there other ways or is the above the best?

Thank you,
Joe Hesse
Reply With Quote
  #2 (permalink)  
Old 03-09-2008, 05:09 PM
Paul Black
 
Posts: n/a
Re: permanent ifconfig settings for Fedora 8

On Mar 9, 3:22 pm, Joseph Hesse wrote:
> 2. I could hand edit the file /etc/sysconfig/network-scripts/ifcfg-eth0.


system-config-network may be an easier way to do the above.

Paul
Reply With Quote
  #3 (permalink)  
Old 03-09-2008, 05:47 PM
Joseph Hesse
 
Posts: n/a
Re: permanent ifconfig settings for Fedora 8

On Sun, 09 Mar 2008 09:09:42 -0700, Paul Black wrote:

> On Mar 9, 3:22 pm, Joseph Hesse wrote:
>> 2. I could hand edit the file
>> /etc/sysconfig/network-scripts/ifcfg-eth0.

>
> system-config-network may be an easier way to do the above.
>
> Paul


Paul,
Thank you, that works but it is interactive and can't be put in a
script. At this point, the only thing I can think of is hand editing the
configuration files.
Joe
Reply With Quote
  #4 (permalink)  
Old 03-09-2008, 09:27 PM
Moe Trin
 
Posts: n/a
Re: permanent ifconfig settings for Fedora 8

On Sun, 09 Mar 2008, in the Usenet newsgroup comp.os.linux.networking, in
article <13t805652g0juc4@corp.supernews.com>, Joseph Hesse wrote:

>I know ifconfig will set the network interfaces but it is not permanent.
>As far as I know I could:
>
>1. Put the ifconfig command in /etc/rc.d/rc.local to make it permanent.
>or
>2. I could hand edit the file /etc/sysconfig/network-scripts/ifcfg-eth0.
>
>Are there other ways or is the above the best?


http://www.pathname.com/fhs/

/etc/sysconfig/network and /etc/sysconfig/network-scripts/ has been a
Red Hat "standard" that has been adopted by a number of distributions
that are based on (or were influenced by) Red Hat. It's not the only way
to do things. Certainly, other distributions may do things quite
differently. rc.local is a locally administered "catch-all" boot
script, normally used for "local" tweaks to the system, or tasks
not covered by other boot scripts.

As a _general_ statement, it's _USUALLY_ a good idea to stick with the
ideas that the distribution uses. In that way, you won't be surprised
when encountering another system that uses these configurations by
default. However, nothing prevents you from doing as you wish.

While you could put the ifconfig command in /etc/rc.d/rc.local, that
file is the last of the boot scripts to run (probably called as
/etc/rc.d/rc3.d/S99local), compared to the "normal" network
configuration file (perhaps /etc/rc.d/rc3.d/S10network), and there may
well be other boot scripts (such as S11firewall, S11portmap, S50inet,
S60nfs, S80sendmail and similar) that depend on the network being up,
but are called before the rc.local is run. (Init scripts in the run-level
directories are run in the order the links are shown by the 'ls' command.)
Use the command 'rpm -qd sysvinit' to find the documentation that comes
with the sysvinit (System V Init) package. While somewhat old, you
should also have a look through the From-PowerUp-To-Bash-Prompt-HOWTO
which may be hidden in /usr/share/HOWTO on your system (or use your
favorite search engine to find it):

-rw-rw-r-- 1 gferg ldp 43309 Nov 5 2000 From-PowerUp-To-Bash-Prompt-HOWTO

Section 6 of the HOWTO discusses the System V Init process, though it
doesn't get into the network configuration files.

Another document to look at is "Introduction to Linux - A Hands on Guide"
from the Linux Documentation Project (http://tldp.org/guides.html).
Section 10 discusses network configuration. That site also has a
"Linux Filesystem Hierarchy" guide that provides additional help with
the 'fhs' referred to above.

Old guy
Reply With Quote
  #5 (permalink)  
Old 03-09-2008, 10:21 PM
Allen McIntosh
 
Posts: n/a
Re: permanent ifconfig settings for Fedora 8

Joseph Hesse wrote:
> Thank you, that works but it is interactive and can't be put in a
> script. At this point, the only thing I can think of is hand editing the
> configuration files.


You need to tell us what you are trying to do. Are you trying to make
permanent changes, or just do something temporary? If you are trying to
make permanent changes, that's exactly what system-config-network does.
The changes you make find their way into the /etc/sysconfig hierarchy,
and persist over a reboot.

If you want something a little less permanent, it looks to me like
system-config-network supports some kind of hardware profile mechanism,
but I haven't used it myself. Moe's list of might help you here.
Reply With Quote
  #6 (permalink)  
Old 03-09-2008, 10:49 PM
Timothy Murphy
 
Posts: n/a
Re: permanent ifconfig settings for Fedora 8

Moe Trin wrote:

>>I know ifconfig will set the network interfaces but it is not permanent.
>>As far as I know I could:
>>
>>1. Put the ifconfig command in /etc/rc.d/rc.local to make it permanent.
>>or
>>2. I could hand edit the file /etc/sysconfig/network-scripts/ifcfg-eth0.
>>
>>Are there other ways or is the above the best?


> /etc/sysconfig/network and /etc/sysconfig/network-scripts/ has been a
> Red Hat "standard" that has been adopted by a number of distributions
> that are based on (or were influenced by) Red Hat. It's not the only way
> to do things. Certainly, other distributions may do things quite
> differently. rc.local is a locally administered "catch-all" boot
> script, normally used for "local" tweaks to the system, or tasks
> not covered by other boot scripts.
>
> As a _general_ statement, it's _USUALLY_ a good idea to stick with the
> ideas that the distribution uses. In that way, you won't be surprised
> when encountering another system that uses these configurations by
> default. However, nothing prevents you from doing as you wish.


Sadly, I don't agree.
If the OP knows what ifconfig command he wants to give,
he is almost certainly better off putting it in rc.local , as he suggested.
Then he will know exactly what is happening.

In my experience, system-config-network leads one
into an incomprehensible morass.
It changes random files all over the system,
and rarely if ever does any good.


--
Timothy Murphy
e-mail (<80k only): tim /at/ birdsnest.maths.tcd.ie
tel: +353-86-2336090, +353-1-2842366
s-mail: School of Mathematics, Trinity College, Dublin 2, Ireland
Reply With Quote
  #7 (permalink)  
Old 03-09-2008, 11:16 PM
Bit Twister
 
Posts: n/a
Re: permanent ifconfig settings for Fedora 8

On Sun, 09 Mar 2008 15:22:14 -0000, Joseph Hesse wrote:
> Hi,
>
> This is a Fedora 8 question.
>
> I know ifconfig will set the network interfaces but it is not permanent.
> As far as I know I could:
>
> 1. Put the ifconfig command in /etc/rc.d/rc.local to make it permanent.
> or


No permanent if you do something like service network restart

> 2. I could hand edit the file /etc/sysconfig/network-scripts/ifcfg-eth0.


True, but only if variables are supported by the gui interface.

> Are there other ways or is the above the best?


Depends on what you want set when (pre-up, post-up...).

Just some examples:
o create /sbin/ifup-pre-local,
chmod +x /sbin/ifup-pre-local
and put your commands there.

o create /etc/sysconfig/network-scripts/ifup-eth
chmod +x /etc/sysconfig/network-scripts/ifup-eth
and put your commands there.

o create /sbin/ifdown-pre-local,
chmod +x /sbin/ifdown-pre-local
and put your commands there.

o create /etc/sysconfig/network-scripts/ifdown-eth
chmod +x /etc/sysconfig/network-scripts/ifdown-eth
and put your commands there.

o create /sbin/ifdown-local
chmod +x /sbin/ifdown-local
and put your commands there.

o for route changes/rules you would put those in
/etc/sysconfig/network-scripts/rule-ethX You solve for X


You might want to hunt around and read sysconfig.txt just to get an
ideal of the controls you have.

If you need deeper knowledge I suggest reading the scripts to see what
script call what with which arguments.

If a little weak on bash scripting, I suggest
man test
http://tldp.org/LDP/abs/html/index.html
Reply With Quote
  #8 (permalink)  
Old 03-09-2008, 11:53 PM
Joseph Hesse
 
Posts: n/a
Re: permanent ifconfig settings for Fedora 8

On Sun, 09 Mar 2008 21:49:42 +0000, Timothy Murphy wrote:


> Sadly, I don't agree.
> If the OP knows what ifconfig command he wants to give, he is almost
> certainly better off putting it in rc.local , as he suggested. Then he
> will know exactly what is happening.
>
> In my experience, system-config-network leads one into an
> incomprehensible morass.
> It changes random files all over the system, and rarely if ever does any
> good.


Here is a more definite question.

I want to permanently change my IP, mask, gateway. Which is better.

1. An ifconfig command in rc.local. Also add a route command to
rc.local to specify the gateway.

2. Hand edit ifcfg-eth0.

Thank you,
Joe Hesse



Reply With Quote
  #9 (permalink)  
Old 03-10-2008, 12:02 AM
Bit Twister
 
Posts: n/a
Re: permanent ifconfig settings for Fedora 8

On Sun, 09 Mar 2008 22:53:28 -0000, Joseph Hesse wrote:
>
> Here is a more definite question.
>
> I want to permanently change my IP, mask, gateway. Which is better.
>
> 1. An ifconfig command in rc.local. Also add a route command to
> rc.local to specify the gateway.


rc.local is not permanent. If you restart your network for any reason,
rc.local settings will be lost.


> 2. Hand edit ifcfg-eth0.


Yes, you can set your static IP values in ifcfg-eth0
your gateway info goes in /etc/sysconfig/network

If you persist in editing network files,
you really need to read /usr/share/doc/initscripts-8.60/sysconfig.txt

Reply With Quote
  #10 (permalink)  
Old 03-10-2008, 03:37 AM
Timothy Murphy
 
Posts: n/a
Re: permanent ifconfig settings for Fedora 8

Joseph Hesse wrote:

> Here is a more definite question.
>
> I want to permanently change my IP, mask, gateway. Which is better.
>
> 1. An ifconfig command in rc.local. Also add a route command to
> rc.local to specify the gateway.
>
> 2. Hand edit ifcfg-eth0.


Given a choice between those two,
I would definitely choose the second -
edit /etc/sysconfig/network-scripts/ifcfg-eth?

Is it really eth0 you are concerned about?
That is usually used for an ethernet connection, I think;
and I am surprised you would have any problems with this.


--
Timothy Murphy
e-mail (<80k only): tim /at/ birdsnest.maths.tcd.ie
tel: +353-86-2336090, +353-1-2842366
s-mail: School of Mathematics, Trinity College, Dublin 2, Ireland
Reply With Quote
Reply

  { mindfrost82.com } > Gadget Corner > Tech Newsgroups > Linux > Linux Networking


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 Off
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 12:01 PM.


Powered by vBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0 ©2007, Crawlability, Inc.
© 1999-2008 mindfrost82.com v11.0


Sponsors:
Free Advertising | Problem Mortgage | Problem Mortgage | Personal Loans | Buy Anything On eBay



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114