![]() |
|
|
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. |
|
|||||||
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
|
|||
|
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 |
|
|||
|
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 |
|
|||
|
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 |
|
|||
|
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. |
|
|||
|
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 |
|
|||
|
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 |
|
|||
|
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 |
|
|||
|
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 |
|
|||
|
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 |
![]() |
|
| Thread Tools | Search this Thread |
| Display Modes | |
|
|