Thanks, Gabe. I think I'm getting closer to getting it to work.

I also needed to run the following:
sudo ifconfig gem5-tap up
sudo ifconfig gem5_bridge up

After that, I can see data arriving on gem5's EtherTap device. However, no
data is arriving on the simulated Linux device. I think it's probably an
issue with my setup (I have a static IP on the host). I'll keep digging and
make sure to writeup a document with how to get this to work when I have it
figured out.

Cheers,
Jason

On Thu, Oct 12, 2017 at 5:11 PM Gabe Black <gabebl...@google.com> wrote:

> Hi Jason. To get this to work, you can either use the little utility in
> util/tap which will connect you sort of like wireshark using EtherTapStub,
> or you can use the tup/tap interface directly using EtherTap. I've used the
> later more or less successfully. It will (with default configuration)
> create a tap device on your host called gem5-tap. Then you need to create a
> bridge which will connect that device to a real device so that it can get
> out onto the real network. Something like these commands will probably make
> that happen:
>
> sudo ip link add name gem5_bridge type bridge
> sudo ip link set eth0 master gem5_bridge
> sudo tunctl -u `whoami` -g `whoami` -t gem5-tap
> sudo ip link set gem5-tap master gem5_bridge
>
> You'll want to give up the IP assigned to your eth0, or otherwise things
> get confused and your connection may drop. You should be able to do that
> with these commands, although exactly what's happening is still a little
> mysterious to me. I think the IP address is assumed by the bridge somehow
> maybe?
>
> sudo ifconfig eth0 down
> sudo ifconfig eth0 0.0.0.0 up
>
> You'll probably also want to stop dhcp from running on eth0 so it doesn't
> get a new IP later on.
>
> Also, if you're going to be running multiple simulations bridged to the
> network, you'll want to make sure you set the MAC address of each simulated
> NIC to something unique.
>
> Gabe
>
> On Thu, Oct 12, 2017 at 4:25 PM, Jason Lowe-Power <ja...@lowepower.com>
> wrote:
>
>> Hi all (and Gabe specifically),
>>
>> It sounds like you got the ethertap object to work, Gabe. (
>> https://gem5-review.googlesource.com/c/public/gem5/+/3646/4)
>>
>> What was necessary to do this? I *think* I have gem5 configured
>> correctly, and I've created a tun device. However, the next step of somehow
>> connecting the gem5 tap device to my "real" ethernet device is a mystery to
>> me.
>>
>> If someone has a set of scripts or maybe just an example of how to get
>> this feature to work, I'd really appreciate it.
>>
>> I would like to be able to use gem5 more like qemu. I.e., boot gem5 and
>> then connect to the outside world to install new packages, etc. Is this
>> possible with the tun/tap interface?
>>
>> Thanks,
>> Jason
>>
>
>
_______________________________________________
gem5-dev mailing list
gem5-dev@gem5.org
http://m5sim.org/mailman/listinfo/gem5-dev

Reply via email to