简体   繁体   中英

running tcpreplay with docker and boot2docker

I'm working on a netflow logger and I want to setup some automated performance testing. I want to take my testing pcap and replay it to my program from within a docker image running under boot2docker. The networking side of this is stumping me.

I can access my desktop (the machine hosting the boot2docker vm) from within the docker image running under boot2docker (scp/ssh/netcat all seem to work as expected). However, when I run tcpreplay on my pcap from within the docker image I never see the traffic on my desktop.

What I've tried:

  • rewrite the srcip in the pcap to be the srcip of the docker host
  • tcpdump piped through netcat (netflow is UDP so I don't really care about the connection setup) The traffic makes it but my program gets some exceptions and dies. This doesn't surprise me, but it does indicate that I can get the traffic out of the docker vm and into my program.
  • I can successfully tcpreplay the pcap to my program from within a normal debian vm

Any ideas on what I need to do to get tcpreplay to send my pcap to my desktop?

Try change the destination MAC addr to that of docker0, which is the default VM running. This works for me.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM