This commit is contained in:
spiritlhl
2023-08-27 08:41:28 +00:00
parent d830018c9e
commit d8654356e4
2 changed files with 45 additions and 13 deletions

View File

@@ -6,26 +6,38 @@ The following is an introduction to the non-customized sections. Please ensure t
If the host has an IPV6 network, the installation will change the network structure of the host, please make sure that the host can reset the system at any time and that there is no important data on the host before running.
:::
## Project Highlights
## Project Features
Bulk or individual NAT server provisioning via docker
Default use of debian system optional alpine system, each container comes with 1 external ssh port, 25 internal and external network consistent ports
Default use of debian system optional alpine system, each container comes with 1 external ssh port, 25 internal and external network ports, you can choose whether to bind IPV6 address
The default creation of unprivileged containers, and does not mount and host docker daemon communication, so ** host created docker virtualization NAT server can not be nested within the virtualization of docker **
The default creation of unprivileged containers, and does not mount and host docker daemon communication, so ** host created docker virtualization NAT servers can not be nested within the virtualization docker **
Since the CPU and memory limits are only applied to the host and the cgroup driver is not used in the container, using the server test script to detect the available resources of the container will not be effective, and the resources displayed will be those of the host.
Since most cloud servers have ext4 filesystems, even xfs filesystems do not enable the pquota option, so **sharing the host's hard disk by default does not limit the disk size of each container**.
## Configuration Requirements
## Configuration requirements
The system should have Docker installed to be operational. As long as the network can connect to GitHub's raw interface, it can be used. Hardware configuration requirements are minimal, as long as they are adequate; a spare 3GB of hard disk space is sufficient.
The system can be installed docker can be used, the network can connect to the Github raw interface can be used, hardware configuration as long as not pull across the line, free hard disk has 3G on it!
It is recommended to increase the available SWAP virtual memory prior to provisioning NAT servers to prevent potential host performance issues due to sudden memory spikes. [Link](https://github.com/spiritLHLS/addswap)
(If you need to bind an IPV6 address, then please make sure to use the installation script of this set of scripts for docker installation, you need it to automatically preset some of the settings)
PS: If hardware resources are somewhat limited and more restrictions are necessary, including configuration of individual IPv6 addresses and disk size limitations, consider utilizing LXD to create batch LXC virtualized containers. [Link](https://github.com/spiritLHLS/lxd)
If the hardware resources are just a little bit better, need to limit more things and need to limit the size of the hard disk, you can use the LXD partition of the script batch open LXC virtualization containers
PS: If hardware resources are abundant and ample, consider using Proxmox Virtual Environment (PVE) to provision batch KVM virtualized machines. [Link](https://github.com/spiritLHLS/pve)
If the hardware is very good and you have a lot of resources, you can use the PVE partition script to batch open KVM virtualized VMs.
Please note that the original formatting has been preserved and enclosed within ``` and ``` for your convenience during copying. No character escaping has been applied.
## Setting up virtual memory (SWAP)
It is recommended to increase part of the SWAP virtual memory before setting up a NAT server, to avoid sudden memory occupation that may cause the hen to crash.
Unit conversion: Enter 1024 to generate 1G SWAP-virtual memory, virtual memory takes up hard disk space, when the actual memory is not enough to use the virtual memory will automatically use the virtual memory for memory use, but this will bring about high IO usage and CPU performance usage.
It is recommended to use only twice the size of the actual memory as virtual memory.
Command:
```shell
curl -L https://raw.githubusercontent.com/spiritLHLS/addswap/main/addswap.sh -o addswap.sh && chmod +x addswap.sh && bash addswap.sh
```

View File

@@ -14,7 +14,7 @@ outline: deep
通过docker批量或单独开设NAT服务器(Bulk or individual NAT server provisioning via docker)
默认使用debian系统可选alpine系统每个容器自带1个外网ssh端口25个内外网一致端口
默认使用debian系统可选alpine系统每个容器自带1个外网ssh端口25个内外网一致端口可选择是否绑定IPV6地址
默认创建的是非特权容器且不挂载与宿主机的docker的守护进程之间的通信所以**宿主机创建的docker虚拟化的NAT服务器内无法再嵌套虚拟化docker**
@@ -26,8 +26,28 @@ outline: deep
系统可安装docker即可用网络能连接Github的raw界面就能用硬件配置只要不拉跨就行空闲硬盘有3G就行
推荐在开设NAT服务器前先增加部分SWAP虚拟内存避免突发的内存占用导致母鸡卡死 [跳转](https://github.com/spiritLHLS/addswap)
(如果需要绑定IPV6地址那么请保证使用本套脚本的安装脚本进行docker安装需要它自动预设部分设置)
PS: 如果硬件资源只是好了一点,需要限制更多东西并需要配置IPV6独立地址和限制硬盘大小可使用LXD批量开LXC虚拟化的容器 [跳转](https://github.com/spiritLHLS/lxd)
如果硬件资源只是好了一点需要限制更多东西并需要限制硬盘大小可使用LXD分区的脚本批量开LXC虚拟化的容器
PS: 如果硬件非常好资源很多可使用PVE批量开KVM虚拟化的虚拟机 [跳转](https://github.com/spiritLHLS/pve)
如果硬件非常好资源很多可使用PVE分区的脚本批量开KVM虚拟化的虚拟机
## 开设虚拟内存(SWAP)
推荐在开设NAT服务器前先增加部分SWAP虚拟内存避免突发的内存占用导致母鸡卡死
单位换算:输入 1024 产生 1G SWAP-虚拟内存虚拟内存占用硬盘空间当实际内存不够用时将自动使用虚拟内存做内存使用但随之带来IO高占用以及CPU性能占用
建议只开实际内存大小两倍大小的虚拟内存
国际
```shell
curl -L https://raw.githubusercontent.com/spiritLHLS/addswap/main/addswap.sh -o addswap.sh && chmod +x addswap.sh && bash addswap.sh
```
国内
```shell
curl -L https://ghproxy.com/https://raw.githubusercontent.com/spiritLHLS/addswap/main/addswap.sh -o addswap.sh && chmod +x addswap.sh && bash addswap.sh
```