Dell wyse 5070,单臂软路由

安装PVE

https://www.10bests.com/install-proxmox-ve/

PVE里面安装openwrt虚拟机

https://www.10bests.com/install-openwrt-lede-on-pve/

download x86 image

ext4磁盘 个人建议用这个镜像 https://downloads.openwrt.org/releases/19.07.3/targets/x86/64/openwrt-19.07.3-x86-64-combined-ext4.img.gz
只读磁盘
https://downloads.openwrt.org/releases/19.07.3/targets/x86/64/openwrt-19.07.3-x86-64-combined-squashfs.img.gz

添加启动盘

上传Openwrt镜像:选择"pve"节点 > local存储空间 > 内容 > 点击上传 > 选择"openwrt.img"镜像 > 点击"上传”,openwrt镜像最好提前重命名一下,原来的太长了。 3、把镜像转成虚拟磁盘并导入到虚拟机:选择"pve"节点 > shell > 输入以下命令并回车:

qm importdisk 100 /var/lib/vz/template/iso/openwrt-19.07.3-x86-64-combined-ext4.img local-lvm shell会显示vm-102-disk-0虚拟磁盘创建的进度,最后显示‘Successfully imported disk as ‘unused0:local-lvm:vm-102-disk-0’就是添加成功了。

qm importdisk是PVE导入磁盘到虚拟机的工具,后面的参数‘102’是Openwrt虚拟机的编号,‘/var/lib/vz/template/iso/openwrt.img’是刚才上传Openwrt镜像的完整目录,‘local-lvm’是PVE储存虚拟磁盘的存储空间。

4、导入成功后在‘Openwrt’虚拟机的"硬件"选项卡就能看到一个"未使用的磁盘0”,选中它点击编辑,弹出配置窗口,设备类型选"sata”,最后点击添加。 5、切换到虚拟机的"选项"选项卡,双击"引导顺序”,第一引导项选"Disk ‘sata0’"。

网络结构图 – PUML

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
@startuml
card ONU as onu
note left: 联通光猫, vlan 2
card "wndr4300 & wifi" as switch
note left: 普通路由器当交换机用,光猫插LAN_1口\n vlan 2,\n 交换机 ip: 192.168.50.254

frame DELL-wyse5070+PVE{
    card vmbr0
    note left: bridge
    card enp1s0
    note left: 宿主机网卡,192.168.50.90
    enp1s0 -- vmbr0

    card vmbr0.2
    note left: vlan 2
    vmbr0 -- vmbr0.2
    card vmbr1 
    note left: bridge
    vmbr0.2 -- vmbr1
 
    card openwrt as router
    note bottom: 软路由 PVE中的kvm实例,\n LAN IP: 192.168.50.1

    vmbr1 -- router
    vmbr0 -- router
}

card R7800
card pixelbook
note right: vlan 1
onu -- switch
switch -- vmbr0
switch -- pixelbook
@enduml

交换机配置

路由器当交换机用时,在Lan上禁用dhcp Network>Interfaces>Lan>Edit>DHCP Server>General Setup>勾选 “Ignore interface”

在交换机上配置vlan, 隔离掉光猫的DHCP

https://www.bilibili.com/video/BV1F5411x7GC?from=search&seid=1805628741909816644

交换机vlan 配置

LAN1: 光猫
LAN2: PVE
LAN3 - 4: 其它VLAN1局域网设备 |VLAN |LAN1|LAN2|LAN3|LAN4| |-|-|-|-|-| |1|off|untagged|untagged|untagged| |2|untagged|tagged|off|off|

openwrt 配置

配置openwrt 的ip
vi /etc/config/network

重启openwrt实例后测试 ping 192.168.50.1

Lan 物理设置: 取消勾选"桥接接口”, 接口选择 eth0 Wan 物理设置: 接口选择 eth0 如果没有wan口,手动添加一个接口 Name: wan Protocol: PPPoE Interface: eth1 – vmbr1, vlan 2

Wan配置: username: xxx password: xxx

opwnert里的科学上网

xxxxxx

监控

telegraf

https://dl.influxdata.com/telegraf/releases/telegraf-1.15.2_static_linux_amd64.tar.gz

reference, docker容器的openwrt,试验没成功,docker启动参数加 privildged 控制台会泄漏到宿主机.

https://vvl.me/2019/10/one-armed-router/ https://openwrt.club/93.html https://github.com/luoqeng/OpenWrt-on-Docker https://www.youtube.com/watch?v=jXMgAz_GQxI

http://lpwei.com/index.php/archives/39/ https://github.com/lisaac/blog/issues/4

https://www.10bests.com/install-openwrt-lede-on-pve/ https://www.cnblogs.com/iiiiher/p/8067226.html https://www.bilibili.com/s/video/BV1F5411x7GC