Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [admin@MikroTik] > /export
- # apr/06/2021 12:31:50 by RouterOS 6.48.1
- # software id = Z8JH-JXJP
- #
- # model = RB760iGS
- # serial number = E1F10D00B988
- /interface ethernet
- set [ find default-name=ether1 ] name=LAN
- set [ find default-name=ether2 ] disabled=yes name=WAN1
- set [ find default-name=ether3 ] name=WAN2
- /interface wireless security-profiles
- set [ find default=yes ] supplicant-identity=MikroTik
- /ip firewall layer7-protocol
- add name=Twitch regexp="^.+(twitch.tv).*\$"
- add name=Youtube regexp="^.+(youtube.com).*\$"
- /ip pool
- add name=DHCP ranges=192.168.188.99-192.168.188.199
- /ip dhcp-server
- add address-pool=DHCP disabled=no interface=LAN lease-time=59m name=dhcp1
- /ip neighbor discovery-settings
- set discover-interface-list=all
- /ip address
- add address=192.168.178.2/24 interface=WAN1 network=192.168.178.0
- add address=192.168.10.2/24 interface=WAN2 network=192.168.10.0
- add address=192.168.188.254/24 interface=LAN network=192.168.188.0
- /ip arp
- add address=192.168.188.110 interface=LAN mac-address=EC:C4:0D:BD:EE:FA
- add address=192.168.188.80 interface=LAN mac-address=70:EE:50:5E:7F:E6
- add address=192.168.188.10 comment=MacMini interface=LAN mac-address=60:F8:1D:BD:A2:2A
- /ip dhcp-client
- add dhcp-options=clientid,clientid interface=LAN
- add dhcp-options=clientid,clientid interface=LAN use-peer-dns=no
- /ip dhcp-server lease
- add address=192.168.188.110 client-id=Nintendo mac-address=EC:C4:0D:BD:EE:FA server=dhcp1
- add address=192.168.188.102 client-id=1:14:3f:a6:26:4a:36 comment="TV SONY" mac-address=14:3F:A6:26:4A:36 server=dhcp1
- add address=192.168.188.199 client-id=1:30:e1:71:91:57:4a comment=HP mac-address=30:E1:71:91:57:4A server=dhcp1
- add address=192.168.188.138 client-id=1:0:23:24:3b:9b:2d comment="Pc remoto Mary" mac-address=00:23:24:3B:9B:2D server=\
- dhcp1
- /ip dhcp-server network
- add address=192.168.188.0/24 dns-server=8.8.8.8,1.1.1.1 gateway=192.168.188.254
- /ip dns
- set servers=8.8.8.8,1.1.1.1/ip firewall filter
- add action=drop chain=forward comment="Blocco Twitch a tempo" layer7-protocol=Twitch log=yes port=80,443 protocol=tcp \
- src-address=192.168.188.10 time=0s-18h30m,sun,mon,tue,wed,thu,fri,sat
- # inactive time
- add action=drop chain=forward comment="Blocco youtube" layer7-protocol=Youtube port=80,443 protocol=tcp time=\
- 22h30m-23h59m,sun,mon,tue,wed,thu,fri,sat
- # inactive time
- add action=drop chain=input comment="Blocco Nintendo" src-address=192.168.188.110 time=\
- 13h-14h,sun,mon,tue,wed,thu,fri,sat
- add action=drop chain=input comment="Blocco TV" disabled=yes src-address=192.168.188.102 time=\
- 22h30m-23h59m,sun,mon,tue,wed,thu,fri,sat
- add action=drop chain=input comment="Blocco TV mattina" src-address=192.168.188.102 time=0s-13h,sun,mon,tue,wed,thu
- # inactive time
- add action=drop chain=input comment="Blocco TV Sera" src-address=192.168.188.102 time=22h30m-23h59m,sun,mon,tue,wed,thu
- add action=drop chain=input comment="Blocco sky mattina" src-address=192.168.188.130 time=0s-13h,sun,mon,tue,wed,thu
- # inactive time
- add action=drop chain=input comment="Blocco sky Sera" src-address=192.168.188.130 time=\
- 22h30m-23h59m,sun,mon,tue,wed,thu
- /ip firewall mangle
- add action=mark-connection chain=output connection-mark=no-mark connection-state=new new-connection-mark=wan1_traffic \
- out-interface=WAN1 passthrough=yes
- add action=mark-connection chain=output connection-mark=no-mark connection-state=new new-connection-mark=wan2_traffic \
- out-interface=WAN2 passthrough=yes
- add action=mark-routing chain=output connection-mark=wan1_traffic new-routing-mark=vs_wan1 out-interface=WAN1 \
- passthrough=yes
- add action=mark-routing chain=output connection-mark=wan2_traffic new-routing-mark=vs_wan2 out-interface=WAN2 \
- passthrough=yes
- /ip firewall nat
- add action=masquerade chain=srcnat out-interface=WAN1
- add action=masquerade chain=srcnat out-interface=WAN2
- /ip route
- add check-gateway=ping distance=1 gateway=8.8.8.8 routing-mark=vs_wan1
- add check-gateway=ping distance=1 gateway=1.1.1.1 routing-mark=vs_wan1
- add check-gateway=ping distance=1 gateway=1.1.1.1 routing-mark=vs_wan2
- add check-gateway=ping distance=1 gateway=8.8.8.8 routing-mark=vs_wan2
- add check-gateway=ping distance=1 gateway=192.168.178.1
- add distance=2 gateway=192.168.10.1
- add distance=1 dst-address=8.8.8.8/32 gateway=192.168.178.1 scope=10
- add distance=1 dst-address=8.8.8.8/32 gateway=192.168.10.1 scope=10
- /system clock
- set time-zone-name=Europe/Rome
- /system ntp client
- set enabled=yes primary-ntp=51.38.27.129 secondary-ntp=194.0.5.123
- /system ntp server
- set broadcast=yes enabled=yes/system scheduler
- add interval=10s name=schedule1 on-event="#set variables\r\
- \n :local pingcount 10\r\
- \n :local ipA 192.168.1178.2\r\
- \n :local GatewayA 192.168.178.1\r\
- \n :global state no\r\
- \n \r\
- \n #ping gateways with src\r\
- \n :local pingresultA [/ping 8.8.8.8 src-address=\$ipA count=\$pingcount]\r\
- \n \r\
- \n #if link_A is UP then:\r\
- \n :if (\$pingresultA=\$pingcount) do={\r\
- \n ip route set [/ip route find dst-address=0.0.0.0/0] gateway=192.168.178.1}" policy=\
- ftp,reboot,read,write,policy,test,password,sniff,sensitive start-date=jan/02/1970 start-time=00:00:01
- /system script
- add dont-require-permissions=yes name=ISP1_Down owner=admin policy=\
- ftp,reboot,read,write,policy,test,password,sniff,sensitive source=\
- "ip route set [/ip route find dst-address=0.0.0.0/0] gateway=192.168.10.1"
- add dont-require-permissions=yes name=ISP1_UP owner=admin policy=\
- ftp,reboot,read,write,policy,test,password,sniff,sensitive source="#set variables\r\
- \n :local pingcount 10\r\
- \n :local ipA 192.168.178.2\r\
- \n :local GatewayA 192.168.178.1\r\
- \n :global state no\r\
- \n \r\
- \n #ping gateways with src\r\
- \n :local pingresultA [/ping 8.8.8.8 src-address=\$ipA count=\$pingcount]\r\
- \n \r\
- \n #if link_A is UP then:\r\
- \n :if (\$pingresultA=\$pingcount) do={\r\
- \n ip route set [/ip route find dst-address=0.0.0.0/0] gateway=192.168.178.1}"
- /tool netwatch
- add down-script="p route disable [find dst-address=0.0.0.0/0 gateway=192.168.178.1]\r\
- \n:log error \"ISP_1 is down!\"\r\
- \n/ip firewall connection remove [find]" host=8.8.8.8 interval=10s up-script=\
- "p route enable [find dst-address=0.0.0.0/0 gateway=10.168.178.1]\r\
- \n:log error \"ISP_1 is up!\""
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement