openwrt 配置虚拟wan口

您所在的位置:网站首页 openwrt如何配置wan口 openwrt 配置虚拟wan口

openwrt 配置虚拟wan口

2024-07-12 14:15| 来源: 网络整理| 查看: 265

一、刷固件:1、刷入 刷不死,百度上找教程;2、下载固件:https://downloads.openwrt.org/releases/17.01.6/targets/ramips/mt7620/ 按硬件查找最新固件,具体硬件型号,百度上找对应的刷机教程,斐讯k1为psg1208;3、设置密码并开启ssh;4、设置网络使可以正常上网;5、更新包信息并安装中文包、虚拟wan包 :opkg update && opkg install luci-i18n-base-zh-cn kmod-macvlan mwan3 luci-app-mwan3 luci-i18n-mwan3-zh-cn6、设置虚拟网卡:7、设置虚拟网卡开机启动:/etc/init.d/vth enable8、添加新接口:从网络--接口 中添加新接口,协议使用固定IP,物理接口选择上面设置的虚拟wan口vth1 vth2,防火墙设置成和wan口一样;9、设置外网web和ssh访问:系统--管理权,修改22端口,否则不能外网访问ssh,选中 网关端口 选项10、添加计划任务:分 时 日期 月 周 命令;11、关闭ipv6:/etc/init.d/odhcpd disable ; /etc/init.d/odhcpd stop

vim /etc/init.d/vth

#!/bin/sh /etc/rc.common

START=99STOP=15

start() {echo startip link add link eth0.2 name vth1 type macvlan # 虚拟网卡1,eth0.2从默认的wan口中查看ip link add link eth0.2 name vth2 type macvlan # 虚拟网卡2

ifconfig vth1 hw ether 8c:ab:8e:76:5b:0bifconfig vth1 hw ether 8c:ab:8e:76:5b:0c

ifconfig vth1 upifconfig vth2 up}

stop() {echo stopifconfig vth1 downifconfig vth2 down}

restart() {echo restart

ifconfig vth1 downifconfig vth2 down

ifconfig vth1 upifconfig vth2 up

}



【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3