I have 2 ADSL lines with Dynamic IP wish to setup Policy Route to let Group A PC to use WAN1 and let Group B PC to use WAN2.
Setting
ROS 5.21
WAN
WAN1 - ADSL with Dynamic IP
WAN2 - ADSL with Dynamic IP
"Add default Route" option in PPPoE setting was disabled.
I user script to capture the Dynamic IP address and save it to Address List WAN1_IP & WAN2_IP
LAN
Two Group of PC and Address List for each group GW1_IP & GW2_IP was Created
Address List - GW1_IP - 192.168.1.0XX
Address List - GW2_IP - 192.168.1.1XX
Code: Select all
/ip firewall address-list add list=GW1_IP address=192.168.1.011/32
....
/ip firewall address-list add list=GW1_IP address=192.168.1.150/32
/ip firewall address-list add list=GW2_IP address=192.168.1.011/32
....
/ip firewall address-list add list=GW2_IP address=192.168.1.150/32
I use the following code and from the counter in WinBox I know that the correct routing mark was set.
Code: Select all
add action=mark-routing chain=prerouting comment=GW1 disabled=no \
new-routing-mark=GW1 in-interface=LAN src-address-list=GW1_IP passthrough=yes
add action=mark-routing chain=prerouting comment=GW2 disabled=no \
new-routing-mark=GW2 in-interface=LAN src-address-list=GW2_IP passthrough=yes
Code: Select all
/ip firewall nat
add action=masquerade chain=srcnat routing-mark=GW1 disabled=no out-interface=WAN1
add action=masquerade chain=srcnat routing-mark=GW2 disabled=no out-interface=WAN2
I add two routes as follow, since I fon't have a fixed IP, so instead of gateway address, I just use use the gateway interface name.
Code: Select all
/ip route
add check-gateway=ping disabled=yes distance=1 dst-address=0.0.0.0/0 gateway=\
PCCW routing-mark=GW1 scope=30 target-scope=10
add check-gateway=ping disabled=yes distance=1 dst-address=0.0.0.0/0 gateway=\
WAN2 routing-mark=GW2 scope=30 target-scope=10
/ip route rule
add action=lookup disabled=no routing-mark=GW1 table=GW1
add action=lookup disabled=no routing-mark=GW2 table=GW2
Problem
CANNOT connect to internet
Any hints?