WRT1900AC 刷了openwrt以后,修改vlan配置就可以实现多wan了,下图是刚琢磨出来的网口结构(Layer)图,刷完openwrt以后默认就是这个样子了。。。
vlan1是lan,vlan2是wan,port5为cpu也就是eth0,port6为eth1,与eth0相连的是lan,与eth1相连的是wan,port0..3分别对应路由器外壳印刷的4..1,port4对应路由器外壳印刷的Internet。
vlan1是lan,vlan2是wan,port5为cpu也就是eth0,port6为eth1,与eth0相连的是lan,与eth1相连的是wan,port0..3分别对应路由器外壳印刷的4..1,port4对应路由器外壳印刷的Internet。
20150627,研究一天以后发现无论怎么划分vlan,都无法实现dual wan,因为分来分去都是在eth0.x里面,而不是eth1.x,最多只能将某个lan port转换为wan port,但是无法和wan口同时使用。。。而我的tplink wdr4310一下就设置好了。。。
20150628,在op论坛发了个求助帖子,最后在leitec网友的帮助下终于搞定vlan设置,实现了双线双wan接入设置:
修改 /etc/config/network 为:
修改 /etc/config/network 为:
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
|
config interface 'loopback'
option ifname 'lo'
option proto 'static'
option ipaddr '127.0.0.1'
option netmask '255.0.0.0'
config globals 'globals'
option ula_prefix 'fd79:09a9:45d8::/48'
config interface 'lan'
option ifname 'eth0'
option force_link '1'
option type 'bridge'
option proto 'static'
option netmask '255.255.255.0'
option ip6assign '60'
option ipaddr '172.24.1.1'
config interface 'wan'
option _orig_ifname 'eth1'
option _orig_bridge 'false'
option proto 'dhcp'
option ifname 'eth1'
option metric '1'
config interface 'wan6'
option ifname 'eth1'
option proto 'dhcpv6'
config switch
option name 'switch0'
option reset '1'
option enable_vlan '1'
config switch_vlan
option device 'switch0'
option vlan '1'
option vid '1'
option ports '0 1 2 5'
config switch_vlan
option device 'switch0'
option vlan '2'
option vid '2'
option ports '4 6'
config switch_vlan
option device 'switch0'
option vlan '3'
option vid '3'
option ports '3 6t'
config interface 'wan2'
option ifname 'eth1.3'
option proto 'dhcp'
option metric '2'
|
之前就是少了个t也就是tag,所以导致失败。
现在两个WAN都可以从上级获得IP了。
WAN
eth1
Uptime: 0h 9m 53s
MAC-Address: 00:00:00:00:00:00
RX: 96.56 MB (74235 Pkts.)
TX: 4.90 MB (43022 Pkts.)
IPv4: 192.168.1.2/24
Uptime: 0h 9m 53s
MAC-Address: 00:00:00:00:00:00
RX: 96.56 MB (74235 Pkts.)
TX: 4.90 MB (43022 Pkts.)
IPv4: 192.168.1.2/24
WAN2
eth1.3
Uptime: 0h 9m 58s
MAC-Address: 00:00:00:00:00:00
RX: 1.68 KB (17 Pkts.)
TX: 8.81 KB (96 Pkts.)
IPv4: 192.168.8.138/24
Uptime: 0h 9m 58s
MAC-Address: 00:00:00:00:00:00
RX: 1.68 KB (17 Pkts.)
TX: 8.81 KB (96 Pkts.)
IPv4: 192.168.8.138/24
1.电信联通下载带宽可以叠加。(360测速。。。)
2.故障转移,如果电信挂了,国内外可以走联通,联通挂了,国内走电信,国外断。(luci界面手动断开其中一个网络)
3.正常双线接入情况下国内走电信,国外走联通转vps,dns查询默认优先走的是电信(设成只走联通好像也没用。。。)
2.故障转移,如果电信挂了,国内外可以走联通,联通挂了,国内走电信,国外断。(luci界面手动断开其中一个网络)
3.正常双线接入情况下国内走电信,国外走联通转vps,dns查询默认优先走的是电信(设成只走联通好像也没用。。。)
/etc/config/mwan3修改为:
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
|
config rule 'default_rule'
option dest_ip '我的VPS'
option sticky '0'
option dest_port '1:65535'
option proto 'all'
option use_policy 'wan2_only'
config rule 'dns'
option src_port '5151'
option sticky '0'
option proto 'udp'
option use_policy 'wan1_first'
config rule 'dns2'
option sticky '0'
option use_policy 'wan1_first'
option proto 'udp'
option dest_port '53'
config rule 'default'
option sticky '0'
option use_policy 'wan1_first'
option proto 'all'
config policy 'wan1_only'
option last_resort 'unreachable'
list use_member 'wan_m1_w3'
config policy 'wan2_only'
option last_resort 'unreachable'
list use_member 'wan2_m1_w2'
config interface 'wan'
option enabled '1'
option count '1'
option timeout '2'
option interval '5'
option down '3'
option up '8'
option reliability '1'
list track_ip '202.96.199.133'
list track_ip '114.114.114.114'
config interface 'wan2'
option reliability '1'
option count '1'
option timeout '2'
option interval '5'
option down '3'
option up '8'
option enabled '1'
list track_ip '114.114.114.114'
list track_ip '114.114.115.115'
config member 'wan_m1_w3'
option interface 'wan'
option metric '1'
option weight '1'
config member 'wan2_m1_w2'
option interface 'wan2'
option weight '1'
option metric '2'
config policy 'wan1_first'
list use_member 'wan_m1_w3'
list use_member 'wan2_m1_w2'
option last_resort 'unreachable'
|