Solved

Linux Startup Script

Posted on 2014-04-07
4
406 Views
Last Modified: 2014-04-07
A somewhat Linux novice here (I know enough to be DANGEROUS!).

Anyway, I've built a little ubuntu system to work as netem device to sit in-line and add some artificial latency to a lab network for testing a specific application.

That itself was pretty straight forward.  Now, I've essentially written a script to set it up, but was wondering how I could go about kicking it off at startup.  I know this is quite basic...

What I've put together:
#NOTE eth0 is the onboard NIC.  eth2 is the USB NIC.  Setup should be          
#[node]--(eth2)[NetEm](eth0)--[switch]
#Clear Network info on the network interfaces
ifconfig eth0 0.0.0.0
ifconfig eth2 0.0.0.0

#Build The Bridge
 brctl addbr br0

#Disable Forward Delay
 brctl setfd br0 0

#Add Interfaces to the Bridge
 brctl addif br0 eth0
 brctl addif br0 eth2

#Enable the Bridge
 ifconfig br0 up

#Disable Kernel-level filtering
 for f in /proc/sys/net/bridge/bridge-*; do echo 0 > $f; done

#tc qdisc limits Bandwidth on outbound queuing.
tc qdisc replace dev eth0 root handle 1:0 tbf rate 768kbit burst 1536 latency 1ms
tc qdisc replace dev eth2 root handle 2:0 tbf rate 768kbit burst 1536 latency 1ms

#Adding artificial 150 ms delay/latency with 1 ms +/- variation 
#Note in this example, latency is added to both interfaces

tc qdisc add dev eth0 parent 1:1 handle 10: netem delay 75ms 1ms
tc qdisc add dev eth2 parent 2:1 handle 10: netem delay 75ms 1ms

Open in new window

0
Comment
Question by:JamesonJendreas
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 36

Accepted Solution

by:
Kimputer earned 500 total points
ID: 39984576
Use this file:
/etc/rc.local
0
 
LVL 1

Author Comment

by:JamesonJendreas
ID: 39984579
Just to confirm, I should just put that syntax in rc.local, or do I use rc.local to poitn to this script?
0
 
LVL 36

Expert Comment

by:Kimputer
ID: 39984582
Both are a possibility.
0
 
LVL 1

Author Closing Comment

by:JamesonJendreas
ID: 39984615
Cheers!
0

Featured Post

Are You Using the Best Web Development Editor?

The worlds of web hosting and web development are constantly evolving. Every year we see design trends change, coding standards adapt and new frameworks/CMS created. With such a quick pace of change it’s easy to get lost trying to keep up.

See if your editor made the list.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
Setting up Secure Ubuntu server on VMware 1.      Insert the Ubuntu Server distribution CD or attach the ISO of the CD which is in the “Datastore”. Note that it is important to install the x64 edition on servers, not the X86 editions. 2.      Power on th…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
Suggested Courses

617 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