Networking Forums

Networking Forums > Computer Networking > Linux Networking > permanent ifconfig settings for Fedora 8

Reply
Thread Tools Display Modes

permanent ifconfig settings for Fedora 8

 
 
Joseph Hesse
Guest
Posts: n/a

 
      03-09-2008, 02:22 PM
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
 
 
 
 
Paul Black
Guest
Posts: n/a

 
      03-09-2008, 03:09 PM
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
 
Joseph Hesse
Guest
Posts: n/a

 
      03-09-2008, 03:47 PM
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
 
Moe Trin
Guest
Posts: n/a

 
      03-09-2008, 07:27 PM
On Sun, 09 Mar 2008, in the Usenet newsgroup comp.os.linux.networking, in
article <(E-Mail Removed)>, 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
 
Allen McIntosh
Guest
Posts: n/a

 
      03-09-2008, 08:21 PM
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
 
Timothy Murphy
Guest
Posts: n/a

 
      03-09-2008, 08:49 PM
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
 
Bit Twister
Guest
Posts: n/a

 
      03-09-2008, 09:16 PM
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
 
Joseph Hesse
Guest
Posts: n/a

 
      03-09-2008, 09:53 PM
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
 
Bit Twister
Guest
Posts: n/a

 
      03-09-2008, 10:02 PM
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
 
Timothy Murphy
Guest
Posts: n/a

 
      03-10-2008, 01:37 AM
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

Thread Tools
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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
permanent ifconfig settings Markus Mayer Linux Networking 4 03-07-2008 11:22 PM
Must "save settings" in fedora core 3 pkperson@gmail.com Linux Networking 0 05-20-2005 03:02 AM
fedora fc2 & Microsoft MN-520 wireless loses settings after reboot Matt Warnock Linux Networking 0 08-22-2004 03:57 PM
How Do I Config Static Route Permanent On Fedora mpanlop Linux Networking 3 04-15-2004 03:03 PM
dhcp lan ; Fedora without ifconfig Alan Linux Networking 1 01-21-2004 08:48 AM



1 2 3 4 5 6 7 8 9 10 11