| 
									
										
										
										
											2023-07-23 17:26:46 +03:00
										 |  |  | # proxmox-utils (EXPERIMENTAL)
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | A set of scripts for automating setup and tasks in proxmox. | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-01-04 01:47:12 +03:00
										 |  |  | ## TODO
 | 
					
						
							| 
									
										
										
										
											2024-10-22 03:23:43 +03:00
										 |  |  | - CT updates / upgrades   | 
					
						
							| 
									
										
										
										
											2024-10-22 03:22:51 +03:00
										 |  |  |   Right now the simplest way to update the infrastructure CT's if the  | 
					
						
							|  |  |  |   sources changed is to simply rebuild them -- add rebuild command. | 
					
						
							|  |  |  |     - backup | 
					
						
							|  |  |  |     - build (new reserve) | 
					
						
							|  |  |  |     - destroy | 
					
						
							|  |  |  |     - clone | 
					
						
							|  |  |  |     - cleanup | 
					
						
							| 
									
										
										
										
											2024-11-02 23:55:54 +03:00
										 |  |  |   need to automate this... | 
					
						
							| 
									
										
										
										
											2024-10-21 16:15:22 +03:00
										 |  |  | - backup/restore | 
					
						
							| 
									
										
										
										
											2024-10-22 03:22:51 +03:00
										 |  |  | - config manager -- save/use/.. | 
					
						
							|  |  |  | - mail server | 
					
						
							| 
									
										
										
										
											2024-10-21 16:15:22 +03:00
										 |  |  | - which is better? | 
					
						
							|  |  |  |   - Makefile (a-la ./wireguard/templates/root/Makefile) | 
					
						
							|  |  |  |   - shell (a-la ./shadow/templates/root/update-shadowsocks.sh) | 
					
						
							| 
									
										
										
										
											2024-01-11 02:41:00 +03:00
										 |  |  | - separate templates/assets into distribution and user directories | 
					
						
							|  |  |  |   ...this is needed to allow the user to change the configs without the  | 
					
						
							|  |  |  |   fear of them being overwritten by git (similar to how config is handlerd) | 
					
						
							| 
									
										
										
										
											2024-10-21 16:15:22 +03:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | <!-- START doctoc --> | 
					
						
							|  |  |  | <!-- END doctoc --> | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-07-23 17:26:46 +03:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-02-19 22:33:14 +03:00
										 |  |  | ## Motivation
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-02-20 23:11:40 +03:00
										 |  |  | This was simply faster to implement than learning and writing the same  | 
					
						
							|  |  |  | functionality in Ansible. | 
					
						
							| 
									
										
										
										
											2024-02-19 22:33:14 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-02-20 23:11:40 +03:00
										 |  |  | _NOTE: for a fair assessment of viability of further development an  | 
					
						
							|  |  |  | Ansible version will be implemented next as a direct comparison._ | 
					
						
							| 
									
										
										
										
											2024-02-19 22:33:14 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-10-22 02:22:25 +03:00
										 |  |  | Fun. | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-02-19 22:33:14 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-01-14 17:40:13 +03:00
										 |  |  | ## Architecture
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-10-21 14:18:57 +03:00
										 |  |  | ### Goals
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-10-22 02:55:50 +03:00
										 |  |  | - _Separate concerns_   | 
					
						
							| 
									
										
										
										
											2024-02-24 18:21:53 +03:00
										 |  |  |   Preferably one service/role per CT | 
					
						
							| 
									
										
										
										
											2024-10-22 03:39:05 +03:00
										 |  |  | - _Keep things as light as possible_   | 
					
						
							| 
									
										
										
										
											2024-02-24 18:21:53 +03:00
										 |  |  |   This for the most part rules out Docker as a nested virtualization | 
					
						
							| 
									
										
										
										
											2024-10-22 02:55:50 +03:00
										 |  |  |   layer under Proxmox, and preferring light distributions like Alpine | 
					
						
							| 
									
										
										
										
											2024-02-24 18:21:53 +03:00
										 |  |  |   Linux | 
					
						
							| 
									
										
										
										
											2024-10-22 02:55:50 +03:00
										 |  |  | - _Pragmatic simplicity_   | 
					
						
							| 
									
										
										
										
											2024-10-22 15:12:00 +03:00
										 |  |  |   This goal yields some compromises to previous goals, for example  | 
					
						
							|  |  |  |   [TKL](https://www.turnkeylinux.org/) is used as a base for  | 
					
						
							|  |  |  |   [Nextcloud](https://nextcloud.com/) effectively simplifying the setup  | 
					
						
							| 
									
										
										
										
											2024-02-24 18:21:53 +03:00
										 |  |  |   and administration of all the related components at the cost of a  | 
					
						
							| 
									
										
										
										
											2024-10-22 02:55:50 +03:00
										 |  |  |   heavier CT, transparently integrating multiple related services | 
					
						
							| 
									
										
										
										
											2024-02-24 18:21:53 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-10-19 23:18:52 +03:00
										 |  |  | 
 | 
					
						
							|  |  |  | ### Network
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-10-19 23:17:24 +03:00
										 |  |  | ``` | 
					
						
							|  |  |  |     Internet                                              Admin  | 
					
						
							|  |  |  |        v                                                    v | 
					
						
							|  |  |  |   +----|----------------------------------------------------|-----+   | 
					
						
							|  |  |  |   |    |                                                    |     |   | 
					
						
							|  |  |  |   |  (wan)                                (lan)          (admin)  |   | 
					
						
							|  |  |  |   |    |                                    |               |     |   | 
					
						
							|  |  |  |   |    |                                    |         pve --+     |   | 
					
						
							|  |  |  |   |    |                                    |               |     |   | 
					
						
							|  |  |  |   |    |                   +--------------------------------+     |   | 
					
						
							|  |  |  |   |    |                  /                 |               |     |   | 
					
						
							|  |  |  |   |    +--($WAN_SSH_IP)- ssh ---------------+               |     |   | 
					
						
							|  |  |  |   |    |                  ^                 |               |     |   | 
					
						
							| 
									
										
										
										
											2024-10-19 23:20:14 +03:00
										 |  |  |   |    |              (ssh:23)              |               |     |   | 
					
						
							| 
									
										
										
										
											2024-10-19 23:17:24 +03:00
										 |  |  |   |    |                  .                 |               |     |   | 
					
						
							|  |  |  |   |    |                  . +------------------------(nat)--+     |   | 
					
						
							|  |  |  |   |    |                  ./                |               |     |   | 
					
						
							|  |  |  |   |    +------($WAN_IP)- gate ------(nat)---+               |     |   | 
					
						
							|  |  |  |   |                       .                 |               |     |   | 
					
						
							|  |  |  |   |                       .                 +-- ns ---------+     |   | 
					
						
							|  |  |  |   |                       .                 |               |     |   | 
					
						
							| 
									
										
										
										
											2024-10-20 10:30:50 +03:00
										 |  |  |   |                       + - (udp:51820)-> +-- wireguard --+     |   | 
					
						
							|  |  |  |   | System                .                 |               |     |   | 
					
						
							|  |  |  |   | - - - - - - - - - - - . - - - - - - - - | - - - - - - - | - - |   | 
					
						
							|  |  |  |   | Application           .                 +-- syncthing --+     |   | 
					
						
							|  |  |  |   |                       .                 |                     |   | 
					
						
							|  |  |  |   |                       + - - - (https)-> +-- nextcloud         |   | 
					
						
							|  |  |  |   |                       .                 |                     |   | 
					
						
							|  |  |  |   |                       + - (ssh/https)-> +-- gitea             |   | 
					
						
							| 
									
										
										
										
											2024-10-19 23:17:24 +03:00
										 |  |  |   |                                                               |   | 
					
						
							|  |  |  |   +---------------------------------------------------------------+   | 
					
						
							|  |  |  | ``` | 
					
						
							| 
									
										
										
										
											2024-01-14 17:40:13 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-10-21 14:15:05 +03:00
										 |  |  | The system defines two networks: | 
					
						
							| 
									
										
										
										
											2024-10-28 22:54:09 +03:00
										 |  |  | - _LAN_   | 
					
						
							| 
									
										
										
										
											2024-10-21 14:15:05 +03:00
										 |  |  |   Hosts all the service CT's (`*.srv`) | 
					
						
							| 
									
										
										
										
											2024-10-28 22:54:09 +03:00
										 |  |  | - _ADMIN_   | 
					
						
							| 
									
										
										
										
											2024-10-21 14:15:05 +03:00
										 |  |  |   Used for administration (`*.adm`) | 
					
						
							| 
									
										
										
										
											2024-10-19 23:18:52 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-10-21 14:15:05 +03:00
										 |  |  | The ADMIN network is connected to the admin port. | 
					
						
							| 
									
										
										
										
											2024-10-19 23:18:52 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-10-21 14:15:05 +03:00
										 |  |  | Both networks are provided DNS and DHCP services by the `ns` CT. | 
					
						
							| 
									
										
										
										
											2024-01-14 17:40:13 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-10-22 13:37:06 +03:00
										 |  |  | Services on either network are connected to the outside world (WAN) via  | 
					
						
							| 
									
										
										
										
											2024-10-21 14:15:05 +03:00
										 |  |  | a NAT router implemented by the `gate` CT (`iptables`). | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-10-21 14:22:16 +03:00
										 |  |  | The `gate` CT also implements a reverse proxy ([`traefik`](https://traefik.io/traefik/)),  | 
					
						
							|  |  |  | routing requests from the WAN (`$WAN_IP`) to appropriate service CT's on  | 
					
						
							|  |  |  | the LAN. | 
					
						
							| 
									
										
										
										
											2024-10-21 14:15:05 +03:00
										 |  |  | 
 | 
					
						
							|  |  |  | Services expose their administration interfaces only on the ADMIN network | 
					
						
							|  |  |  | when possible. | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | The host Proxmox (`pve.adm`) is only accessible through the ADMIN network. | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | The `gate` and `ns` CT's are only accessible for administration from the  | 
					
						
							|  |  |  | host (i.e. via `lxc-attach ..`). | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | Three ways of access to the ADMIN network are provided: | 
					
						
							| 
									
										
										
										
											2024-10-22 13:37:06 +03:00
										 |  |  | - [`wireguard`](https://www.wireguard.com/) VPN (CT) via `gate` reverse proxy, | 
					
						
							| 
									
										
										
										
											2024-10-22 02:55:50 +03:00
										 |  |  | - `ssh` service (CT) via the `gate` reverse proxy, | 
					
						
							|  |  |  | - `ssh` service (CT) via the direct `$WAN_SSH_IP` (fail-safe). | 
					
						
							| 
									
										
										
										
											2024-01-14 17:40:13 +03:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-10-22 03:08:22 +03:00
										 |  |  | ## Getting started
 | 
					
						
							| 
									
										
										
										
											2024-01-14 17:40:13 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-10-19 23:17:24 +03:00
										 |  |  | ### Prerequisites
 | 
					
						
							| 
									
										
										
										
											2024-01-13 00:04:09 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-10-20 16:40:24 +03:00
										 |  |  | Install Proxmox and connect it to your device/network. | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-10-21 16:02:55 +03:00
										 |  |  | Proxmox will need to have access to the internet to download assets and  | 
					
						
							|  |  |  | updates. | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-10-31 01:22:57 +03:00
										 |  |  | Note that Proxmox repositories must be configured for `apt` to work  | 
					
						
							|  |  |  | correctly, i.e. either _subsctiprion_ or _no-subscribtion_ repos must be  | 
					
						
							|  |  |  | active and working, for more info rfer to:  | 
					
						
							|  |  |  | https://pve.proxmox.com/wiki/Package_Repositories | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-10-21 14:15:05 +03:00
										 |  |  | 
 | 
					
						
							|  |  |  | #### Notes
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-10-20 16:41:16 +03:00
										 |  |  | This setup will use three IP addresses: | 
					
						
							| 
									
										
										
										
											2024-10-21 14:15:05 +03:00
										 |  |  | 1. The static (usually) IP initially assigned to Proxmox on install. This  | 
					
						
							|  |  |  |   will not be used after setup is done, | 
					
						
							|  |  |  | 2. WAN IP address to be used for the main set of applications, this is  | 
					
						
							| 
									
										
										
										
											2024-10-20 16:40:24 +03:00
										 |  |  |   the address that all the requests will be routed from to various  | 
					
						
							| 
									
										
										
										
											2024-10-22 02:55:50 +03:00
										 |  |  |   services on the LAN network, | 
					
						
							| 
									
										
										
										
											2024-10-20 16:45:43 +03:00
										 |  |  | 3. Fail-safe ssh IP address, this is the connection used for recovery  | 
					
						
							|  |  |  |   in case the internal routing fails. | 
					
						
							| 
									
										
										
										
											2024-01-13 00:04:09 +03:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-10-19 20:05:30 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-10-22 03:08:22 +03:00
										 |  |  | ### Setup
 | 
					
						
							| 
									
										
										
										
											2024-10-19 23:17:24 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-10-22 02:55:50 +03:00
										 |  |  | Open a terminal on the host, either `ssh` (recommended) or via the UI. | 
					
						
							| 
									
										
										
										
											2024-10-21 16:34:30 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-10-22 02:55:50 +03:00
										 |  |  | Optionally, set a desired default editor (default: `nano`) via: | 
					
						
							| 
									
										
										
										
											2024-10-21 16:34:30 +03:00
										 |  |  | ```shell | 
					
						
							| 
									
										
										
										
											2024-10-21 16:37:19 +03:00
										 |  |  | export EDITOR=nano | 
					
						
							| 
									
										
										
										
											2024-10-21 16:34:30 +03:00
										 |  |  | ``` | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-10-19 23:17:24 +03:00
										 |  |  | Download the [`bootstrap.sh`](./scripts/bootstrap.sh) script and execute it: | 
					
						
							| 
									
										
										
										
											2024-01-13 00:04:09 +03:00
										 |  |  | ```shell | 
					
						
							| 
									
										
										
										
											2024-10-31 14:17:35 +03:00
										 |  |  | curl -O 'https://raw.githubusercontent.com/flynx/proxmox-utils/refs/heads/master/scripts/bootstrap.sh' && sudo bash bootstrap.sh | 
					
						
							| 
									
										
										
										
											2024-01-13 00:04:09 +03:00
										 |  |  | ``` | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-10-22 02:55:50 +03:00
										 |  |  | _It is recommended to review the script/code before starting._ | 
					
						
							| 
									
										
										
										
											2024-10-19 20:05:30 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-10-22 02:55:50 +03:00
										 |  |  | This will: | 
					
						
							|  |  |  | - Install basic dependencies, | 
					
						
							|  |  |  | - Clone this repo, | 
					
						
							| 
									
										
										
										
											2024-10-22 13:37:06 +03:00
										 |  |  | - Run `make bootstrap` on the repo: | 
					
						
							|  |  |  |   - bootstrap configure the network (2 out of 3 stages) | 
					
						
							|  |  |  |   - build and infrastructure start CT's (`gate`, `ns`, `ssh`, and `wireguard`) | 
					
						
							| 
									
										
										
										
											2024-10-19 20:05:30 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-10-22 02:55:50 +03:00
										 |  |  | At this point WAN interface exposes two IPs: | 
					
						
							| 
									
										
										
										
											2024-10-19 23:20:14 +03:00
										 |  |  | - Main server (config: `$DFL_WAN_IP` / `$WAN_IP`) | 
					
						
							| 
									
										
										
										
											2024-10-19 20:05:30 +03:00
										 |  |  |   - ssh:23 | 
					
						
							|  |  |  |   - wireguard:51820 | 
					
						
							| 
									
										
										
										
											2024-10-19 23:20:14 +03:00
										 |  |  | - Fail-safe ssh (config: `$DFL_WAN_SSH_IP` / `$WAN_SSH_IP`) | 
					
						
							| 
									
										
										
										
											2024-10-19 20:05:30 +03:00
										 |  |  |   - ssh:22 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-10-22 13:37:06 +03:00
										 |  |  | The Proxmox administrative interface is available behind the  | 
					
						
							| 
									
										
										
										
											2024-11-01 15:19:56 +03:00
										 |  |  | [Wireguard](https://www.wireguard.com/) proxy on the WAN port or directly  | 
					
						
							|  |  |  | on the ADMIN port, both on https://10.0.0.254:8006. | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | At this point, it is recommended to check both the fail-safe `ssh`  | 
					
						
							|  |  |  | connection now and the Wireguard access. | 
					
						
							| 
									
										
										
										
											2024-10-22 13:37:06 +03:00
										 |  |  | 
 | 
					
						
							|  |  |  | Additional administrative tasks can be performed now if needed. | 
					
						
							| 
									
										
										
										
											2024-10-19 20:05:30 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-10-19 22:16:22 +03:00
										 |  |  | To finalize the setup run: | 
					
						
							|  |  |  | ```shell | 
					
						
							|  |  |  | make finalize | 
					
						
							|  |  |  | ``` | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | This will | 
					
						
							| 
									
										
										
										
											2024-10-21 21:13:44 +03:00
										 |  |  | - Setup firewall rules.   | 
					
						
							| 
									
										
										
										
											2024-10-19 22:16:22 +03:00
										 |  |  |   Note that the firewall will not be enabled, this should be done manually | 
					
						
							|  |  |  |   after rule review. | 
					
						
							| 
									
										
										
										
											2024-10-21 21:13:44 +03:00
										 |  |  | - Detach the host from any external ports and make it accessible only  | 
					
						
							|  |  |  |   from the internal network.   | 
					
						
							|  |  |  |   See: [Architecture](#architecture) and [Bootstrapping](#bootstrapping) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | This will break the ssh connection when done, reconnect via the WAN port  | 
					
						
							|  |  |  | to continue (see: [Accessing the host](#accessing-the-host)), or connect  | 
					
						
							|  |  |  | directly to the ADMIN port (DHCP) and ssh into `$HOST_ADMIN_IP` (default: 10.0.0.254). | 
					
						
							| 
									
										
										
										
											2024-10-19 22:16:22 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-10-22 02:55:50 +03:00
										 |  |  | _Note that the ADMIN port is configured for direct connections only,  | 
					
						
							|  |  |  | connecting it to a configured network can lead to unexpected behavior --  | 
					
						
							|  |  |  | DHCP races, IP clashes... etc._ | 
					
						
							| 
									
										
										
										
											2024-10-19 23:17:24 +03:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-10-21 15:58:03 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-10-19 23:17:24 +03:00
										 |  |  | #### Accessing the host
 | 
					
						
							| 
									
										
										
										
											2024-10-19 22:16:22 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-10-21 15:58:03 +03:00
										 |  |  | The simplest way is to connect to `wireguard` VPN and open http://pve.adm:8006  | 
					
						
							| 
									
										
										
										
											2024-10-21 16:30:35 +03:00
										 |  |  | in a browser (a profile was created during the setup process and stored  | 
					
						
							|  |  |  | in the `/root/clients/` directory on the `wireguard` CT). | 
					
						
							| 
									
										
										
										
											2024-10-21 15:58:03 +03:00
										 |  |  | 
 | 
					
						
							|  |  |  | The second approach is to `ssh` to either: | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | ```shell | 
					
						
							|  |  |  | ssh -p 23 <user>@<WAN_IP> | 
					
						
							|  |  |  | ``` | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | or: | 
					
						
							|  |  |  | ```shell | 
					
						
							|  |  |  | ssh <user>@<WAN_SSH_IP> | 
					
						
							|  |  |  | ``` | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | The later will also work if the `gate` CT is down or not accessible. | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | And from the `ssh` CT: | 
					
						
							|  |  |  | ```shell | 
					
						
							|  |  |  | ssh root@pve | 
					
						
							|  |  |  | ``` | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | _WARNING: NEVER store any ssh keys on the `ssh` CT, use `ssh-agent` instead!_ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #### Configuration
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-10-19 22:16:22 +03:00
										 |  |  | XXX | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-10-21 15:58:03 +03:00
										 |  |  | The following CT's interfaces can not be configured in the Proxmox UI: | 
					
						
							|  |  |  | - `gate` | 
					
						
							|  |  |  | - `ns` | 
					
						
							|  |  |  | - `nextcloud` | 
					
						
							|  |  |  | - `wireguard` | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | This is done mostly to keep Proxmox from touching the `hostname $(hostname)` | 
					
						
							|  |  |  | directive (used by the DNS server to assigned predefined IP's) and in  | 
					
						
							|  |  |  | the case of `gate` and `wireguard` to keep it from touching the additional  | 
					
						
							|  |  |  | bridges or interfaces defined.   | 
					
						
							|  |  |  | (XXX this restriction may be lifted in the future) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-10-19 22:16:22 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-10-22 03:08:22 +03:00
										 |  |  | ## Services
 | 
					
						
							| 
									
										
										
										
											2024-10-19 22:16:22 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-10-22 13:37:06 +03:00
										 |  |  | Install all user services: | 
					
						
							| 
									
										
										
										
											2024-10-19 22:16:22 +03:00
										 |  |  | ```shell | 
					
						
							|  |  |  | make all | 
					
						
							|  |  |  | ``` | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-10-22 13:37:06 +03:00
										 |  |  | Includes: | 
					
						
							|  |  |  | - [`syncthing`](#syncthing) | 
					
						
							|  |  |  | - [`nextcloud`](#nextcloud) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | Install development services: | 
					
						
							| 
									
										
										
										
											2024-10-19 22:16:22 +03:00
										 |  |  | ```shell | 
					
						
							|  |  |  | make dev | 
					
						
							|  |  |  | ``` | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-10-22 13:37:06 +03:00
										 |  |  | Includes: | 
					
						
							|  |  |  | - [`gitea`](#gitea) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-10-19 22:16:22 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-10-22 03:08:22 +03:00
										 |  |  | ### Syncthing
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-10-19 22:16:22 +03:00
										 |  |  | ```shell | 
					
						
							| 
									
										
										
										
											2024-10-22 03:08:22 +03:00
										 |  |  | make syncthing | 
					
						
							| 
									
										
										
										
											2024-10-19 22:16:22 +03:00
										 |  |  | ``` | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-10-22 15:12:00 +03:00
										 |  |  | Syncthing administration interface is accessible via https://syncthing.adm/  | 
					
						
							|  |  |  | on the ADMIN network, it is recommended to set an admin password on  | 
					
						
							|  |  |  | the web interface as soon as possible. | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | No additional routing or network configuration is required, Syncthing is | 
					
						
							|  |  |  | smart enough to handle its own connections itself. | 
					
						
							| 
									
										
										
										
											2024-10-22 03:08:22 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-10-22 13:37:06 +03:00
										 |  |  | For more info see: https://syncthing.net/ | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-10-22 03:08:22 +03:00
										 |  |  | 
 | 
					
						
							|  |  |  | ### Nextcloud
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-10-19 22:16:22 +03:00
										 |  |  | ```shell | 
					
						
							| 
									
										
										
										
											2024-10-22 03:08:22 +03:00
										 |  |  | make nextcloud | 
					
						
							| 
									
										
										
										
											2024-10-19 22:16:22 +03:00
										 |  |  | ``` | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-10-22 15:12:00 +03:00
										 |  |  | Nextcloud will get mapped to subdomain `$NEXTCLOUD_SUBDOMAIN` of  | 
					
						
							|  |  |  | `$NEXTCLOUD_DOMAIN` (defaulting to `$DOMAIN`, if not defined). | 
					
						
							| 
									
										
										
										
											2024-10-22 03:08:22 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-10-22 15:17:19 +03:00
										 |  |  | For basic configuration edit the generated: [config.global](./config.global)  | 
					
						
							|  |  |  | and for defaults: [config.global.example](./config.global.example). | 
					
						
							| 
									
										
										
										
											2024-10-22 15:12:00 +03:00
										 |  |  | 
 | 
					
						
							|  |  |  | For deeper management use the [TKL](https://www.turnkeylinux.org/) consoles  | 
					
						
							|  |  |  | (via https://nextcloud.srv, on the LAN network) and `ssh`, for more details  | 
					
						
							|  |  |  | see: https://www.turnkeylinux.org/nextcloud | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | For more info on Nextcloud see: https://nextcloud.com/ | 
					
						
							| 
									
										
										
										
											2024-10-22 13:37:06 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-10-22 03:08:22 +03:00
										 |  |  | 
 | 
					
						
							|  |  |  | ### Gitea
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-10-19 22:16:22 +03:00
										 |  |  | ```shell | 
					
						
							|  |  |  | make gitea | 
					
						
							|  |  |  | ``` | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-10-22 15:12:00 +03:00
										 |  |  | Gitea is mapped to the subdomain `$GITEA_SUBDOMAIN` of `$GITEA_DOMAIN`  | 
					
						
							|  |  |  | or `$DOMAIN` if the former is not defined. | 
					
						
							| 
									
										
										
										
											2024-10-22 03:08:22 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-10-22 15:15:13 +03:00
										 |  |  | For basic configuration edit the generated: [config.global](./config.global)  | 
					
						
							|  |  |  | and for defaults: [config.global.example](./config.global.example). | 
					
						
							| 
									
										
										
										
											2024-10-22 03:08:22 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-10-22 15:12:00 +03:00
										 |  |  | For more info see: https://gitea.com/ | 
					
						
							| 
									
										
										
										
											2024-10-22 13:37:06 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-10-19 20:05:30 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-10-22 03:08:22 +03:00
										 |  |  | ### Custom services
 | 
					
						
							| 
									
										
										
										
											2024-10-19 20:05:30 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-10-19 22:16:22 +03:00
										 |  |  | XXX traefik rules | 
					
						
							| 
									
										
										
										
											2024-10-19 20:05:30 +03:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-10-21 15:58:03 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-10-22 03:03:15 +03:00
										 |  |  | <!--
 | 
					
						
							| 
									
										
										
										
											2024-10-19 23:17:24 +03:00
										 |  |  | ### Manual setup
 | 
					
						
							| 
									
										
										
										
											2024-10-19 20:05:30 +03:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-10-19 23:17:24 +03:00
										 |  |  | #### Bootstrapping
 | 
					
						
							| 
									
										
										
										
											2024-10-19 20:05:30 +03:00
										 |  |  | 
 | 
					
						
							|  |  |  | Since all the internal traffic is routed through the `gate` we need both  | 
					
						
							|  |  |  | the bridges and it setup for things to work, thus we first bootstrap the | 
					
						
							|  |  |  | bridges, create the basic infrastructure and then finalize the setup. | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | Bootsrapping is done in three stages: | 
					
						
							|  |  |  | 1. Bootstrap:  | 
					
						
							|  |  |  |   ```shell | 
					
						
							|  |  |  |   make bootstrap | 
					
						
							|  |  |  |   ``` | 
					
						
							|  |  |  |   - Create the needed bridges | 
					
						
							|  |  |  |   - Create the infrastructure CT's (`gate`, `ns`, `ssh`, ...) | 
					
						
							|  |  |  | 2. Cleanup:  | 
					
						
							|  |  |  |   ```shell | 
					
						
							|  |  |  |   make bootstrap-clean | 
					
						
							|  |  |  |   ``` | 
					
						
							|  |  |  |   - Route the `host` through the `gate` | 
					
						
							|  |  |  | 3. Finalize:  | 
					
						
							|  |  |  |   ```shell | 
					
						
							|  |  |  |   make finalise | 
					
						
							|  |  |  |   ``` | 
					
						
							|  |  |  |   - disconnect the `host` from the non-ADMIN networks | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | After the final stage two physical ports will be active, the ADMIN port  | 
					
						
							|  |  |  | and the WAN port, the former is by default the same port set by Proxmox  | 
					
						
							|  |  |  | setup, the WAN port is the port selected during the stup stage. All the  | 
					
						
							|  |  |  | services will be listening on the WAN port while the admin port is used  | 
					
						
							|  |  |  | only for administration and recovory cases. | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-01-13 00:04:09 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-10-19 23:17:24 +03:00
										 |  |  | #### Network Bridges
 | 
					
						
							| 
									
										
										
										
											2024-01-13 00:04:09 +03:00
										 |  |  | 
 | 
					
						
							|  |  |  | `proxmox-utils` expects there to be at least three bridges: | 
					
						
							| 
									
										
										
										
											2024-10-19 20:05:30 +03:00
										 |  |  | - `WAN` (`vmbr_wan`) - connected to the port that faces the external  | 
					
						
							|  |  |  |   network (either directly of via a router) | 
					
						
							|  |  |  | - `LAN` (`vmbr_lan`) - a virtual bridge, not connected to any physical  | 
					
						
							|  |  |  |   interfaces | 
					
						
							|  |  |  | - `ADMIN` (`vmbr_admin`) - connected to a second physical interface used  | 
					
						
							|  |  |  |   for administrative purposes. | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | Created via: | 
					
						
							|  |  |  | ```shell | 
					
						
							|  |  |  | make host-bootstrap | 
					
						
							|  |  |  | ``` | 
					
						
							| 
									
										
										
										
											2024-01-13 00:04:09 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-10-19 20:05:30 +03:00
										 |  |  | Updated by: | 
					
						
							|  |  |  | ```shell | 
					
						
							|  |  |  | make host-bootstrap-clean | 
					
						
							|  |  |  | ``` | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | and: | 
					
						
							|  |  |  | ```shell | 
					
						
							|  |  |  | make finalize | 
					
						
							|  |  |  | ``` | 
					
						
							| 
									
										
										
										
											2024-01-13 00:04:09 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-10-19 20:05:30 +03:00
										 |  |  | If the device has more that two ports it is recommended to assign  | 
					
						
							| 
									
										
										
										
											2024-01-17 15:12:04 +03:00
										 |  |  | first/last ports to wan/admin respectively and clearly mark them as such. | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-01-13 00:04:09 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-10-19 20:05:30 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-10-19 23:17:24 +03:00
										 |  |  | #### DNS
 | 
					
						
							| 
									
										
										
										
											2024-01-13 00:04:09 +03:00
										 |  |  | 
 | 
					
						
							|  |  |  | Add `10.1.1.1` to the DNS on the Proxmox host node after the `127.0.0.1` | 
					
						
							|  |  |  | but before whatever external DNS you are using. | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-10-19 20:05:30 +03:00
										 |  |  | Donw via: | 
					
						
							|  |  |  | ```shell | 
					
						
							|  |  |  | make host | 
					
						
							|  |  |  | ``` | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | or: | 
					
						
							|  |  |  | ```shell | 
					
						
							|  |  |  | make host-bootstrap | 
					
						
							|  |  |  | ``` | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-01-13 00:04:09 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-10-19 23:17:24 +03:00
										 |  |  | #### Firewall
 | 
					
						
							| 
									
										
										
										
											2024-01-14 17:40:13 +03:00
										 |  |  | 
 | 
					
						
							|  |  |  | Make sure to allow at least `ssh` access to the host node from the `ADMIN`  | 
					
						
							|  |  |  | interface to allow admin CT's access to the host if needed, this is mostly | 
					
						
							|  |  |  | needed to allow VPN/ssh administration from outside. | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-10-19 20:05:30 +03:00
										 |  |  | Donw via: | 
					
						
							|  |  |  | ```shell | 
					
						
							|  |  |  | make host | 
					
						
							|  |  |  | ``` | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | or: | 
					
						
							|  |  |  | ```shell | 
					
						
							|  |  |  | make host-bootstrap | 
					
						
							|  |  |  | ``` | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-01-14 17:40:13 +03:00
										 |  |  | For Proxmox firewall configuration see: | 
					
						
							|  |  |  | https://pve.proxmox.com/wiki/Firewall | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-01-17 15:12:04 +03:00
										 |  |  | ### Recovery strategies
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-02-20 23:11:40 +03:00
										 |  |  | XXX ns/gate are separate nodes for redundancy | 
					
						
							| 
									
										
										
										
											2024-01-17 15:12:04 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-02-20 23:11:40 +03:00
										 |  |  | XXX ssh facing lan to avoid a single point of failure with gate | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-02-21 23:55:56 +03:00
										 |  |  | XXX emergency access points: ssh and wireguard | 
					
						
							| 
									
										
										
										
											2024-01-17 15:12:04 +03:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-10-19 20:05:30 +03:00
										 |  |  | ## Misc
 | 
					
						
							| 
									
										
										
										
											2024-02-07 08:55:16 +03:00
										 |  |  | 
 | 
					
						
							|  |  |  | Install CT's: | 
					
						
							| 
									
										
										
										
											2024-01-13 00:04:09 +03:00
										 |  |  | ```shell | 
					
						
							|  |  |  | sudo make all | 
					
						
							|  |  |  | ``` | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-02-08 15:31:22 +03:00
										 |  |  | Install gitea (optional): | 
					
						
							|  |  |  | ```shell | 
					
						
							|  |  |  | sudo make dev | 
					
						
							|  |  |  | ``` | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-01-20 19:00:22 +03:00
										 |  |  | ## Post-setup
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | XXX test conections | 
					
						
							|  |  |  | XXX change proxmox ip/network | 
					
						
							| 
									
										
										
										
											2024-02-11 23:42:21 +03:00
										 |  |  | XXX firewall | 
					
						
							| 
									
										
										
										
											2024-10-22 03:03:15 +03:00
										 |  |  | --> | 
					
						
							| 
									
										
										
										
											2024-01-20 19:00:22 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-01-13 00:04:09 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-02-15 22:43:34 +03:00
										 |  |  | ## Extending
 | 
					
						
							| 
									
										
										
										
											2023-07-23 17:26:46 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-02-15 22:43:34 +03:00
										 |  |  | ### Directory structure
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | ``` | 
					
						
							| 
									
										
										
										
											2024-10-22 03:11:26 +03:00
										 |  |  | proxmox-utils/ | 
					
						
							| 
									
										
										
										
											2024-02-15 22:43:34 +03:00
										 |  |  | +- <ct-type>/ | 
					
						
							|  |  |  | |   +- templates/ | 
					
						
							| 
									
										
										
										
											2024-10-22 03:11:26 +03:00
										 |  |  | |   |   +- ... | 
					
						
							| 
									
										
										
										
											2024-02-15 22:43:34 +03:00
										 |  |  | |   +- assets/ | 
					
						
							| 
									
										
										
										
											2024-10-22 03:11:26 +03:00
										 |  |  | |   |   +- ... | 
					
						
							| 
									
										
										
										
											2024-02-15 22:43:34 +03:00
										 |  |  | |   +- staging/ | 
					
						
							| 
									
										
										
										
											2024-10-22 03:11:26 +03:00
										 |  |  | |   |   +- ... | 
					
						
							| 
									
										
										
										
											2024-02-15 22:43:34 +03:00
										 |  |  | |   +- make.sh | 
					
						
							|  |  |  | |   +- config | 
					
						
							|  |  |  | |   +- config.last-run | 
					
						
							|  |  |  | +- ... | 
					
						
							|  |  |  | +- Makefile | 
					
						
							|  |  |  | +- config.global | 
					
						
							|  |  |  | +- config.global.example | 
					
						
							|  |  |  | ``` | 
					
						
							| 
									
										
										
										
											2024-11-01 15:23:10 +03:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | ## Recovery and Troubleshooting
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | - Configuration or bridge failure while bootstrapping | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   Remove all the CT's that were created by make: | 
					
						
							|  |  |  |   ```shell | 
					
						
							|  |  |  |   pct destroy ID | 
					
						
							|  |  |  |   ``` | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   Cleanup the interfaces: | 
					
						
							|  |  |  |   ```shell | 
					
						
							|  |  |  |   make clean-interfaces | 
					
						
							|  |  |  |   ``` | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   Revise configuration if `./config.global` | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   Cleanup CT cached configuration: | 
					
						
							|  |  |  |   ```shell | 
					
						
							|  |  |  |   make clean | 
					
						
							|  |  |  |   ``` | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   Rebuild the bridges: | 
					
						
							|  |  |  |   ```shell | 
					
						
							|  |  |  |   make host-bootstrap | 
					
						
							|  |  |  |   ``` | 
					
						
							|  |  |  |   And select (type "y") "Create bridges" while rejecting all other sections. | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   Or, do a full rebuild selecting/rejecting the appropriate sections: | 
					
						
							|  |  |  |   ```shell | 
					
						
							|  |  |  |   make bootstrap | 
					
						
							|  |  |  |   ``` | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | - Failure while creating the `gate` CT | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   Check if the bridges are correct, and check if the host as internet access. | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   Remove the `gate` CT (replacing 110 if you created it with a different ID): | 
					
						
							|  |  |  |   ```shell | 
					
						
							|  |  |  |   pct destroy 110 | 
					
						
							|  |  |  |   ``` | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   Build the bootstrapped gate: | 
					
						
							|  |  |  |   ```shell | 
					
						
							|  |  |  |   make gate-bootstrap | 
					
						
							|  |  |  |   ``` | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   Check if gate is accesable and if it has internet access. | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   Then create the base CT's: | 
					
						
							|  |  |  |   ```shell | 
					
						
							|  |  |  |   make ns ssh wireguard | 
					
						
							|  |  |  |   ``` | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   finally cleanup: | 
					
						
							|  |  |  |   ```shell | 
					
						
							|  |  |  |   make bootstrap-clean | 
					
						
							|  |  |  |   ``` | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   now the setup can be finalized (see: [Setup](#setup)) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | - Failure while creating other CT's | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   Check if gate is accesable and if it has internet access, if it is not | 
					
						
							|  |  |  |   then this will fail, check or rebuild the gate. | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   Simply remove the CT | 
					
						
							|  |  |  |   ```shell | 
					
						
							|  |  |  |   pct destroy ID | 
					
						
							|  |  |  |   ``` | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   Then rebuild it: | 
					
						
							|  |  |  |   ```shell | 
					
						
							|  |  |  |   make CT_NAME | 
					
						
							|  |  |  |   ``` | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | - Full clean rebuild | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   Remove any of the base CT's: | 
					
						
							|  |  |  |   ```shell | 
					
						
							|  |  |  |   pct destroy ID | 
					
						
							|  |  |  |   ``` | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   Restore bridge configuration: | 
					
						
							|  |  |  |   ```shell | 
					
						
							|  |  |  |   make clean-interfaces | 
					
						
							|  |  |  |   ``` | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   Cleanup the configuration data: | 
					
						
							|  |  |  |   ```shell | 
					
						
							|  |  |  |   make clean-all | 
					
						
							|  |  |  |   ``` | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   Follow the instructions in [Setup](#setup) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 |