Scapy with Mininet

风格不统一 提交于 2019-12-26 05:04:22

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!