问题
How can I run a scapy script inside mininet to generate custom packets? I know I could generate traffic using iperf ,netperf etc.But I need to customize the packets and then use them in mininet. Thanks, Regards, Sushmita
回答1:
You can generate trafic from hosts. You can run cli commands using xterm. I think that using dpkg-name -v you can see what version is emulated by host. So, you can customize ping or whatever you want from the emulated host!
Here you can see how to run commands in hosts setting a simulation from python script. E.g.
h1 = net.get('h1') result = h1.cmd('ifconfig') print result
回答2:
Scapy needs root authentication to run.It is difficult to use in the mininet environment. But you can use nat in mininet, then build packets in your machine and then send to hosts in miininet.
来源:https://stackoverflow.com/questions/46687866/scapy-with-mininet