好物优选点击查看详情 京东购买

暂无内容

如何在PVE(Proxmox)中安装OpenWrt软路由?

## PVE安装OpenWrt教程

https://zy.itwk.cc/archives/1763.html

### 工具准备

– WinSCP或者XFTP

– OpenWrt镜像(自行寻找)

– 安装好PVE的主机一台

### 安装教程

#### 镜像上传

> 将下载好的OpenWrt `img`镜像上传到 PVE主机中(这里使用XFTP工具)

![ebc30f0a165ab3ca.png](https://img-cdn.itwk.cc/LightPicture/2022/12/ebc30f0a165ab3ca.png)

> 选择SFTP 点击确定,选择刚刚添加的主机。点击连接

![ca4bbc55511f62ea.png](https://img-cdn.itwk.cc/LightPicture/2022/12/ca4bbc55511f62ea.png)

![826b2938d32e0391.png](https://img-cdn.itwk.cc/LightPicture/2022/12/826b2938d32e0391.png)

![449cafa875f38b26.png](https://img-cdn.itwk.cc/LightPicture/2022/12/449cafa875f38b26.png)

> 输入用户名及密码。登录后将img镜像拖拽到PVE主机中即可

![d2bf90d5d245d6df.png](https://img-cdn.itwk.cc/LightPicture/2022/12/d2bf90d5d245d6df.png)

#### 创建虚拟机

> 以下教程中没有提到的地方自行配置即可,CPU MEM按需分配!

![e7a974665b942ffc.png](https://img-cdn.itwk.cc/LightPicture/2022/12/e7a974665b942ffc.png)

![1c467a0344166e85.png](https://img-cdn.itwk.cc/LightPicture/2022/12/1c467a0344166e85.png)

![00c70d0e76f16633.png](https://img-cdn.itwk.cc/LightPicture/2022/12/00c70d0e76f16633.png)

#### 将镜像导入到OpenWrt虚拟机

> 打开PVE中的Shell控制台,如下图

![00c70d0e76f16633.png](https://img-cdn.itwk.cc/LightPicture/2022/12/00c70d0e76f16633.png)

> 执行如下命令 将bleach-xxx.img镜像附加到id为`999`的这台虚拟机上,就是OpenWrt的虚拟机 存储位置为`local`

“`bash

root@Home:~# qm importdisk 999 bleach-mini-20221231-openwrt-x86-64-generic-squashfs-combined-efi.img local

importing disk 'bleach-mini-20221231-openwrt-x86-64-generic-squashfs-combined-efi.img' to VM 999 …

Formatting '/var/lib/vz/images/999/vm-999-disk-0.raw', fmt=raw size=1090813440 preallocation=off

transferred 0.0 B of 1.0 GiB (0.00%)

transferred 12.0 MiB of 1.0 GiB (1.15%)

transferred 24.0 MiB of 1.0 GiB (2.31%)

transferred 36.0 MiB of 1.0 GiB (3.46%)

transferred 48.0 MiB of 1.0 GiB (4.61%)

transferred 60.0 MiB of 1.0 GiB (5.77%)

transferred 72.0 MiB of 1.0 GiB (6.92%)

transferred 84.0 MiB of 1.0 GiB (8.07%)

transferred 96.0 MiB of 1.0 GiB (9.23%)

transferred 108.0 MiB of 1.0 GiB (10.38%)

transferred 120.0 MiB of 1.0 GiB (11.54%)

transferred 132.0 MiB of 1.0 GiB (12.69%)

transferred 144.0 MiB of 1.0 GiB (13.84%)

transferred 156.0 MiB of 1.0 GiB (15.00%)

transferred 168.0 MiB of 1.0 GiB (16.15%)

transferred 180.0 MiB of 1.0 GiB (17.30%)

transferred 192.0 MiB of 1.0 GiB (18.46%)

transferred 204.0 MiB of 1.0 GiB (19.61%)

transferred 216.0 MiB of 1.0 GiB (20.76%)

transferred 228.0 MiB of 1.0 GiB (21.92%)

transferred 240.0 MiB of 1.0 GiB (23.07%)

transferred 252.0 MiB of 1.0 GiB (24.22%)

transferred 264.0 MiB of 1.0 GiB (25.38%)

transferred 276.0 MiB of 1.0 GiB (26.53%)

transferred 287.9 MiB of 1.0 GiB (27.68%)

transferred 300.0 MiB of 1.0 GiB (28.84%)

transferred 312.0 MiB of 1.0 GiB (29.99%)

transferred 324.0 MiB of 1.0 GiB (31.15%)

transferred 336.0 MiB of 1.0 GiB (32.30%)

transferred 348.0 MiB of 1.0 GiB (33.45%)

transferred 360.0 MiB of 1.0 GiB (34.61%)

transferred 372.0 MiB of 1.0 GiB (35.76%)

transferred 384.0 MiB of 1.0 GiB (36.91%)

transferred 396.0 MiB of 1.0 GiB (38.07%)

transferred 408.0 MiB of 1.0 GiB (39.22%)

transferred 420.0 MiB of 1.0 GiB (40.37%)

transferred 432.0 MiB of 1.0 GiB (41.53%)

transferred 444.0 MiB of 1.0 GiB (42.68%)

transferred 456.0 MiB of 1.0 GiB (43.83%)

transferred 468.0 MiB of 1.0 GiB (44.99%)

transferred 480.0 MiB of 1.0 GiB (46.14%)

transferred 491.9 MiB of 1.0 GiB (47.29%)

transferred 504.0 MiB of 1.0 GiB (48.45%)

transferred 516.0 MiB of 1.0 GiB (49.60%)

transferred 528.0 MiB of 1.0 GiB (50.76%)

transferred 540.0 MiB of 1.0 GiB (51.91%)

transferred 552.0 MiB of 1.0 GiB (53.06%)

transferred 564.0 MiB of 1.0 GiB (54.22%)

transferred 576.0 MiB of 1.0 GiB (55.37%)

transferred 588.0 MiB of 1.0 GiB (56.52%)

transferred 600.0 MiB of 1.0 GiB (57.68%)

transferred 612.0 MiB of 1.0 GiB (58.83%)

transferred 624.0 MiB of 1.0 GiB (59.98%)

transferred 636.0 MiB of 1.0 GiB (61.14%)

transferred 648.0 MiB of 1.0 GiB (62.29%)

transferred 660.0 MiB of 1.0 GiB (63.44%)

transferred 672.0 MiB of 1.0 GiB (64.60%)

transferred 684.0 MiB of 1.0 GiB (65.75%)

transferred 696.1 MiB of 1.0 GiB (66.91%)

transferred 708.0 MiB of 1.0 GiB (68.06%)

transferred 720.0 MiB of 1.0 GiB (69.21%)

transferred 732.0 MiB of 1.0 GiB (70.37%)

transferred 744.0 MiB of 1.0 GiB (71.52%)

transferred 756.0 MiB of 1.0 GiB (72.67%)

transferred 768.0 MiB of 1.0 GiB (73.83%)

transferred 780.0 MiB of 1.0 GiB (74.98%)

transferred 792.0 MiB of 1.0 GiB (76.13%)

transferred 804.0 MiB of 1.0 GiB (77.29%)

transferred 816.0 MiB of 1.0 GiB (78.44%)

transferred 828.0 MiB of 1.0 GiB (79.59%)

transferred 840.0 MiB of 1.0 GiB (80.75%)

transferred 852.0 MiB of 1.0 GiB (81.90%)

transferred 864.0 MiB of 1.0 GiB (83.05%)

transferred 876.0 MiB of 1.0 GiB (84.21%)

transferred 888.0 MiB of 1.0 GiB (85.36%)

transferred 900.1 MiB of 1.0 GiB (86.52%)

transferred 912.0 MiB of 1.0 GiB (87.67%)

transferred 924.0 MiB of 1.0 GiB (88.82%)

transferred 936.0 MiB of 1.0 GiB (89.98%)

transferred 948.0 MiB of 1.0 GiB (91.13%)

transferred 960.0 MiB of 1.0 GiB (92.28%)

transferred 972.0 MiB of 1.0 GiB (93.44%)

transferred 984.0 MiB of 1.0 GiB (94.59%)

transferred 996.0 MiB of 1.0 GiB (95.74%)

transferred 1008.0 MiB of 1.0 GiB (96.90%)

transferred 1020.0 MiB of 1.0 GiB (98.05%)

transferred 1.0 GiB of 1.0 GiB (99.20%)

transferred 1.0 GiB of 1.0 GiB (100.00%)

transferred 1.0 GiB of 1.0 GiB (100.00%)

Successfully imported disk as 'unused0:local:999/vm-999-disk-0.raw'

“`

> 找到OpenWrt虚拟机 硬件,会有一个“未使用的磁盘0” 点击编辑,选择SATA 添加到虚拟机中

![4a9f46ce494a0112.png](https://img-cdn.itwk.cc/LightPicture/2022/12/4a9f46ce494a0112.png)

![c0d58c40c0b15e2e.png](https://img-cdn.itwk.cc/LightPicture/2022/12/c0d58c40c0b15e2e.png)

> 点击选项,将开机自启动设置为"是",然后在引导顺序中只保留sata0 然后启动虚拟机

![e482fe51d1c2e6b6.png](https://img-cdn.itwk.cc/LightPicture/2022/12/e482fe51d1c2e6b6.png)

![d17ceae022e17340.png](https://img-cdn.itwk.cc/LightPicture/2022/12/d17ceae022e17340.png)

#### IP地址设置

> 启动虚拟机后,建议手动配置以下OpenWrt的IP地址 命令如下

![b9fa0ece66e6470c.png](https://img-cdn.itwk.cc/LightPicture/2022/12/b9fa0ece66e6470c.png)

> 至此,安装完成

![dafb9508ed1ed636.png](https://img-cdn.itwk.cc/LightPicture/2022/12/dafb9508ed1ed636.png)

原文链接:https://www.bilibili.com/read/cv20879984/

© 版权声明
THE END
喜欢就支持一下吧
点赞13 分享