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 <[email protected]>
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
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev

Reply via email to