Skip to content

Commit

Permalink
Document how to set up network with wireless adapter
Browse files Browse the repository at this point in the history
This is working with wired or wireless adapters. For wired, it's not
necessary because macvtap can do the trick, but it has issues with
wireless adapters.

The whole quick-start document tries to set up a well separated
environment with reignite specific containerd configuration, thinpool
location. Based on this logic the networking setup follows the same
principles.

This is an issue only with wireless adapters, so this is completely
linux specific as VirtualBox machines have as "wired" connection.
Because of this simple reason, the documentation utilize virsh to create
a network with all the required bridge configuration and iptables rules.

related to liquidmetal-dev#128
  • Loading branch information
yitsushi committed Oct 12, 2021
1 parent 6578913 commit c6b0dec
Showing 1 changed file with 83 additions and 6 deletions.
89 changes: 83 additions & 6 deletions docs/quick-start.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,82 @@
# Getting started with reignite

## Configure network

If you are using wired connection, you can skip this and jump straight to the
"Containerd" section. With wireless adapter, macvtap has some issues. The easy
workaround is to use a bridge and tap devices instead.

You can use the default kvm network, in this case, skip to
"Create and connect tap device" and use `default`. With using a separate
network, it's guaranteed no other kvm machines has any kind of effect on the
reignited network (for example IP or MAC address conflict).

### Create kvm network

Create the `reignite.xml` file (feel free to change the IP range):

```xml
<network>
<name>reignite</name>
<forward mode='nat'>
<nat>
<port start='1024' end='65535'/>
</nat>
</forward>
<bridge name='rgntbr0' stp='on' delay='0'/>
<ip address='192.168.100.1' netmask='255.255.255.0'>
<dhcp>
<range start='192.168.100.2' end='192.168.100.254'/>
</dhcp>
</ip>
</network>
```

Define, start and set autostart on the `reignite` network:

```
virsh net-define reignite.xml
virsh net-start reignite
virsh net-autostart reignite
```

Now you should see the network in the network list:

```
virsh net-list
Name State Autostart Persistent
---------------------------------------------
default active yes yes
reignite active yes yes
```

### Create and connect tap device

```bash
tapName=tap0
bridge=rgntbr0
sudo ip tuntap add ${tapName} mode tap
sudo ip link set ${tapName} master ${bridge} up
```

You can add a function into your bashrc/zshrc:

```bash
function vir-new-tap() {
tapName=${1:=tap0}
bridge=${2:=rgntbr0}

sudo ip tuntap add ${tapName} mode tap
sudo ip link set ${tapName} master ${bridge} up
}
```

You can check the DHCP leases with `virsh`:

```bash
virsh net-dhcp-leases default
```

## Containerd

### Create thinpool
Expand Down Expand Up @@ -40,7 +117,7 @@ state = "/run/containerd-dev"

### Start containerd

```
```bash
# Just to make sure all the directories are there.
sudo mkdir -p /var/lib/containerd-dev/snapshotter/devmapper
sudo mkdir -p /run/containerd-dev/
Expand All @@ -51,7 +128,7 @@ sudo containerd --config /etc/containerd/config-dev.toml
To reach our new dev containerd, we have to specify the `--address` flag,
for example:

```
```bash
sudo ctr \
--address=/run/containerd-dev/containerd.sock \
--namespace=reignite \
Expand All @@ -60,7 +137,7 @@ sudo ctr \

To make it easier, here is an alias:

```
```bash
alias ctr-dev="sudo ctr --address=/run/containerd-dev/containerd.sock"
```

Expand All @@ -69,7 +146,7 @@ alias ctr-dev="sudo ctr --address=/run/containerd-dev/containerd.sock"
We have to use a custom built firecracker from the macvtap branch
([see][discussion-107]).

```
```bash
git clone https://github.com/firecracker-microvm/firecracker.git
git fetch origin feature/macvtap
git checkout -b feature/macvtap origin/feature/macvtap
Expand All @@ -90,7 +167,7 @@ from the [Pre-requisities discussion][discussion-107].

## Set up and start reignite

```
```bash
go mod download
make build

Expand Down Expand Up @@ -129,7 +206,7 @@ ERRO[0007] failed to reconcile vmid Hello/aa3b711d-4b60-4ba5-8069-0511c213308c:
There is a plan to create a VM, but something went wrong. The easiest way to
fix it to remove it from containerd:

```
```bash
vmid='aa3b711d-4b60-4ba5-8069-0511c213308c'
contentHash=$(\
ctr-dev \
Expand Down

0 comments on commit c6b0dec

Please sign in to comment.