We currently have multiple uplinks provided by different ISPs but for some reason, what we wanted to do is to specify WAN1 port's IP address to reflect when doing speedtest or when searching "What is my IP" but the rest of traffic would be routed to other WANs which have a higher bandwidth capacity.
(only our WAN1 has a dedicated public static IP with our ASN, other WANs have dynamic public IPs which is a headache for us) .
(sorry for my possible wrong chosen set of words)
WAN1=50MBPS Bandwidth
WAN2=300MBPS Bandwidth
WAN3=300MBPS Bandwidth
WAN4= 1GBPS Bandwidth
WAN5=1GBPS Bandwidth
with that said, we are currently using PCC Load Balancing to distribute the bandwidth usage, our only remaining problem is to somewhat be able to make/reflect the WAN1 public IP when conducting find my IP and Speedtest.net
This is the current configuration on a CCR1009:
Code: Select all
/interface ethernet
set [ find default-name=ether1 ] name=ether1-50MBPS
set [ find default-name=ether2 ] name=ether2-300MBPS
set [ find default-name=ether3 ] name=ether3-300MBPS
set [ find default-name=ether4 ] name=ether4-1GBPS
set [ find default-name=ether5 ] name=ether5-1GBPS
set [ find default-name=ether6 ] name=ether6-LAN-DHCP
set [ find default-name=ether7 ] name=ether7-LAN-DHCP
/interface list
add name=LOCAL
add name=WAN
/routing table
add fib name=to_WAN1
add fib name=to_WAN2
add fib name=to_WAN3
add fib name=to_WAN4
add fib name=to_WAN5
/interface list member
add interface=DHCP-bridge list=LOCAL
add interface=ether1-50MBPS list=WAN
add interface=ether2-300MBPS list=WAN
add interface=ether3-300MBPS list=WAN
add interface=ether4-1GBPS list=WAN
add interface=ether5-1GBPS list=WAN
add interface=ether6-LAN-DHCP list=LOCAL
add interface=ether7-LAN-DHCP list=LOCAL
/ip firewall mangle
add action=mark-connection chain=input comment="INPUT MARK CONNECTION" \
in-interface=ether1-50MBPS new-connection-mark=WAN1_conn passthrough=yes
add action=mark-connection chain=input in-interface=ether2-300MBPS \
new-connection-mark=WAN2_conn passthrough=yes
add action=mark-connection chain=input in-interface=ether3-300MBPS \
new-connection-mark=WAN3_conn passthrough=yes
add action=mark-connection chain=input in-interface=ether4-1GBPS \
new-connection-mark=WAN4_conn passthrough=yes
add action=mark-connection chain=input in-interface=ether5-1GBPS \
new-connection-mark=WAN5_conn passthrough=yes
add action=mark-routing chain=output comment="OUTPUT MARK ROUTING" \
connection-mark=WAN1_conn new-routing-mark=to_WAN1 passthrough=yes
add action=mark-routing chain=output connection-mark=WAN2_conn \
new-routing-mark=to_WAN2 passthrough=yes
add action=mark-routing chain=output connection-mark=WAN3_conn \
new-routing-mark=to_WAN3 passthrough=yes
add action=mark-routing chain=output connection-mark=WAN4_conn \
new-routing-mark=to_WAN4 passthrough=yes
add action=mark-routing chain=output connection-mark=WAN5_conn \
new-routing-mark=to_WAN5 passthrough=yes
add action=accept chain=prerouting in-interface-list=WAN
add action=mark-connection chain=prerouting comment=\
"PRE ROUTING MARK CONNECTION ISP" dst-address-type=!local \
in-interface-list=LOCAL new-connection-mark=WAN1_conn passthrough=yes \
per-connection-classifier=both-addresses-and-ports:8/0
add action=mark-connection chain=prerouting dst-address-type=!local \
in-interface-list=LOCAL new-connection-mark=WAN1_conn passthrough=yes \
per-connection-classifier=both-addresses-and-ports:8/1
add action=mark-connection chain=prerouting dst-address-type=!local \
in-interface-list=LOCAL new-connection-mark=WAN2_conn passthrough=yes \
per-connection-classifier=both-addresses-and-ports:8/2
add action=mark-connection chain=prerouting dst-address-type=!local \
in-interface-list=LOCAL new-connection-mark=WAN3_conn passthrough=yes \
per-connection-classifier=both-addresses-and-ports:8/3
add action=mark-connection chain=prerouting dst-address-type=!local \
in-interface-list=LOCAL new-connection-mark=WAN4_conn passthrough=yes \
per-connection-classifier=both-addresses-and-ports:8/4
add action=mark-connection chain=prerouting dst-address-type=!local \
in-interface-list=LOCAL new-connection-mark=WAN4_conn passthrough=yes \
per-connection-classifier=both-addresses-and-ports:8/5
add action=mark-connection chain=prerouting dst-address-type=!local \
in-interface-list=LOCAL new-connection-mark=WAN5_conn passthrough=yes \
per-connection-classifier=both-addresses-and-ports:8/6
add action=mark-connection chain=prerouting connection-rate=0-4294967295 \
dst-address-type=!local in-interface-list=LOCAL new-connection-mark=\
WAN5_conn passthrough=yes per-connection-classifier=\
both-addresses-and-ports:8/7
add action=mark-routing chain=prerouting comment=\
"PREROUTING MARK CONNECTION DHCP BRIDGE" connection-mark=WAN1_conn \
new-routing-mark=to_WAN1 passthrough=yes
add action=mark-routing chain=prerouting connection-mark=WAN2_conn \
new-routing-mark=to_WAN2 passthrough=yes
add action=mark-routing chain=prerouting connection-mark=WAN4_conn \
new-routing-mark=to_WAN4 passthrough=yes
add action=mark-routing chain=prerouting connection-mark=WAN3_conn \
new-routing-mark=to_WAN3 passthrough=yes
add action=mark-routing chain=prerouting connection-mark=WAN5_conn \
new-routing-mark=to_WAN5 passthrough=yes
/ip firewall nat
add action=masquerade chain=srcnat comment=WAN1-----50MBPS out-interface=\
ether1-50MBPS
add action=masquerade chain=srcnat comment=WAN2-----300MBPS out-interface=\
ether2-300MBPS
add action=masquerade chain=srcnat comment=WAN3-----300MBPS out-interface=\
ether3-300MBPS
add action=masquerade chain=srcnat comment=WAN4-----1GBPS out-interface=\
ether4-1GBPS
add action=masquerade chain=srcnat comment=WAN5----1GBPS out-interface=\
ether5-1GBPS
/ip route
add disabled=no distance=1 dst-address=0.0.0.0/0 gateway=192.168.10.1 \
pref-src="" routing-table=to_WAN1 scope=255 suppress-hw-offload=no \
target-scope=10
add disabled=no distance=1 dst-address=0.0.0.0/0 gateway=192.168.100.1 \
pref-src="" routing-table=to_WAN2 scope=255 suppress-hw-offload=no \
target-scope=10
add disabled=no distance=3 dst-address=0.0.0.0/0 gateway=192.168.141.1 \
pref-src="" routing-table=to_WAN3 scope=255 suppress-hw-offload=no \
target-scope=10
add disabled=no distance=1 dst-address=0.0.0.0/0 gateway=192.168.10.1 \
pref-src="" routing-table=main scope=255 suppress-hw-offload=no \
target-scope=10
add disabled=no distance=1 dst-address=0.0.0.0/0 gateway=192.168.100.1 \
pref-src="" routing-table=main scope=255 suppress-hw-offload=no \
target-scope=10
add disabled=no distance=1 dst-address=0.0.0.0/0 gateway=192.168.141.1 \
pref-src="" routing-table=main scope=255 suppress-hw-offload=no \
target-scope=10
add disabled=no distance=1 dst-address=0.0.0.0/0 gateway=192.168.109.1 \
pref-src="" routing-table=to_WAN4 scope=255 suppress-hw-offload=no \
target-scope=10
add disabled=no distance=1 dst-address=0.0.0.0/0 gateway=192.168.109.1 \
pref-src="" routing-table=main scope=255 suppress-hw-offload=no \
target-scope=10
add disabled=no distance=1 dst-address=0.0.0.0/0 gateway=ether5-1GBPS \
pref-src="" routing-table=to_WAN5 scope=255 suppress-hw-offload=no \
target-scope=10
add disabled=no distance=1 dst-address=0.0.0.0/0 gateway=ether5-1GBPS \
pref-src="" routing-table=main scope=255 suppress-hw-offload=no \
target-scope=10