Eathernet Bridging Running Script Bridge-Start

Posted on 2008-11-09
Last Modified: 2013-11-15

 Refer back to the Openvpn (Eathernet Bridging) Setup:

On the Page It said: Now run the bridge-start script. It will create a persistent tap0 interface and bridge it with the active ethernet interface

How I can run this two scripts (Bridge-start,Bridge-Stop)?
Question by:mubama0n
    LVL 29

    Expert Comment

    Hi ya

    create a file bridge-start like this in any where but do this in /root directory

    touch bridge-start

    then past the script in their

    then give permission to this script

    chmod 755 bridge-start

    then run this script like this  ./bridge-start

    do the same for the other one

    Author Comment

    Ok , Can I put it in (/etc/init.d) and write this command (chmod 755 bridge-start)?
    can you specify the root directory is it CD /root?
    If I wnt to let this script (bridge-start) to operated after rebooting can you show me how I do this?

    LVL 29

    Expert Comment

    easy way to do this task is

    insert the script in /etc/
    so it will run at leaset once when system will boot

    so edit rc.local file  , added the path of the script like thist  /root/bridge-start

    so next time when system will boot , it will restart automaticaly

    but i didnot understand , what you meant by this : can you specify the root directory is it CD /root?

    Author Comment

    I mean I didn't work before with this directory (/root) , Is it Required to put the script (bridge-start) on this directory (/root) or I can put it in another directory e.g.: /etc/openvpn or /etc/init.d?

    Remeber that When i run this script I must write : (./bridge-start) , can i write it like this on (rc.local)?
    Another question, If I want to run the following scripts on this sequence:
    2-start openvpn
    3- stop openvpn

    Can I put it also on (rc.local) to be started after booting?
    LVL 29

    Expert Comment

    its not required to put it in root directory. you an put any directory as long as you have full access to that directory.

    if you want you can create /etc/openvpn and the place those bridge-start and bridge-stop .

    if you want to run the script from command prompt then you will have to use ./bridge-start.

    but when you will add that one in rc.local, you dont need to write ./bridge-start

    as i said, just write the path of that file ( for /etc/openvpn/bridge-start) just write  /etc/openvpn/bridge-start

    2-start openvpn  == if you would be able to add individual command in rc.local file,

    but you will have to give it full restart command

    suppose if i want to restrt httpd by rc.local i will write : service httpd start in rc.local

    another way you would be able to add openvpn  to run after linux boot up like this : chckconfig openvpn on  ( if open vpn support chckconfig)

    let me know if you need further explanation


    Author Comment

    Thanks for this Clarification I'm really appreciated , About the second question (scripts sequence) I don't know who is the file(script) that responsible for calling processes during boot so I thought that (rc.local)is the one , Any way I'm far away now from the Linux machine around (2)HRS from now I'll be near the machines and I'll let you know about the result.
    LVL 29

    Expert Comment

    if you have root access, then its fine. root will have everything on the process

    do everything as root user.

    Author Comment

    The First line on (rc) file is :
    Shall I put the start-bridge statement after this line?
    LVL 29

    Accepted Solution

    sorry my account was cancled for a while due to not close question properly!!!

    insert after last line. [ path of the script as i said before ]

    Featured Post

    What Is Threat Intelligence?

    Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

    Join & Write a Comment

    Introduction We as admins face situation where we need to redirect websites to another. This may be required as a part of an upgrade keeping the old URL but website should be served from new URL. This document would brief you on different ways ca…
    SSH (Secure Shell) - Tips and Tricks As you all know SSH(Secure Shell) is a network protocol, which we use to access/transfer files securely between two networked devices. SSH was actually designed as a replacement for insecure protocols that sen…
    Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
    Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…

    734 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    21 Experts available now in Live!

    Get 1:1 Help Now