I've named my wan's abc1 and abc2 for personal reasons.
ping -c 1 -I eth0.3 google.com == timeout
ping -c 1 -I eth0.4 google.com == OK
ping -c 1 -I pppoe-abc1 google.com == OK
abc1 = pppoe-abc1 (which is pppoe off vlan3 = eth0.3)
abc2 = eth0.4
ip route show
default via 110.159.xx.xxx dev pppoe-abc1 proto static metric 10
default via 192.168.202.1 dev eth0.4 proto static metric 20
110.159.xx.xxx dev pppoe-abc1 proto kernel scope link src 110.159.yy.yyy
192.168.0.0/24 dev br-lan proto kernel scope link src 192.168.0.254
192.168.21.0/24 dev wlan0-1 proto kernel scope link src 192.168.21.254
192.168.202.0/24 dev eth0.4 proto static scope link metric 20
ip rule show
0: from all lookup local
1001: from all fwmark 0x100/0xff00 lookup 1001
1002: from all fwmark 0x200/0xff00 lookup 1002
1016: from all fwmark 0x1000/0xff00 lookup 1016
1017: from all fwmark 0x1100/0xff00 lookup 1017
1018: from all fwmark 0x1200/0xff00 lookup 1018
1019: from all fwmark 0x1300/0xff00 lookup 1019
1020: from all fwmark 0x1400/0xff00 lookup 1020
32766: from all lookup main
32767: from all lookup default
ip rule list table #above#
1001:
default via 110.159.xx.xxx dev pppoe-abc1
1002:
default via 192.168.202.1 dev eth0.4
1016:
default via 110.159.xx.xxx dev pppoe-abc1 metric 1
blackhole default metric 1000
1017:
default via 192.168.202.1 dev eth0.4 metric 1
blackhole default metric 1000
1018:
default metric 1
nexthop via 192.168.202.1 dev eth0.4 weight 2
nexthop via 110.159.xx.xxx dev pppoe-abc1 weight 3
blackhole default metric 1000
1019:
default via 110.159.xx.xxx dev pppoe-abc1 metric 1
default via 192.168.202.1 dev eth0.4 metric 2
blackhole default metric 1000
1020:
default via 192.168.202.1 dev eth0.4 metric 1
default via 110.159.xx.xxx dev pppoe-abc1 metric 2
blackhole default metric 1000
iptables -L mwan3_* -t mangle -v -n
Chain mwan3_pre (2 references)
pkts bytes target prot opt in out source destination
39644 5359K CONNMARK all -- * * 0.0.0.0/0 0.0.0.0/0 CONNMARK restore mask 0xff00
22909 2745K mwan3_track_eth0.4 all -- * * 0.0.0.0/0 0.0.0.0/0 mark match !0x8000/0x8000
7616 1689K MARK all -- eth0.4 * 0.0.0.0/0 0.0.0.0/0 MARK xset 0x8200/0xff00
16215 1173K mwan3_track_pppoe-abc1 all -- * * 0.0.0.0/0 0.0.0.0/0 mark match !0x8000/0x8000
276 21518 MARK all -- pppoe-abc1 * 0.0.0.0/0 0.0.0.0/0 MARK xset 0x8100/0xff00
26109 1962K mwan3_default all -- * * 0.0.0.0/0 0.0.0.0/0 mark match !0x8000/0x8000
1894 89325 mwan3_rules all -- * * 0.0.0.0/0 0.0.0.0/0 mark match 0x0/0xff00
Chain mwan3_post (2 references)
pkts bytes target prot opt in out source destination
10784 445K MARK all -- * eth0.4 0.0.0.0/0 0.0.0.0/0 mark match !0x8000/0x8000 MARK xset 0x200/0xff00
49 3627 MARK all -- * pppoe-abc1 0.0.0.0/0 0.0.0.0/0 mark match !0x8000/0x8000 MARK xset 0x100/0xff00
21629 4635K MARK all -- * * 0.0.0.0/0 0.0.0.0/0 mark match 0x8000/0x8000 MARK and 0xffff7fff
38694 5367K CONNMARK all -- * * 0.0.0.0/0 0.0.0.0/0 CONNMARK save mask 0xff00
Chain mwan3_default (1 references)
pkts bytes target prot opt in out source destination
3 96 MARK all -- * * 0.0.0.0/0 224.0.0.0/3 mark match !0x8000/0x8000 MARK or 0x8000
0 0 MARK all -- * * 0.0.0.0/0 110.159.xx.xxx mark match !0x8000/0x8000 MARK or 0x8000
4385 615K MARK all -- * * 0.0.0.0/0 192.168.0.0/24 mark match !0x8000/0x8000 MARK or 0x8000
0 0 MARK all -- * * 0.0.0.0/0 192.168.21.0/24 mark match !0x8000/0x8000 MARK or 0x8000
0 0 MARK all -- * * 0.0.0.0/0 192.168.202.0/24 mark match !0x8000/0x8000 MARK or 0x8000
Chain mwan3_rules (1 references)
pkts bytes target prot opt in out source destination
235 12924 MARK all -- * * 0.0.0.0/0 0.0.0.0/0 mark match 0x0/0xff00 MARK xset 0x1400/0xff00
0 0 MARK all -- * * 0.0.0.0/0 0.0.0.0/0 mark match 0x0/0xff00 MARK xset 0x1400/0xff00
0 0 MARK tcp -- * * 0.0.0.0/0 0.0.0.0/0 multiport sports 0:65535 multiport dports 10101 mark match 0x0/0xff00 MARK xset 0x1400/0xff00
0 0 MARK tcp -- * * 0.0.0.0/0 0.0.0.0/0 multiport sports 0:65535 multiport dports 12000 mark match 0x0/0xff00 MARK xset 0x1400/0xff00
0 0 MARK tcp -- * * 0.0.0.0/0 0.0.0.0/0 multiport sports 0:65535 multiport dports 19000 mark match 0x0/0xff00 MARK xset 0x1400/0xff00
0 0 MARK tcp -- * * 0.0.0.0/0 0.0.0.0/0 multiport sports 0:65535 multiport dports 30001 mark match 0x0/0xff00 MARK xset 0x1400/0xff00
0 0 MARK udp -- * * 0.0.0.0/0 0.0.0.0/0 multiport sports 0:65535 multiport dports 12000 mark match 0x0/0xff00 MARK xset 0x1400/0xff00
0 0 MARK udp -- * * 0.0.0.0/0 0.0.0.0/0 multiport sports 0:65535 multiport dports 10002:10005 mark match 0x0/0xff00 MARK xset 0x1400/0xff00
0 0 MARK all -- * * 0.0.0.0/0 0.0.0.0/0 mark match 0x0/0xff00 MARK xset 0x1300/0xff00
ifconfig
br-lan Link encap:Ethernet HWaddr F8:D1:11
inet addr:192.168.0.254 Bcast:192.168.0.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:31244 errors:0 dropped:11 overruns:0 frame:0
TX packets:20580 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:1654173 (1.5 MiB) TX bytes:5399295 (5.1 MiB)
eth0 Link encap:Ethernet HWaddr F8:D1:11
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:48201 errors:0 dropped:0 overruns:59805 frame:0
TX packets:43197 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:6757305 (6.4 MiB) TX bytes:6892406 (6.5 MiB)
Interrupt:4
eth0.1 Link encap:Ethernet HWaddr F8:D1:11
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:31256 errors:0 dropped:0 overruns:0 frame:0
TX packets:20587 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:1664808 (1.5 MiB) TX bytes:5399617 (5.1 MiB)
eth0.3 Link encap:Ethernet HWaddr F8:D1:11
UP BROADCAST RUNNING MULTICAST MTU:1492 Metric:1
RX packets:1387 errors:0 dropped:0 overruns:0 frame:0
TX packets:1415 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:101922 (99.5 KiB) TX bytes:95408 (93.1 KiB)
eth0.4 Link encap:Ethernet HWaddr F8:D1:1
inet addr:192.168.202.254 Bcast:192.168.202.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1492 Metric:1
RX packets:15401 errors:0 dropped:0 overruns:0 frame:0
TX packets:21194 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:4115857 (3.9 MiB) TX bytes:1223554 (1.1 MiB)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:144 errors:0 dropped:0 overruns:0 frame:0
TX packets:144 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:11625 (11.3 KiB) TX bytes:11625 (11.3 KiB)
pppoe-abc1 Link encap:Point-to-Point Protocol
inet addr:110.159.yy.yyy P-t-P:110.159.xx.xxx Mask:255.255.255.255
UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1492 Metric:1
RX packets:665 errors:0 dropped:0 overruns:0 frame:0
TX packets:688 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:3
RX bytes:60424 (59.0 KiB) TX bytes:58347 (56.9 KiB)
wlan0 Link encap:Ethernet HWaddr F8:D1:11:7
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:3907 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:32
RX bytes:0 (0.0 B) TX bytes:310562 (303.2 KiB)
wlan0-1 Link encap:Ethernet HWaddr FA:D1:11:7
inet addr:192.168.21.254 Bcast:192.168.21.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1492 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:1 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:32
RX bytes:0 (0.0 B) TX bytes:420 (420.0 B)
config interface 'abc1'
option enabled '1'
# list track_ip 'a.a.a.a'
# list track_ip 'b.b.b.b'
list track_ip '208.67.222.222'
list track_ip '8.8.8.8'
option count '1'
option timeout '2'
option down '3'
option up '3'
option reliability '2'
option interval '5'
config interface 'abc2'
option enabled '1'
# list track_ip 'a.a.a.a'
# list track_ip 'b.b.b.b'
list track_ip '208.67.222.222'
list track_ip '8.8.8.8'
option count '1'
option timeout '2'
option down '3'
option up '3'
option reliability '2'
option interval '5'
config member 'abc1_m1_w3'
option interface 'abc1'
option metric '1'
option weight '3'
config member 'abc1_m2_w3'
option interface 'abc1'
option metric '2'
option weight '3'
config member 'abc2_m1_w2'
option interface 'abc2'
option metric '1'
option weight '2'
config member 'abc2_m2_w2'
option interface 'abc2'
option metric '2'
option weight '2'
config policy 'abc1_only'
list use_member 'abc1_m1_w3'
config policy 'abc2_only'
list use_member 'abc2_m1_w2'
config policy 'abc1_abc2_loadbalanced'
list use_member 'abc1_m1_w3'
list use_member 'abc2_m1_w2'
config policy 'abc1_pri_abc2_sec'
list use_member 'abc1_m1_w3'
list use_member 'abc2_m2_w2'
config policy 'abc2_pri_abc1_sec'
list use_member 'abc1_m2_w3'
list use_member 'abc2_m1_w2'
config rule 'aaa1'
option dest_port '11031'
option use_policy 'abc2_pri_abc1_sec'
option proto 'all'
config rule 'bbb2'
option proto 'udp'
option dest_port '12000'
option use_policy 'abc2_pri_abc1_sec'
config rule 'ccc3'
option proto 'udp'
option dest_port '10002:10005'
option use_policy 'abc2_pri_abc1_sec'
config rule 'allelse'
option use_policy 'abc1_pri_abc2_sec'
What am I doing wrong? ALL traffic goes to my 2nd wan : abc2
I need traffic_of_specific_destination_ports on wan2_failover_to_wan1 (so these specified traffic are always on wan2 only unless wan2 is down)
and all_other_unspecified_traffic on wan1_failover_to_wan2 (so these all_else traffic are always on wan1 only unless wan1 goes down)
nothing else. do the rules read top to bottom or bottom to top?
~~~~~~~
Is there a way to check if a WAN is tagged up or down? will help a lot in diagnosis
(Last edited by biatche on 20 Apr 2013, 18:10)