Is it possible to connect a visualized Rpi with a network connection on a droplet?

Posted April 27, 2020 1.2k views

Hello, I have visualized a raspberry pi using QEMU, however it has no internet connection. I need the pi to have a internet connection in order to download required packages to it. I am visualizing the raspberry pi on a Ubuntu Droplet.

I have made a network bridge on the droplet and have defined a tap for the pi to use. The full list of commands executed,along with an explanation, are here:

The first step is to create our bridge:

```sudo ip link add br0 type bridge```

And then put it up:

```sudo ifconfig br0 up```

Next, we need to flush the IP address of our host NIC (this is usually eth0, however you can check using the command ifconfig):

```sudo ip addr flush dev eth0```

The command disconnects the server from the internet but if you use the launch console, you can still access it.

We can then add our host NIC to the bridge:

```sudo ip link set eth0 master br0```

Next we need to create our tap device:

```sudo ip tuntap add tap0 mode tap user root```

And add it to the bridge:

sudo ip link set tap0 master br0

Then we need to put it up:

```sudo ifconfig tap0 up```

We can then restore our eth0:

```sudo ifconfig eth0 up```

Finally, re-assign an IP address but this time to your bridge:

```sudo dhclient -v br0```

Now, I visualize the raspberry pi using QEMU in this command, note the -netdev portion:

qemu-system-arm -kernel -/qemu_vms/qemu-stretch. 79-stretch -cpu arm1176 -m 256 -M versatilepb -dtb —/qemu_vms/versattle-pb.dtb -serial stdio -append " root=/ dev/sda2 rootfstype=ext4 rw" -drive format—raw, /qemu_vms/ stretch. img -netdev -device elOOO,netdev=netO,mac=DE:AD:BE:EF:12:34 -no-reboot

I had an associate check, and all of the commands seemed to have executed correctly.When created the raspberry pi is not connected to the internet. Is their a limitation with Digital Oceans network?

Submit an answer

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!