openwrt 配置虚拟wan口
一、刷固件:
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-cn
6、设置虚拟网卡:
7、设置虚拟网卡开机启动:/etc/init.d/vth enable
8、添加新接口:从网络--接口 中添加新接口,协议使用固定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=99
STOP=15
start() {
echo start
ip 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:0b
ifconfig vth1 hw ether 8c:ab:8e:76:5b:0c
ifconfig vth1 up
ifconfig vth2 up
}
stop() {
echo stop
ifconfig vth1 down
ifconfig vth2 down
}
restart() {
echo restart
ifconfig vth1 down
ifconfig vth2 down
ifconfig vth1 up
ifconfig vth2 up
}
最新文章
- mfc+vtk
- iOS音频解码表格
- SharePoint 2013技巧分享系列 - 同步Exchange显示高清用户照片
- CPU过高的排查方法
- Verilog HDL那些事_建模篇笔记(实验九:VGA驱动)
- Java并发包源码学习之AQS框架(三)LockSupport和interrupt
- HD1847 Good Luck in CET-4 Everybody!(巴什博弈)
- dedecms 列表页调用自定义字段
- struts (二)
- XSLT模糊查询函数contains不区分大小写,for-each排序
- Android Studio Error2
- 收集磁盘分区信息(总量、可用、已用、百分比)导出到csv
- RabbitMQ-从基础到实战(6)— 与Spring集成
- MongoDB 数据恢复与导出
- vue之router学习笔记
- [转]Go语言中的make和new
- C#--整型与字节数组byte[]之间的转换
- notepad去掉空行
- ns3 回调机制
- Python爬虫实战七之计算大学本学期绩点
热门文章
- 如何在 JavaScript 中使用媒体查询
- sudo漏洞解决方案--源码转rpm包(spec文件编写)
- 滑动窗口模板 leetcode 209题
- 域名_服务器_IP之间的关系
- 关于浏览器缓存造成的bug解决方法(页面跳转缓存,刷新生效)
- VMware-SSH协议的认证方式
- Servlet简介和ServletContext
- Asp.NET core/net 5接口返回实体含有long/int64的属性序列后最后几位变为0的解决
- 代码随想录训练营day 1 |704 二分查找 27移除算法
- SAP BW/4HANA 听课笔记