You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Images: add a small section about snapshots management
Images: fix the list of flavorable commands
Images: fix the flavour example
Installation: add POT_EXTRA_EXTIF explanation
Add proper references to extra network interfaces in configuration files
Quick: add a section about private-bridge network type
Copy file name to clipboardExpand all lines: share/doc/pot/Images.md
+15-4
Original file line number
Diff line number
Diff line change
@@ -65,6 +65,15 @@ test_1.0.xz.skein
65
65
```
66
66
The first file is the image, the second file is a hash file, used by the `import` command to verify the integrity.
67
67
68
+
#### Snapshots management
69
+
70
+
The `export` command will create an image if and only if one snapshot is available.
71
+
The flag `-A` try to automatically fix the number of available snapshots:
72
+
* if 0 snapshots are available, `-A` will automatically invoke `pot snapshot`
73
+
* if 2+ snapshots are available, `-A` will automatically invoke `pot purge-snapshots`
74
+
75
+
The command `pot purge-snapshots` deletes all snapshots, except the last one.
76
+
68
77
### Images creation automated with flavours
69
78
70
79
Flavour is the way we currently provide to automate the customization of a `pot`.
@@ -92,9 +101,9 @@ Now we automate those commands in a flavour, called `nginx-test`.
92
101
In the flavour folder we create one file for the `pot` configuration:
93
102
```console
94
103
# cat /usr/local/etc/pot/flavours/nginx-test
95
-
set-cmd -p test -c "nginx -g 'daemon off;'"
96
-
set-attribute -p test -A no-rc-script -V YES
97
-
set-attribute -p test -A persistent -V NO
104
+
set-cmd -c "nginx -g 'daemon off;'"
105
+
set-attribute -A no-rc-script -V YES
106
+
set-attribute -A persistent -V NO
98
107
set-rss -C 1
99
108
```
100
109
@@ -119,11 +128,13 @@ The flavour `nginx-test` can now be used with the `create` command:
119
128
120
129
An important note: while the bootstrap script is a shell script, where you can do whatever you want, the `pot` command usable in a flavour are a small subset:
121
130
*`add-dep`
131
+
*`export-ports`
122
132
*`copy-in`
123
133
*`mount-in`
124
134
*`set-attribute` (the abbreviated form `set-attr` is not recognized here)
135
+
*`set-cmd`
136
+
*`set-env`
125
137
*`set-rss`
126
-
*`export-ports`
127
138
128
139
**NOTE** the `mount-in` command has to be used carefully. If the `pot` will be migrated to a different machine, the folders or the ZFS datasets has to be manually migrated as well
Copy file name to clipboardExpand all lines: share/doc/pot/Installation.md
+15-1
Original file line number
Diff line number
Diff line change
@@ -65,7 +65,7 @@ In order to use network types like `alias` or `public-bridge`, some configuratio
65
65
#### `POT_EXTIF` (default `em0`)
66
66
Currently, `pot` assumes that all the network traffic is going through one physical network interface.
67
67
This parameter configures `pot` to use the specified network interface.
68
-
It's relevant for `alias`and `public-bridge` network type.
68
+
It's relevant for `alias`, `public-bridge`and `private-bridge` network type.
69
69
70
70
#### `POT_NETWORK` (default `10.192.0.0/10`)
71
71
This parameter specifies the IPv4 address of you internal virtual network and is used by the `public-bridge` network type only.
@@ -79,6 +79,20 @@ Theoretically, the netmask can be derived by the `POT_NETWORK`. For now, this is
79
79
#### `POT_GATEWAY` (default `10.192.0.1`)
80
80
This parameter specifies the IP address that will be used as default gateway in your internal virtual network. It has to be part of the network specified in `POT_NETWORK` and it will be used as default gateway for all `pot`s attached to the internal virtual network (`public-bridge` network type).
81
81
82
+
#### `POT_EXTRA_EXTIF` (default empty)
83
+
In case your host has multiple network interfaces connected to multiple network segments, this option allows your `pot`s to access those network segments.
84
+
For example, let's say that you have 2 vlan interfaces, called `vlan20` and `vlan30`.
85
+
`vlan20` is configured as 10.0.20.4/24
86
+
`vlan30` is configured as 10.0.30.8/24
87
+
To make those segments accessible, the configuration file should look like:
88
+
```
89
+
POT_EXTRA_EXTIF=vlan20 vlan30
90
+
POT_NETWORK_vlan20=10.0.20.0/24
91
+
POT_NETWORK_vlan30=10.0.30.0/24
92
+
```
93
+
Currently there is no way to use additional external interface for the network type `alias`.
94
+
All other network types are supported
95
+
82
96
#### Network validation
83
97
If you want to check that your network configuration is valid, you can use the utility `potnet`:
Copy file name to clipboardExpand all lines: share/doc/pot/QuickStart.md
+59-13
Original file line number
Diff line number
Diff line change
@@ -41,12 +41,12 @@ This command will just create the needed ZFS datasets.
41
41
## Create a simple `pot`
42
42
We can now create the simplest `pot`
43
43
```console
44
-
# pot create -p mypot -t single -b 11.2
44
+
# pot create -p mypot -t single -b 11.3
45
45
```
46
46
**NOTE** The FreeBSD machine doesn't have to be the same version of your `pot` (jail). However, the hosting machine's version has to be greater or equal than the `pot`'s one.
47
-
For instance, you can run a FreeBSD 10.4 `pot` on a FreeBSD 11.2 host. You **cannot** run a FreeBSD 12 `pot` on a FreeBSD 11.2 host.
47
+
For instance, you can run a FreeBSD 10.4 `pot` on a FreeBSD 11.3 host. You **cannot** run a FreeBSD 12 `pot` on a FreeBSD 11.3 host.
48
48
49
-
So, we created a `pot`, named `mypot`, based on FreeBSD 11.2 consisting of one ZFS dataset.
49
+
So, we created a `pot`, named `mypot`, based on FreeBSD 11.3 consisting of one ZFS dataset.
50
50
51
51
Now you can start it or stop it, via:
52
52
```console
@@ -69,7 +69,7 @@ You can see a list of the `pot`s available on you local machine. The verbose out
69
69
pot name : mypot
70
70
ip4 : inherit
71
71
active : true
72
-
base : 11.2
72
+
base : 11.3
73
73
level : 0
74
74
datasets:
75
75
snapshot:
@@ -79,7 +79,7 @@ If you want to get some information on a specific `pot`, this command is more us
79
79
# pot info -v -p mypot
80
80
pot name : mypot
81
81
type : single
82
-
base : 11.2
82
+
base : 11.3
83
83
level : 0
84
84
ip4 : inherit
85
85
active : true
@@ -220,12 +220,13 @@ During the creation phase, it's possible to specify which type of network our `p
220
220
* inherit
221
221
* alias (IPv4 or IPv6) n the host network interface
222
222
* IPv4 address on the public internal virtual network
223
+
* IPv4 address on a private internal virtual network
223
224
224
225
By default, `inherit` is the chosen one.
225
226
### Network configuration: inherit
226
227
To use the `inherit` network type, a `pot` can be created with the following command:
227
228
```console
228
-
# pot create -p mypot -t single -b 11.2 -N inherit
229
+
# pot create -p mypot -t single -b 11.3 -N inherit
229
230
```
230
231
The option `-N` can be omitted, because `inherit` is the default value.
231
232
The `inherit` type means that `mypot` will reuse the same network stack of the host machine.
@@ -237,7 +238,7 @@ If your host is a network that support static IPs, you can assign one static IP
237
238
For example, your system has 192.168.178.20/24 as IP address and your network administrator reserved you the additional IP address 192.168.178.200.
238
239
To assing the latter IP address to your `pot` you can create it with the following command:
239
240
```console
240
-
# pot create -p mypot -t single -b 11.2 -N alias -i 192.168.178.200
241
+
# pot create -p mypot -t single -b 11.3 -N alias -i 192.168.178.200
241
242
# pot start mypot
242
243
# pot info -vp mypot
243
244
```
@@ -248,7 +249,7 @@ More information about alias addresses on network interfaces are available in th
248
249
249
250
### Network configuration: public virtual network bridge
250
251
Thanks to `VNET(9)`, `pot` supports an IPv4 virtual network. This network is configured in configuration file (`/usr/local/etc/pot/pot.conf`), so be sure you have it properly configured.
251
-
At the moment, `pot` supports only one big public virtual network, represented by a shared network bridge, so all `pot`s will share it.
252
+
This network type refers to a shared bridge where the public virtual network lives. All `pot`s with this network type will share it. The virtual internal network is connected with the ouside via NAT.
252
253
253
254
To help the `pot` framework and all users to manage the public virtual network, an additional package is required, normally automatically installed as dependency of the package `pot`. It's also manually installable via:
254
255
```console
@@ -279,22 +280,67 @@ This command will create and configure the network interfaces properly and will
279
280
280
281
The following command will create a `pot` running on the internal network:
281
282
```console
282
-
# pot create -p mypot -t single -b 11.2 -N public-bridge -i auto
283
+
# pot create -p mypot -t single -b 11.3 -N public-bridge -i auto
283
284
# pot run mypot
284
285
root@mypot:~ # ping 1.1.1.1
285
286
[..]
286
287
root@mypot:~ # exit
287
288
# pot stop mypot
288
289
```
289
-
The `auto` keyword will automatically select an available address in the internal virtual network.
290
+
The `auto` keyword will automatically select an available address in the internal virtual network and it's the default value, hence the `-i` option can be omitted.
290
291
Commands like `pot info -p mypot` and `potnet show` will show you exactly which address has been assigned to your `pot`
291
292
292
-
If you prefer to assign a specific IP address of your virtual network, you can just do:
293
+
If you prefer to assign a specific IP address of your virtual network to your `pot`, you can just do:
293
294
```console
294
-
# pot create -p mypot -t single -b 11.2 -N public-bridge -i 10.192.0.10
295
+
# pot create -p mypot2 -t single -b 11.3 -N public-bridge -i 10.192.0.10
295
296
```
296
297
`pot` will verify if the IP address is available and free to be used.
297
-
#### Export network services with the internal network
The public virtual network has the downside that all `pot`s share the same bridge, affecting isolation.
301
+
To mitigate this issue, private virtual network has been introduced.
302
+
A private virtual network is just a different bridge, that can be used to connect multiple `pot`s, but it's not automatically shared with all `pot`s.
303
+
304
+
First of all, to use a private virtual network a private bridge has to be created:
305
+
```console
306
+
# pot create-private-bridge -B mybridge -S 4
307
+
```
308
+
This command will create a new private bridge, called `mybridge`, with a network segment big enough to connect 4 `pot`s.
309
+
Using `potnet` it's possible to check the details of the private bridge via the command:
310
+
```console
311
+
# potnet show -b mybridge
312
+
10.192.0.16 mybridge bridge - network
313
+
10.192.0.17 mybridge bridge - gateway
314
+
10.192.0.23 mybridge bridge - broadcast
315
+
```
316
+
The output is from my configuration, however your address' range can differ, depending on the configuration values you have adopted and the network segment available when the bridge is created.
317
+
318
+
To activate a specific bridge, you can use the command:
319
+
```console
320
+
# pot vnet-start -B mybridge
321
+
```
322
+
This command will create and configure the network interfaces properly and will activate `pf` to perform NAT on the virtual network.
323
+
324
+
**NOTE** This command is automatically executed when a `pot` is configured to use the public virtual network. There is no need to run it manually.
325
+
326
+
The following command will create a `pot` running on the private internal network:
327
+
```console
328
+
# pot create -p mypot -t single -b 11.3 -N private-bridge -B mybridge -i auto
329
+
# pot run mypot
330
+
root@mypot:~ # ping 1.1.1.1
331
+
[..]
332
+
root@mypot:~ # exit
333
+
# pot stop mypot
334
+
```
335
+
The `auto` keyword will automatically select an available address in the internal virtual network and it's the default value, hence the `-i` option can be omitted.
336
+
Commands like `pot info -p mypot` and `potnet show -b mybridge` will show you exactly which address has been assigned to your `pot`
337
+
338
+
If you prefer to assign a specific IP address of your virtual network to your `pot`, you can just do:
339
+
```console
340
+
# pot create -p mypot2 -t single -b 11.3 -N private-bridge -B mybridge -i 10.192.0.19
341
+
```
342
+
`pot` will verify if the IP address is available and free to be used.
343
+
### Export network services with the internal network
298
344
The virtual network is not visible outside the host machine, becuase it's based on NAT of the pf's NAT.
299
345
To make your network services running in your `pot` visible outside the TCP/UDP, desired ports have to be exported/redirected.
300
346
`pot` provides a command to tell which port has to be exported.
0 commit comments