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

configure links with network emulation

parent 231f8bf1
No related branches found
No related tags found
No related merge requests found
...@@ -54,6 +54,13 @@ def connect_nodes(node1, node2): ...@@ -54,6 +54,13 @@ def connect_nodes(node1, node2):
'ip', 'link', 'add', dev_1, 'type', 'veth', 'ip', 'link', 'add', dev_1, 'type', 'veth',
'peer', 'name', dev_2 '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. # Add the link endpoints to the container namespaces.
def add_to_ns(dev,ns): def add_to_ns(dev,ns):
subprocess.call([ subprocess.call([
......
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