Home › Forums › FABRIC General Questions and Discussion › Set link characteristics
- This topic has 5 replies, 3 voices, and was last updated 2 years, 1 month ago by ilknur Aydin.
-
AuthorPosts
-
June 26, 2022 at 9:58 pm #2213
In our experiment, each link may have a different delay, delay variation, and packet loss ratio.
I was wondering if it was possible to set these variables on the Jupyter notebook (links property) rather than on the nodes.Thank you
- This topic was modified 2 years, 5 months ago by Arash SARABI.
June 27, 2022 at 6:56 am #2215Most of the library functionality that sets internal configuration of the VMs is just a wrapper around SSH (actually paramiko). We can, and will, add more helper functions like these but there will always be some configuration that we do not anticipate.
You can, however, make arbitrary config like this:
myNode.execute("sudo ip link set dev eth1 mtu 9000")
You can even dynamically create the command to get the device names like this:
myiface = myNode.get_interface(network_name='myNetwork') myNode.execute(f"sudo ip link set dev {myiface..get_os_interface()} mtu 9000")
There is an example of creating similar commands in this notebook: https://github.com/fabric-testbed/jupyter-examples/blob/master/fabric_examples/fablib_api/create_l2network_basic_tagged.ipynb
Note that some time soon we will update the config to use NetworkManager inside the VMs. When this happens you will need to either use NetworkManager to configure the VMs or turn network manager off before issuing ‘ip’ commands. The benefit of NetworkManager is that changes will live through the VM being rebooted.
July 4, 2022 at 1:59 am #2223Thank you for all your help,
How can I use Bash “magic”? when I try to use the following command it returns an error.
%%bash -s “$FABRIC_SLICE_PRIVATE_KEY_FILE” “$FABRIC_BASTION_USERNAME” “$FABRIC_BASTION_HOST” “$ROMEO_USER” “$ROMEO_IP”
ssh -q -o StrictHostKeyChecking=accept-new -o UserKnownHostsFile=/dev/null -i $1 -J $2@$3 $4@$5 << EOF
##############################################echo ‘Hello from:’; hostname
##############################################
exit
EOFHere is the error:
Warning: Permanently added ‘bastion-1.fabric-testbed.net,152.54.15.12’ (ECDSA) to the list of known hosts.
—————————————————————————
CalledProcessError Traceback (most recent call last)
/tmp/ipykernel_864/42773540.py in <module>
—-> 1 get_ipython().run_cell_magic(‘bash’, ‘-s “$FABRIC_SLICE_PRIVATE_KEY_FILE” “$FABRIC_BASTION_USERNAME” “$FABRIC_BASTION_HOST” “$ROMEO_USER” “$ROMEO_IP”‘, “ssh -q -o StrictHostKeyChecking=accept-new -o UserKnownHostsFile=/dev/null -i $1 -J $2@$3 $4@$5 << EOF\n##############################################\n\necho ‘Hello from:’; hostname\n\n##############################################\nexit\nEOF\n”)/opt/conda/lib/python3.9/site-packages/IPython/core/interactiveshell.py in run_cell_magic(self, magic_name, line, cell)
2401 with self.builtin_trap:
2402 args = (magic_arg_s, cell)
-> 2403 result = fn(*args, **kwargs)
2404 return result
2405/opt/conda/lib/python3.9/site-packages/IPython/core/magics/script.py in named_script_magic(line, cell)
140 else:
141 line = script
–> 142 return self.shebang(line, cell)
143
144 # write a basic docstring:<decorator-gen-103> in shebang(self, line, cell)
/opt/conda/lib/python3.9/site-packages/IPython/core/magic.py in <lambda>(f, *a, **k)
185 # but it’s overkill for just that one bit of state.
186 def magic_deco(arg):
–> 187 call = lambda f, *a, **k: f(*a, **k)
188
189 if callable(arg):/opt/conda/lib/python3.9/site-packages/IPython/core/magics/script.py in shebang(self, line, cell)
243 sys.stderr.flush()
244 if args.raise_error and p.returncode!=0:
–> 245 raise CalledProcessError(p.returncode, cell, output=out, stderr=err)
246
247 def _run_script(self, p, cell, to_close):CalledProcessError: Command ‘b”ssh -q -o StrictHostKeyChecking=accept-new -o UserKnownHostsFile=/dev/null -i $1 -J $2@$3 $4@$5 << EOF\n##############################################\n\necho ‘Hello from:’; hostname\n\n##############################################\nexit\nEOF\n”‘ returned non-zero exit status 255.
July 4, 2022 at 9:38 pm #2224I fixed the issue. Thank you
October 13, 2022 at 8:01 am #3306how did you fix the issue?
October 13, 2022 at 8:03 am #3307I have this command
%%bash -s “$FABRIC_SLICE_PRIVATE_KEY_FILE” “$FABRIC_BASTION_USERNAME” “$FABRIC_BASTION_HOST” “$ROUTER1_USER” “$ROUTER1_IP” “$router1Cmd”
ssh -q -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -i $1 -J $2@$3 $4@$5 << EOF
##############################################cd
echo “hello” > hello.txt
##############################################
exit
EOFgetting the following error, any comments on how to fix the issue or what the issue is?
Host key verification failed.
—————————————————————————
CalledProcessError Traceback (most recent call last)
/tmp/ipykernel_55/1667276590.py in <module>
—-> 1 get_ipython().run_cell_magic(‘bash’, ‘-s “$FABRIC_SLICE_PRIVATE_KEY_FILE” “$FABRIC_BASTION_USERNAME” “$FABRIC_BASTION_HOST” “$ROUTER1_USER” “$ROUTER1_IP” “$router1Cmd”‘, ‘ssh -q -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -i $1 -J $2@$3 $4@$5 << EOF\n##############################################\n\ncd\necho “hello” > hello.txt\n##############################################\nexit\nEOF\n’)/opt/conda/lib/python3.9/site-packages/IPython/core/interactiveshell.py in run_cell_magic(self, magic_name, line, cell)
2404 with self.builtin_trap:
2405 args = (magic_arg_s, cell)
-> 2406 result = fn(*args, **kwargs)
2407 return result
2408/opt/conda/lib/python3.9/site-packages/IPython/core/magics/script.py in named_script_magic(line, cell)
140 else:
141 line = script
–> 142 return self.shebang(line, cell)
143
144 # write a basic docstring:<decorator-gen-103> in shebang(self, line, cell)
/opt/conda/lib/python3.9/site-packages/IPython/core/magic.py in <lambda>(f, *a, **k)
185 # but it’s overkill for just that one bit of state.
186 def magic_deco(arg):
–> 187 call = lambda f, *a, **k: f(*a, **k)
188
189 if callable(arg):/opt/conda/lib/python3.9/site-packages/IPython/core/magics/script.py in shebang(self, line, cell)
243 sys.stderr.flush()
244 if args.raise_error and p.returncode!=0:
–> 245 raise CalledProcessError(p.returncode, cell, output=out, stderr=err)
246
247 def _run_script(self, p, cell, to_close):CalledProcessError: Command ‘b’ssh -q -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -i $1 -J $2@$3 $4@$5 << EOF\n##############################################\n\ncd\necho “hello” > hello.txt\n##############################################\nexit\nEOF\n” returned non-zero exit status 255.
-
AuthorPosts
- You must be logged in to reply to this topic.