Heh, that's kinda lame.
Anyhoo, right now I have 2 WANs (one of them has just beed added a few days ago), and 2 LANs on my router. Let's call em PUBLIC1 (domestic + international), PUBLIC2 (domestic only), PRIVATE (192.168.2.0/24), and LOCAL (192.168.1.0/24), shall we?
Here's how I setup the mangle part: (I've never used any mangle before, and this is my first attempt of writing my own mangle rules after reading some articles, tutorials, and the "QoS best practices" PDF. So bear with me if I made some stupid, yet obvious, mistakes)
Code: Select all
0 chain=prerouting action=accept src-address=192.168.2.0/24
1 chain=prerouting action=accept src-address=192.168.1.0/24
2 ;;; PRIVATE >> ALL Domestic + INTL traffic
chain=prerouting action=mark-routing new-routing-mark=INTL_route passthrough=no in-interface=PRIVATE
4 ;;; LOCAL >> All HTTP Traffic
chain=prerouting action=mark-routing new-routing-mark=INTL_route passthrough=no protocol=tcp in-interface=LOCAL dst-port=80
5 chain=prerouting action=mark-routing new-routing-mark=INTL_route passthrough=no protocol=tcp in-interface=LOCAL dst-port=8080
6 chain=prerouting action=mark-routing new-routing-mark=INTL_route passthrough=no protocol=tcp in-interface=LOCAL dst-port=3128
7 ;;; LOCAL >> All INTL Traffic
chain=prerouting action=mark-routing new-routing-mark=INTL_route passthrough=no dst-address-list=!domestic in-interface=LOCAL
8 X ;;; LOCAL >> All Domestic traffic
chain=prerouting action=mark-routing new-routing-mark=domestic_route passthrough=no dst-address-list=domestic in-interface=LOCAL
13 ;;; new conn-mark = proxy_con >> new pkt-mark = proxy_pkt
chain=output action=mark-connection new-connection-mark=proxy_con passthrough=yes content=X-Cache: HIT
14 chain=output action=mark-packet new-packet-mark=proxy_pkt passthrough=no connection-mark=proxy_con
15 ;;; !proxy_con >> new conn-mark = basic_client_con. adr-list=client_basic
chain=forward action=mark-connection new-connection-mark=basic_client_con passthrough=yes src-address-list=client_basic in-interface=LOCAL connection-mark=!proxy_con
16 ;;; basic_client_con >> new pkt-mark = basic_client_pkt
chain=forward action=mark-packet new-packet-mark=basic_client_pkt passthrough=no connection-mark=basic_client_con
17 ;;; !proxy_con >> new conn-mark = vip_client_con. adr-list=client_vip
chain=forward action=mark-connection new-connection-mark=vip_client_con passthrough=yes src-address-list=client_vip in-interface=LOCAL connection-mark=!proxy_con
18 ;;; vip_client_con >> new pkt-mark = vip_client_pkt
chain=forward action=mark-packet new-packet-mark=vip_client_pkt passthrough=no connection-mark=vip_client_con
23 ;;; !proxy_con >> new conn-mark = all_con (OUTPUT, tcp only) >> ftp_pkt & winbox_pkt
chain=output action=mark-connection new-connection-mark=other_con passthrough=yes protocol=tcp connection-mark=!proxy_con
24 chain=output action=mark-packet new-packet-mark=winbox_pkt passthrough=no protocol=tcp src-port=8291 connection-mark=other_con
25 chain=output action=mark-packet new-packet-mark=ftp_pkt passthrough=no connection-mark=other_con connection-type=ftp
Code: Select all
# DST-ADDRESS PREF-SRC GATEWAY-STATE GATEWAY DISTANCE INTERFACE
0 A S ;;; Domestic Gateway
0.0.0.0/0 reachable xxx.yyy.zzz.000 1 PUBLIC2
1 S ;;; Backup Gateway (Failover)
0.0.0.0/0 reachable aaa.bbb.ccc.ddd 111 PUBLIC
2 A S ;;; INTL Gateway
0.0.0.0/0 reachable aaa.bbb.ccc.ddd 1 PUBLIC
3 ADC xxx.yyy.zzz.000/28 xxx.yyy.zzz.000 0 PUBLIC
4 ADC aaa.bbb.ccc.ddd/28 aaa.bbb.ccc.ddd 0 PUBLIC2
5 ADC 192.168.1.0/24 192.168.1.1 0 LOCAL
6 ADC 192.168.2.0/24 192.168.2.1 0 PRIVATE
7 ADC 192.168.168.0/24 192.168.168.1 0 PUBLIC
You see mangle rule 0 & 1 there? If I enable them, I can connect from PRIVATE to LOCAL and vice versa, but all traffic, domestic and international, from PRIVATE will be forwarded to PUBLIC2. Which means there are NO international traffic for PRIVATE. I find this to be VERY ODD, since according to the mangle rule #1, all PRIVATE traffic should be marked with INTL_route, and therefore should go to PUBLIC1. I do not know about domestic & international traffic from LOCAL, I haven't had a chance to test it yet.
If I disable rule 0 & 1, I can't connect to the other LAN, but my outgoing traffic is forwarded just fine. Everything from PRIVATE is forwarded to PUBLIC1, like I wanted. Again, I haven't had the chance to go to the LOCAL site yet, so I can't test how things are there, but I have a hunch it's going to be the same.
Am I doing anything wrong? Do you guys need to see any other settings? Filter, NAT? I didn't change any of them, so it shouldn't matter... Well, there's this one line that's added by the ISP guys:
Code: Select all
0 ;;; NAT--Domestic
chain=srcnat action=src-nat to-addresses=xxx.yyy.zzz.000 out-interface=PUBLIC2
1 ;;; Main Route
chain=srcnat action=masquerade
Well, that's all that was changed during this whole adding new WAN process. Hope you guys can provide some insights.
Oh, one more thing... Is the prerouting chain in mangle ordered in any way? I mean, they all have passthrough=no.
Thanks all.
-Z-
EDIT:
Oh, I just remembered. If mangle rule 0 & 1 is disabled, when I traced a connection to one of the LOCAL PCs from PRIVATE, the traffic was forwarded to PUBLIC1's gateway, and got lost there. So instead of PRIVATE--router--LOCAL, it went something like this: PRIVATE--router--GATEWAY PUBLIC1--... (eternal RTOs)... Hope this helps somewhat.