软路由
Contents
软路由
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储存虚拟磁盘的存储空间。
- 导入成功后在‘Openwrt’虚拟机的"硬件"选项卡就能看到一个"未使用的磁盘0”,选中它点击编辑,弹出配置窗口,设备类型选"sata”,最后点击添加。
- 切换到虚拟机的"选项"选项卡,双击"引导顺序”,第一引导项选"Disk ‘sata0’"。
交换机配置
路由器当交换机用时,在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
监控
root@OpenWrt:~# mv telegraf-1.19.0/usr/bin/telegraf /usr/bin/ root@OpenWrt:~# mv telegraf-1.19.0/usr/lib/telegraf /usr/lib root@OpenWrt:~# mv telegraf-1.19.0/var/log//var/log root@OpenWrt:~# mv telegraf-1.19.0/etc/ /etc
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
Author -
LastMod 2021-04-26