How to Give Service from any isp to DHCP User | Recursive setting dhcp service out from lan



How to Give Service from any isp to DHCP User | Recursive setting dhcp service out from lan

How to Give Service from any isp to DHCP User | Recursive setting dhcp service out from lan

How to Give Service from any isp to DHCP User | Recursive setting dhcp service out from lan

Script:

/interface ethernet
set [ find default-name=ether5 ] name=LAN-Out
set [ find default-name=ether1 ] name=WAN1
set [ find default-name=ether2 ] name=WAN2

/ip address
add address=192.168.101.2/24 interface=WAN1 network=192.168.101.0
add address=192.168.102.2/24 interface=WAN2 network=192.168.102.0
add address=192.168.0.1/24 interface=LAN-Out network=192.168.0.0

/ip dns
set allow-remote-requests=yes servers=8.8.8.8,8.8.4.4
/ip firewall address-list
add address=14.14.14.2-14.14.14.254 list=ISP-1
add address=15.15.15.2-15.15.15.254 list=ISP-2

/ip firewall mangle
add action=mark-routing chain=prerouting new-routing-mark=to_Isp1
passthrough=yes src-address-list=ISP-1
add action=mark-routing chain=prerouting new-routing-mark=to_Isp2
passthrough=yes src-address-list=ISP-2

/ip firewall nat
add action=masquerade chain=srcnat src-address-list=ISP-1
add action=masquerade chain=srcnat src-address-list=ISP-2
/ip route
add check-gateway=ping comment=”(2nd)Recursive WAN1″ distance=1 gateway=
8.8.8.8 routing-mark=to_Isp1 target-scope=30
add comment=”(3rd)Isp2 Fail to Isp1″ distance=3 gateway=192.168.102.1
routing-mark=to_Isp1
add check-gateway=ping comment=”(2nd)Recursive WAN2″ distance=1 gateway=
8.8.4.4 routing-mark=to_Isp2 target-scope=30
add comment=”(3rd)Isp1 Fail to Isp2″ distance=2 gateway=192.168.101.1
routing-mark=to_Isp2
add comment=”(1st)DNS+Gatway WAN2″ distance=1 dst-address=8.8.4.4/32 gateway=
192.168.102.1
add comment=”(1st)DNS+Gatway WAN1″ distance=1 dst-address=8.8.8.8/32 gateway=
192.168.101.1

Technical Ahmad

#mikrotik
#dhcpserver
#recursive .

Comments are closed.