[SOLVED] Need help figuring out how to run these commands on boot
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!
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.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
Need help figuring out how to run these commands on boot
I just started learning how to manipulate Linux (Debian Lenny) about a month ago with the intention of ditching Windows eventually and learning to configure servers in the process. But, I still need Windows for certain things. I downloaded and installed VirtualBox (I know, VMWare is better, but I didn't know that at the time and don't want to go through the process all over again) and got Windows XP working with a tap interface and bridge interface to get the guest OS to talk to the home OS and connect to the Internet. My only problem is that the tap interface and bridge interface disappear when I reboot and then I have to issue the commands to set them up all over again. I know there is a way to write a script to run on boot to create them and bring them up, but my whole technical career has been with CLI-based stuff, not scripting. I'd like to eventually learn it, but I'm a learn-by-doing type. Basically I need the following commands to be implemented at startup:
I read somewhere that you can just add commands to your /etc/init.d/bootmisc.sh file in Debian, but I don't want to hose up my whole system somehow.
If someone could help me with this and tell me what the basic parts of the script accomplish (I'd like to learn this stuff, not just have people constantly do this for me b/c I don't know how), it would be greatly appreciated.
Isn't /etc/rc.local only present in RedHat, Fedora, etc?
Nevermind, I found it, but where do I put the commands? Right now, it looks like this:
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
# In order to enable or disable this script just change the execution
# By default this script does nothing.
Alternatively it could be done by writing the configuration in the /etc/network/interfaces file and letting the /etc/init.d/networking boot script do the work. Here is a sample interfaces file, taken from ubuntu 8.04 and used for VirtualBox before VirtualBox was enhanced to do it all itself. Change user c to allen and IP addresses as required
# eth0 is the physical interface.
# Bridging software will configure eth0 when it is added as a port to br0 (below)
# This minimal configuration avoids message "Ignoring unknown interface eth0=eth0"
iface eth0 inet manual
up ifconfig $IFACE 0.0.0.0 up
down ifconfig $IFACE down
# tap0 is a tap into the bridge defined below
# * tap0 is for use by VirtualBox
# * Guest OS will configure, hence "manual"
# * VirtualBox will be run by user c, hence user c
# * "ifconfig" is part of ifupdown package
# * "tunctl_user" is part of tunctl package
iface tap0 inet manual
up ifconfig $IFACE 0.0.0.0 up
down ifconfig $IFACE down
# br0 is a bridge connecting physical interface eth0 to OS and tap0
# * Stanzas for br0 ports must appear before the br0 stanza
# * Static configuration
# * No need for spanning tree protocol (stp) because no other bridges on network
iface br0 inet static
bridge_ports eth0 tap0
Thanks AlucardZero and catkin for your help. I tried both methods and they worked. I've started looking into several shell scripting tutorials and stuff, so hopefully I can figure this stuff out on my own in the future. I'm not used to being a noob and it kinda bugs me. Thanks again!
I've started looking into several shell scripting tutorials and stuff, so hopefully I can figure this stuff out on my own in the future. I'm not used to being a noob and it kinda bugs me.
Glad you found a solution
Yes -- it's frustrating when you switch OS and go from being adept to having everything to learn. Although the specifics are different, many of the principles are the same so you are off to a head start compared with learning your first OS. Hope you enjoy the adventure