分类: VPS

  • 用incus 开 NAT 小鸡

    开小鸡条件

    1、公网ipv4 vps一台做母鸡。注意:不能是NAT(必须)
    2、ipv6(非必须):如果你的母鸡支持ipv6 /64,可以给小小鸡直接分配ipv6
    如果没有,可以注册 he.net 账号,利用 he.net 的ipv6 隧道服务实现小小鸡ipv6 公网的支持

     

    步骤:

    1、通过ssh连接你的vps
    2、DD 重装系统(非必须)系统最好是debian 12, 也可以在主机商后台直接重装为debian12
    我喜欢自己DD,命令如下:
    没有安装wget  curl的可以先安装一下

    apt update && apt install wget curl -y

    国外

    curl -O https://raw.githubusercontent.com/bin456789/reinstall/main/reinstall.sh || wget -O ${_##*/} $_

    国内

    curl -O https://cnb.cool/bin456789/reinstall/-/git/raw/main/reinstall.sh || wget -O ${_##*/} $_

    执行命令

    bash reinstall.sh debian 11  --ssh-port SSH端口 --password 密码

    执行完输入  reboot 重启 等待重装完成

    3、swap(可选)

    curl -L https://raw.githubusercontent.com/spiritLHLS/addswap/main/addswap.sh -o addswap.sh && chmod +x addswap.sh && bash addswap.sh

    默认 选1 一直回车就行
     

    检测环境

    使用后续脚本的务必执行本命令检测宿主机是否符合要求

    bash <(wget -qO- --no-check-certificate https://raw.githubusercontent.com/oneclickvirt/incus/main/scripts/pre_check.sh)

    incus 安装

    curl -L https://raw.githubusercontent.com/oneclickvirt/incus/main/scripts/incus_install.sh -o incus_install.sh && chmod +x incus_install.sh && bash incus_install.sh

     

    自定义批量生成版本

    curl -L https://github.com/oneclickvirt/incus/raw/main/scripts/add_more.sh -o add_more.sh && chmod +x add_more.sh && bash add_more.sh

    按提示生成即可

    开完容器后,具体信息会生成在当前目录下的log文件中 使用 cat log查看已开容器
     
     
    文章来源:https://www.nodeloc.com/t/topic/61325

  • 服务器没有IPv6 却解析IPv6地址 导致无法访问网站

    编辑

    nano /etc/network/interfaces

    粘贴

    iface eth0 inet6 static
        disable-ipv6 yes

    重启后生效

     

    临时:

    sudo sysctl -w net.ipv6.conf.all.disable_ipv6=1
    sudo sysctl -w net.ipv6.conf.default.disable_ipv6=1

    永久生效 编辑/etc/sysctl.conf 添加:

    net.ipv6.conf.all.disable_ipv6 = 1
    net.ipv6.conf.default.disable_ipv6 = 1

     

     

  • VPS常用命令及脚本

    自动同步校正系统时间

    apt install systemd-timesyncd
    timedatectl set-ntp true
    

     

    设置时区为北京时间

    timedatectl set-timezone Asia/Shanghai
    

     

    BBR调参脚本

    wget http://sh.xdmb.xyz/tcp.sh && bash tcp.sh

     

    一个精简的 Linux TCP/IP & BBR 参数智能优化脚本

    bash <(curl -sL https://raw.githubusercontent.com/yahuisme/network-optimization/main/script.sh)

    详情访问: https://github.com/yahuisme/network-optimization

     

    科技lion脚本工具箱

    bash <(curl -sL kejilion.sh)

    详情访问https://kejilion.sh

    一键DD/重装脚本 (One-click reinstall OS on VPS)

    详情访问:https://github.com/bin456789/reinstall

    检测VPS回程国内三网路由

    详情访问:https://github.com/zhucaidan/mtr_trace

    curl https://raw.githubusercontent.com/zhucaidan/mtr_trace/main/mtr_trace.sh|bash

     

    IP质量体检脚本

    详情访问:https://github.com/xykt/IPQuality

    bash <(curl -Ls https://Check.Place) -I

    docker版

    docker run --rm --net=host -it xykt/check -I && docker rmi xykt/check > /dev/null 2>&1
    

     

    网络质量体检脚本

    详情访问:https://github.com/xykt/NetQuality

    bash <(curl -Ls https://Check.Place) -N

    docker版

    docker run --rm --net=host -it xykt/check -N && docker rmi xykt/check > /dev/null 2>&1

     

    融合怪测评项目

    详情访问:https://github.com/oneclickvirt/ecs

    export noninteractive=true && curl -L https://raw.githubusercontent.com/oneclickvirt/ecs/master/goecs.sh -o goecs.sh && chmod +x goecs.sh && bash goecs.sh env && bash goecs.sh install && goecs

    docker版

    docker run --rm spiritlhl/goecs:latest -menu=false -l zh

     

    临时禁用IPv6

    sysctl -w net.ipv6.conf.all.disable_ipv6=1 net.ipv6.conf.default.disable_ipv6=1

     

    其它

    wget -qO- bench.sh | bash
    bash <(curl -sL https://run.NodeQuality.com)

     

    勇哥脚本:https://github.com/yonggekkk?tab=repositories

    其他:https://lot.pm/vps-script-toolbox.html

  • Debain使用ntp同步时间

    apt-get update
    
    apt-get install ntpdate
    
    ntpdate ntp1.aliyun.com

     

  • Debian11 服务器禁用IPv6

    1、编辑/etc/sysctl.conf文件

    sudo nano /etc/sysctl.conf
    

    在文件末尾添加:

    net.ipv6.conf.all.disable_ipv6 = 1
    net.ipv6.conf.default.disable_ipv6 = 1
    

    保存文件后执行:

    sudo sysctl -p
    

    sysctl -p
    

     

  • 宝塔稳定版怎么切换正式版

    curl https://download.bt.cn/install/update_panel.sh|bash

     

  • 宝塔面板自动挂载硬盘

    Centos/Fedora系统:

    yum install wget -y && wget -O auto_disk.sh http://download.bt.cn/tools/auto_disk.sh && bash auto_disk.sh

    Ubuntu系统:

    wget -O auto_disk.sh http://download.bt.cn/tools/auto_disk.sh && sudo bash auto_disk.sh

    Debian系统:

    wget -O auto_disk.sh http://download.bt.cn/tools/auto_disk.sh && bash auto_disk.sh

    这个命令会把磁盘自动挂载到/www目录。

    整个挂载过程是全自动的,没有什么难度,中间会出现让你确认是否将磁盘挂载到/www目录,输入y或者n,直接输入y回车确认即可

  • linux挂载新硬盘

    查看硬盘的使用情况,也就是哪些硬盘没有挂载

    fdisk -l

     

    查看挂载情况

    fdisk -l

     

    首先,使用命名 mkfs.ext4 硬盘名称 进行格式化,本例的命令如下

    mkfs.ext4 /dev/vdb 或 mkfs.ext4 /dev/sdb

     

    然后,创建挂载目录,用来㩐载数据盘,命令如下

    # mkdir /hhd (创建目录的意思)
    # mount /dev/vdb /hhd (将硬盘vdb挂到目录data1下)
    # df -h (查看挂载情况)

     

    系统重启自动挂载硬盘的操作方法

    # echo '/dev/vdb /hhd ext4 defaults 0 0' >> /etc/fstab (自动挂载命令,会出现确认命令,选择y)
    # cat /etc/fstab (查看自动挂载是不是生效了)

    重启系统 reboot
    查看是不是自动挂载了 df -h

     

  • zerotier搭建moon

    安装

    进入zerotier目录

    操作后会生产moon.json文件、修改moon.json(记住配置中的id)

    完成上面步骤后生成验签

    在ZeroTier 目录中建立子文件夹 moons.d 并将上面生成的000000xxxxxxxxxx.moon 复制到该目录

    执行完上面操作后重启zerotier

    其他设备如何加入moon xxxxxxxxxx为上面moon.json中的id

    查看是否加入成功 执行命令后查看尾缀是否是MOON

    查看zerotier运行状态

    卸载

    Debian/Ubuntu如下:

    CentOS卸载命令如下所示:

  • 内网穿透之frp

    github项目地址:https://github.com/fatedier/frp

    服务端:

    下载(根据平台、CPU架构选择对应版本)

    解压

    进目录

    主机作为服务端,可删掉客户端文件

    配置frp

    运行

    客户端:

    下载(根据平台、CPU架构选择对应版本)

    解压

    进目录

    主机作为客户端,可删掉服务端文件

    配置frp

    运行

    frp后台运行

    服务端:

    客户端: