Comments (6)
Hi, thanks for being interested in Katharà.
You can use the current system to add any script to a network node and run a startup command to start it.
What you need is the lstart command in a lab directory containing your node folders (with any script you want) and the lab.conf file.
from kathara.
Thank you very much for your reply.
I try to write a Python script (send packets using the scapy module) in the node directory, and then run the Python file in the node's startup file. But the node's xterm says: ImportError: No module named 'scapy'. I guess it may be that the module is not in the docker images, and I may need to regenerate the images.
So, do you have a better suggestion for the above question, or a traffic generation tool?
Thank you very much.
from kathara.
Hi,
You just need to install scapy in the node.
Before running your python script, in the startup file, just run a pip install scapy
to install scapy.
If you have other dependencies it would be better to install them from a requirements.txt
file just like you would do in your machine
from kathara.
My initial thought was this. I want to do "pip install XX" operation in the node's xterm. However, there is no pip command. I tried "apt-get install python-pip (python3-pip)" with no success, which may be the cause of the network. I am using the intranet, so I should find their offline installation packages. But this has another problem, how do I send the installation package to the node.
I'm not sure if there is something wrong with my thinking.
By the way, I think these operations may not be saved when I start emulating the network again.
Thanks again for your reply.
from kathara.
You need to specify startup operations in the startup file of your node. E.g. your node is called 'foo' and you have a 'foo.startup' file in your lab folder.
Also in order to use apt or pip you need to have that node bridged (foo[bridged]=true
in your lab.conf if I recall correctly, check the manual), otherwise the node is isolated from the internet and you can't download anything.
Another way (but I don't suggest it for this simple task) is to create your own docker image from the base kathara one and you specify your custom image using the image
option in lab.conf.
from kathara.
Thank you very much for your suggestion, it helped me a lot. This issue has now been resolved.
Thanks to you and your team.
from kathara.
Related Issues (20)
- Add `copy_directory_from_path` method to FilesystemMixin
- Kubernetes startup watch may never terminate if there is a Pod error
- Allow space in `sysctl` and `env` metas
- Add the possibility to specify a custom name for network scenario configuration file from the Python API
- Add `gnome-terminal` as terminal emulator
- "RTNETLINK answers: Operation not supported" when running traffic-control labs in MacOS HOT 4
- `tc` does not work on Windows hosts (WSL 2) HOT 1
- Use `rich` to render progress bars and add UI progress for Docker image pull
- Enable using `amd64` images on macOS using Rosetta
- UI Improvements using `rich`
- Multipath support not enabled in WSL
- API Improvements
- Bug using Kathara.get_instance().exec() with Kubernetes and stream=True with Kathara 3.7.3 HOT 5
- Not all Pods are Terminating with Kubernetes and Kathara 3.7.3 HOT 8
- Container Creation failed, rp_filter not found HOT 1
- Private registry support on Megalos HOT 1
- Can't undeploy link on running lab using Kathara.get_instance().undeploy_link() with the python api HOT 2
- Unable to add link to deployed lab HOT 5
- Error on startup and when connecting to a device HOT 3
- Add ability for kathara exec to return same status code as executed command HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from kathara.