Hax Woiden IPv6 only VPS 开启 TUN 为了安装 WARP

需求

Hax 的 US3 最近放机了,申请成功以后,发现网页控制板上没有开启TUN模式的按钮.

所以需要通过命令行开启TUN模式.


Linux开启TUN的shell命令

(适合复制粘贴到 Xshell 的撰写窗格, 或者 Termius 的 Snippets)
cd /dev 
mkdir net 
mknod net/tun c 10 200 
chmod 0666 net/tun

一行命令的形式 

(适合放到 Xshell 的快速命令栏)

cd /dev && mkdir net && mknod net/tun c 10 200 && chmod 0666 net/tun 

测试

通过下面的命令检测是否打开 TUN

cat /dev/net/tun

如果返回如下,则说明TUN已经打开

cat: /dev/net/tun: File descriptor in bad state


参考

https://blog.csdn.net/Aria_Miazzy/article/details/93637632


操作日志

实测 Hax US3 OpenVZ 可以命令行打开 TUN 模式,安装 Warp

root@5128783602hax:/dev# mkdir net
root@5128783602hax:/dev# mknod net/tun c 10 200
root@5128783602hax:/dev# chmod 0666 net/tun
root@5128783602hax:/dev# cat /dev/net/tun
cat: /dev/net/tun: File descriptor in bad state
root@5128783602hax:~# bash <(curl -fsSL git.io/warp.sh) 4


__        ___    ____  ____    ___           _        _ _          
\ \      / / \  |  _ \|  _ \  |_ _|_ __  ___| |_ __ _| | | ___ _ __
 \ \ /\ / / _ \ | |_) | |_) |  | || '_ \/ __| __/ _` | | |/ _ \ '__|
  \ V  V / ___ \|  _ <|  __/   | || | | \__ \ || (_| | | |  __/ |  
   \_/\_/_/   \_\_| \_\_|     |___|_| |_|___/\__\__,_|_|_|\___|_|  
                                                                   
Copyright (C) P3TERX.COM | https://github.com/P3TERX/warp.sh


System Information
---------------------------------------------------
  Operating System: Debian GNU/Linux 11 (bullseye)
      Linux Kernel: 4.19.0
      Architecture: x86_64
    Virtualization: openvz
---------------------------------------------------

[INFO] Installing wireguard-tools...

Hit:1 http://security.debian.org/debian-security bullseye-security InRelease                                               
Hit:2 http://deb.debian.org/debian bullseye InRelease                                                                      
Hit:3 http://deb.debian.org/debian bullseye-updates InRelease
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
111 packages can be upgraded. Run 'apt list --upgradable' to see them.
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
iproute2 is already the newest version (5.10.0-4).
The following NEW packages will be installed:
  openresolv
0 upgraded, 1 newly installed, 0 to remove and 111 not upgraded.
Need to get 25.4 kB of archives.
After this operation, 105 kB of additional disk space will be used.
Get:1 http://deb.debian.org/debian bullseye/main amd64 openresolv all 3.12.0-1 [25.4 kB]
Fetched 25.4 kB in 1s (35.2 kB/s)                             
Selecting previously unselected package openresolv.
(Reading database ... 28380 files and directories currently installed.)
Preparing to unpack .../openresolv_3.12.0-1_all.deb ...
Unpacking openresolv (3.12.0-1) ...
Setting up openresolv (3.12.0-1) ...
Processing triggers for man-db (2.9.4-2) ...
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Recommended packages:
  wireguard-modules | wireguard-dkms
The following NEW packages will be installed:
  wireguard-tools
0 upgraded, 1 newly installed, 0 to remove and 111 not upgraded.
Need to get 86.2 kB of archives.
After this operation, 327 kB of additional disk space will be used.
Get:1 http://deb.debian.org/debian bullseye/main amd64 wireguard-tools amd64 1.0.20210223-1 [86.2 kB]
Fetched 86.2 kB in 1s (93.6 kB/s)                             
Selecting previously unselected package wireguard-tools.
(Reading database ... 28404 files and directories currently installed.)
Preparing to unpack .../wireguard-tools_1.0.20210223-1_amd64.deb ...
Unpacking wireguard-tools (1.0.20210223-1) ...
Setting up wireguard-tools (1.0.20210223-1) ...
wg-quick.target is a disabled or a static unit, not starting it.
Processing triggers for man-db (2.9.4-2) ...
[INFO] Get CPU architecture ...
[INFO] Architecture: amd64 (dpkg)
[INFO] Get wireguard-go download URL ...
[INFO] Download URL: https://github.com/P3TERX/wireguard-go-builder/releases/download/0.0.20220316/wireguard-go-linux-amd64.tar.gz
[INFO] Installing wireguard-go ...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:--  0:00:04 --:--:--     0
100 2136k  100 2136k    0     0  58396      0  0:00:37  0:00:37 --:--:--  249k
[INFO] Done.
[INFO] WireGuard is disabled.
[INFO] Getting the network interface IPv6 address...
[INFO] IPv6 Address: 2605:8340:0:e:0:1234:3e7:1
[INFO] Get CPU architecture ...
[INFO] Architecture: amd64 (dpkg)
[INFO] Get wgcf download URL ...
[INFO] Download URL: https://github.com/ViRb3/wgcf/releases/download/v2.2.15/wgcf_2.2.15_linux_amd64
[INFO] Installing wgcf ...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:--  0:00:07 --:--:--     0
100 8484k  100 8484k    0     0   308k      0  0:00:27  0:00:27 --:--:-- 1201k
[INFO] Done.
[INFO] Cloudflare WARP Account registration in progress...
2023/02/17 20:23:16 Using config file: wgcf-account.toml
This project is in no way affiliated with Cloudflare
Cloudflare's Terms of Service: https://www.cloudflare.com/application/terms/
Yes
2023/02/17 20:23:20 =======================================
2023/02/17 20:23:20 Device name   : 82CE8D
2023/02/17 20:23:20 Device model  : PC
2023/02/17 20:23:20 Device active : true
2023/02/17 20:23:20 Account type  : free
2023/02/17 20:23:20 Role          : child
2023/02/17 20:23:20 Premium data  : 0.00 B
2023/02/17 20:23:20 Quota         : 0.00 B
2023/02/17 20:23:20 =======================================
2023/02/17 20:23:20 Successfully created Cloudflare Warp account
[INFO] WARP WireGuard profile (wgcf-profile.conf) generation in progress...
2023/02/17 20:23:25 Using config file: wgcf-account.toml
2023/02/17 20:23:26 =======================================
2023/02/17 20:23:26 Device name   : 82CE8D
2023/02/17 20:23:26 Device model  : PC
2023/02/17 20:23:26 Device active : true
2023/02/17 20:23:26 Account type  : free
2023/02/17 20:23:26 Role          : child
2023/02/17 20:23:26 Premium data  : 0.00 B
2023/02/17 20:23:26 Quota         : 0.00 B
2023/02/17 20:23:26 =======================================
2023/02/17 20:23:26 Successfully generated WireGuard profile: wgcf-profile.conf
[INFO] Getting the best MTU value for WireGuard...
[INFO] WireGuard MTU: 1400
[INFO] WireGuard profile (/etc/wireguard/wgcf.conf) generation in progress...
=============================================================================================================================================================================================
# Generated by P3TERX/warp.sh
# Visit https://github.com/P3TERX/warp.sh for more information

[Interface]
PrivateKey = mEyH1rHK6twnUBopAMhEsb4ByDrE4VUQYBOEL7JXZ18=
Address = 172.16.0.2/32,2606:4700:110:888e:f3c8:8ee8:7afe:9df3/128
DNS = 2001:4860:4860::8888,2001:4860:4860::8844,8.8.8.8,8.8.4.4
MTU = 1400

[Peer]
PublicKey = bmXOC+F1FxEMF9dyiK2H5/1SUtzH0JuVo51h2wPfgyo=
AllowedIPs = 0.0.0.0/0
Endpoint = [2606:4700:d0::a29f:c001]:2408
=============================================================================================================================================================================================
[INFO] Starting WireGuard...
Created symlink /etc/systemd/system/multi-user.target.wants/wg-quick@wgcf.service → /lib/systemd/system/wg-quick@.service.
[INFO] WireGuard is running.
[INFO] Status check in progress...

 ----------------------------
 WireGuard  : Running
 IPv4 Network : WARP
 IPv6 Network : Normal
 ----------------------------

[INFO] Done.

评论

The Hot3 in Last 30 Days