permanent ifconfig settings for Fedora 8 - Networking

This is a discussion on permanent ifconfig settings for Fedora 8 - Networking ; 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. ...

+ Reply to Thread
Results 1 to 13 of 13

Thread: permanent ifconfig settings for Fedora 8

  1. 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

  2. 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

  3. 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

  4. 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

  5. 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.

  6. 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

  7. 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

  8. 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




  9. 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


  10. 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

  11. Re: permanent ifconfig settings for Fedora 8

    Bit Twister wrote:

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


    I don't think that is true.
    No program has ever added or subtracted to my /etc/rc.d/rc.local ,
    as far as I recall.

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

  12. Re: permanent ifconfig settings for Fedora 8

    On Sun, 09 Mar 2008, in the Usenet newsgroup comp.os.linux.networking, in
    article , Timothy Murphy wrote:

    >Moe Trin wrote:


    >> /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.


    Your privilege - I don't agree with your reasoning either ;-)

    >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.


    That may be, but the O/P has not described what he is doing - i.e.
    changing an _existing_ setup (what kind - static, DHCP) or is there no
    setup at this time? If the former, the existing setup will be made,
    configuring the system to "some" IP address, then all the "other"
    network services will be started, and FINALLY rc.local will change the
    IP address, screwing things up just a bit. If you insist on replacing
    the existing boot scripts, it's a lot smarter to write your own network
    boot script, replacing the existing one. That way, the network is
    brought up at the right time with the correct values. But you'd really
    better know what you are doing AND what the original script did.

    >In my experience, system-config-network leads one
    >into an incomprehensible morass.


    Actually, if the O/P uses the Red Hat supplied tools to make the change,
    things are dome correctly (in the "right" files) even if you can't find
    them. And for that matter, a simple sequence of

    touch touchstone
    system-config-network (or click the "appropriate" icon)
    find / -newer touchstone -type f -exec ls -l {} \;

    will find all of the hidden crap. It's not as if this problem has never
    been seen AND SOLVED before using the existing tools.

    >It changes random files all over the system,
    >and rarely if ever does any good.


    Have you files a bug report with Fedora/Red Hat?

    They might seem random for you if you haven't audited the boot scripts
    to see how things are done, but those are certainly NOT random. Did
    you notice that a few of those configuration files are actually hard
    links, so in reality you are editing a common file?

    Old guy

  13. Re: permanent ifconfig settings for Fedora 8

    On Mon, 10 Mar 2008 02:39:10 +0000, Timothy Murphy wrote:
    > Bit Twister wrote:
    >
    >> rc.local is not permanent. If you restart your network for any reason,
    >> rc.local settings will be lost.

    >
    > I don't think that is true.
    > No program has ever added or subtracted to my /etc/rc.d/rc.local ,
    > as far as I recall.


    I never said or indicated rc.local would be modified.

    If you place network configuration commands in rc.local they will be
    executed on boot.

    But, if you do a "service network restart" rc.local will not be
    executed and if your rc.local overrode settings in network configuration
    files, those setting in rc.local will not be applied.

+ Reply to Thread