搜档网
当前位置:搜档网 › OpenWrt单wan口N拨教程

OpenWrt单wan口N拨教程

OpenWrt 单wan口 N 拨教程

使用macvlan+multiwan 单线多拨成功,带宽叠成功

1 准备能刷Openwrt 路由一台

Open wrt 下载地址

https://www.sodocs.net/doc/ae3663368.html,中文版本下载可能不支持你的路由

https://www.sodocs.net/doc/ae3663368.html,/backfire/10.03/英文版下载相对应的软件版本2 软件putty 软件远程登陆路由用SecureCRT

下载地址https://www.sodocs.net/doc/ae3663368.html,/soft/6838.html

3.刷新路由的固件从dd-wrt 或者tomato 都可以直接升级Tftp 应该也可以的

升级后将电脑的ip地址设置为192.168.1.X

路由默认ip 192.168.1.1 用户名root 密码admin

安装软件前先要配置你的路由能上网

在nerwork 下有wan口的设置pppoe 拨号上网设置好,保证单wan能上网4,安装macvlan软件

进入system ---- software –页面

先点一下

Update

然后查找macvlan 点左边的install

5.安装multiwan

Multiwan软件参考https://https://www.sodocs.net/doc/ae3663368.html,/viewtopic.php?id=23904

有最新版本下载地址

现在的版本

ftp://https://www.sodocs.net/doc/ae3663368.html,/multiwan_1.0.16.ipk

ftp://https://www.sodocs.net/doc/ae3663368.html,/luci-app-multiwan_1.0.16.ipk

用SecureCRT软件登陆路由端口是22

登陆后输入下面的命令

opkg install ftp://https://www.sodocs.net/doc/ae3663368.html,/multiwan_1.0.16.ipk

等待安装完成,,再安装

opkg install ftp://https://www.sodocs.net/doc/ae3663368.html,/luci-app-multiwan_1.0.16.ipk

然后对路由进行配置以下都在SecureCRT登陆下完成的

# 查看你的wan口的端口名称

root@OpenWrt:~# cat /etc/config/network

config 'switch' 'eth0'

option 'enable' '1'

config 'switch_vlan' 'eth0_0'

option 'device' 'eth0'

option 'vlan' '0'

option 'ports' '1 2 3 4 5' #port1、2、3、4和cpu 5属于vlan 0 config 'switch_vlan' 'eth0_1' 记住这里的eth0_1 后面有用option 'device' 'eth0'

option 'vlan' '1'

option 'ports' '0 5' #port0和cpu 5属于vlan 1

编辑/etc/rc.local 增加虚拟wankou

root@OpenWrt:~# vi /etc/rc.local

按键盘I 进入修改模式

# Put your custom commands here that should be executed once

# the system init finished. By default this file does nothing.

ip link add link eth0.1 eth2 type macvlan 增加wan2 虚拟网卡eth0.1 对应前面记下的ifconfig eth2 hw ether 00:11:22:33:44:5E

ifconfig eth2 up

ip link add link eth0.1 eth3 type macvlan 增加wan3虚拟网卡eth0.1 对应前面记下的ifconfig eth3 hw ether 00:11:22:33:44:6E

ifconfig eth3 up

ip link add link eth0.1 eth4 type macvlan 增加wan4虚拟网卡eth0.1 对应前面记下的ifconfig eth4 hw ether 00:11:22:33:44:7F

ifconfig eth4 up

ip link add link eth0.1 eth5 type macvlan 增加wan5虚拟网卡eth0.1 对应前面记下的ifconfig eth5 hw ether 00:11:22:33:44:8E

ifconfig eth5 up

ip link add link eth0.1 eth6 type macvlan 增加wan6虚拟网卡eth0.1 对应前面记下的ifconfig eth6 hw ether 00:11:22:33:44:9E

ifconfig eth6 up

如果需要更多自行添加少的话可以少加点

修改后保存退出

按esc 退出。shift+:看见左下角显示:输入wq 保存退出

修改/etc/config/network

输入命令

Vi /etc/config/network

config 'switch' 'eth0'

option 'enable' '1'

config 'switch_vlan' 'eth0_0'

option 'device' 'eth0'

option 'vlan' '0'

option 'ports' '1 2 3 4 5'

config 'switch_vlan' 'eth0_1'

option 'device' 'eth0'

option 'vlan' '1'

option 'ports' '0 5'

config 'interface' 'loopback'

option 'ifname' 'lo'

option 'proto' 'static'

option 'ipaddr' '127.0.0.1'

option 'netmask' '255.0.0.0'

config 'interface' 'lan'

option 'type' 'bridge'

option 'proto' 'static'

option 'netmask' '255.255.255.0'

option 'ipaddr' '192.168.3.250'

option 'defaultroute' '0'

option 'peerdns' '0'

option 'ifname' 'eth0.0'

config 'interface' 'wan'

option 'ifname' 'eth0.1'

option 'proto' 'pppoe'

option 'password' '用户名'

option 'username' '密码'

option 'defaultroute' '1'

option 'peerdns' '1'

config 'interface' 'wan2'

option 'ifname' 'eth2'

option 'defaultroute' '0'

option 'peerdns' '0'

option 'proto' 'none'

config 'interface' 'wan3'

option 'ifname' 'eth3'

option 'defaultroute' '0'

option 'peerdns' '0'

option 'proto' 'none'

config 'interface' 'wan4'

option 'ifname' 'eth4'

option 'defaultroute' '0'

option 'peerdns' '0'

option 'proto' 'none'

config 'interface' 'wan5'

option 'ifname' 'eth5'

option 'defaultroute' '0'

option 'peerdns' '0'

option 'proto' 'none'

config 'interface' 'wan6'

option 'ifname' 'eth6'

option 'defaultroute' '0'

option 'peerdns' '0'

option 'proto' 'none'

红色为增加部分这里总共加了6 W AN 拨号!根据需要修改!

修改保存,重启路由!

进入相应的wan口设置你的上网情况,,可以把不用的wan关闭的需要的时候再打开

设置好后保存应用

进入multi-wan 设置多宽带合并情况

第一项load blancer distribution 设置此wan口占有的宽带比例(几个wan口的总和为10),

当wan口没有用进行关闭Wan5 关闭

设置好后按保存/应用按钮

相关主题