Skip to content
Snippets Groups Projects
Commit 76dcbbcd authored by Michael Marsh's avatar Michael Marsh
Browse files

configure link before starting netem

parent 9418998c
No related branches found
No related tags found
No related merge requests found
......@@ -55,12 +55,6 @@ def connect_nodes(node1, node2):
'peer', 'name', dev_2
])
# Configure the link for network emulation.
subprocess.call([
'sudo',
'tc', 'qdisc', 'add', 'dev', dev_1, 'root', 'handle', '1:0', 'netem'
])
# Add the link endpoints to the container namespaces.
def add_to_ns(dev,ns):
subprocess.call([
......@@ -93,6 +87,15 @@ def connect_nodes(node1, node2):
route_from_to(ctr1,ctr2,dev_1)
route_from_to(ctr2,ctr1,dev_2)
# Configure the link for network emulation.
def enable_netem(ns, dev):
subprocess.call([
'sudo', 'ip', 'netns', 'exec', ns,
'tc', 'qdisc', 'add', 'dev', dev, 'root', 'handle', '1:0', 'netem'
])
enable_netem(ctr1['name'],dev_1)
enable_netem(ctr2['name'],dev_2)
def make_mesh():
global nodelist
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment