[SOLVED] how to change the script at the network-script so not to waste time
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
how to change the script at the network-script so not to waste time
Hello,
I was wondering if one can substitute quickly scripts. I am setting up a simple network and want to be able to have preconfigured scripts. For instance the /etc/sysconfig/network-scripts/ifcfg-eth0. This at the end could be changed quickly. I mean the path to the ifcfg-eth0 would maybe have another name or something. Or do I have to go in and change the vi file?
Take care,
Albert
- If you want/need to edit a script/file you can use vi (or any other editor you like),
- You can also use awk or sed (just 2 examples) to change a file/script (no need for an editor in this case).
Without knowing exactly what it is you want I cannot help you any further.
Thanks,
I guess one can not swap out the ifcfg-eth0 file with another...say ifcfg-eth02 or any other name. I guess the permanent change is not that important for the ip address because it can be change quickly as noted.
Thanks again,
Albert
I guess one can not swap out the ifcfg-eth0 file with another...say ifcfg-eth02 or any other name. I guess the permanent change is not that important for the ip address because it can be change quickly as noted.
There's a little bit more info in your reply.
Is this what you want: Have multiple ifcfg-eth0 files, each with their own unique properties inside?
If that is the case: The scripts that control bringing up the network devices look for a specific name pattern, if you use a different name it will not be used. Example ifcfg-eth0 will be used, _ifcfg-eth0 will not be used.
In the /etc/sysconfig/network-scripts/ directory you can create files like this:
_ifcfg-eth0.cfg1
_ifcfg-eth0.cfg2
_ifcfg-eth0.cfg3
etc.
The only thing you now need to to is to copy (not move) the correct file to the name that will be used:
BTW: Can you put up the [SOLVED] tag.
- above the first post -> Please Mark this thread as solved if you feel a solution has been provided.
- -or- -
- first post -> Thread Tools -> Mark this thread as solved
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.