Setup Multiple ISP, one with internet and one without internet (for system use only)

Good Day!

i have a scenario in office where we have two ISP’s one with internet and one without internet (leased line: for system used only). I can already ping and access the system server but cannot access internet. but it says i have internet connection.

i am new to mikrotik.

server ip is 10.1.1.60:8000 server.prompt.local
wan1 - dchp
wan2- dchp (leased line)

is it possible like this:

user can access internet but when user access the server it uses the wan2.


this is my config:

/interface ethernet
set [ find default-name=ether1 ] name=ether1-WAN1
set [ find default-name=ether2 ] name=ether2-WAN2
/ip pool
add name=dhcp_pool0 ranges=192.168.10.2-192.168.10.254
/ip dhcp-server
add address-pool=dhcp_pool0 disabled=no interface=ether4 name=dhcp1
/queue simple
add name=ether1-WAN1 target=192.168.1.0/24
add name=ether2-WAN2 target=10.10.10.0/24
add name=ether4 target=192.168.10.0/24
/ip address
add address=192.168.1.2/24 interface=ether1-WAN1 network=192.168.1.0
add address=192.168.2.251/24 interface=ether2-WAN2 network=192.168.2.0
add address=192.168.33.1/24 interface=ether4 network=192.168.10.0
/ip dhcp-server network
add address=192.168.10.0/24 gateway=192.168.10.1
/ip dns
set servers=8.8.8.8,8.8.4.4
/ip firewall mangle
add action=mark-connection chain=input in-interface=ether1-WAN1 new-connection-mark=
WAN1 passthrough=yes
add action=mark-connection chain=input in-interface=ether2-WAN2 new-connection-mark=
WAN2 passthrough=yes
add action=mark-routing chain=output connection-mark=WAN1 new-routing-mark=
WAN1 passthrough=yes
add action=mark-routing chain=output connection-mark=WAN2 new-routing-mark=
WAN2 passthrough=yes
/ip firewall nat
add action=masquerade chain=srcnat src-address=192.168.10.0/24
add action=masquerade chain=srcnat out-interface=ether1-WAN1
add action=masquerade chain=srcnat out-interface=ether2-WAN2
/ip route
add distance=1 gateway=192.168.10.1 routing-mark=WAN1
add distance=1 gateway=10.10.10.1 routing-mark=WAN2
add check-gateway=ping distance=1 gateway=192.168.1.1,10.10.10.1
Mikrotik.jpg

anyone?

If you want only WAN1 for internet access, then don’t add WAN2’s gateway to main default route, i.e. use only gateway=192.168.1.1.

And “/ip address add address=192.168.33.1/24 interface=ether4 network=192.168.10.0” doesn’t look correct either, based on the rest of config it should have address=192.168.10.1/24.

which WAN2 static route should i remove? this one “add distance=1 gateway=10.10.10.1 routing-mark=WAN2”?

thanks for the correction. i’m changing it now.

thank you mate, i think i overload the static route. hahaha.

The one with two gateways is what you don’t want to have. Or better, you want it, but only with WAN1 gateway.

i reconfig the wan2 and put “NO” to add default route. then remove the static route 0.0.0.0/24 gateway: 10.4.3.1.

thank you a lot sir. you really save my day.