Настройки Микротика ЦО:
Код: Выделить всё
/interface ethernet
set [ find default-name=ether1 ] name=ether1-WAN1
set [ find default-name=ether2 ] name=ether2-WAN2
set [ find default-name=ether3 ] name=ether3-WAN3
set [ find default-name=ether4 ] name=ether4-WAN4
set [ find default-name=ether13 ] name=ether13-LAN
/interface l2tp-server
add name=Office1_to_HQ user=Office1
add name=Office2_to_HQ user=Office2
add name=Office3_to_HQ user=Office3
add name=Office4_to_HQ user=Office4
add name=Office5_to_HQ user=Office5
add name=Office6_to_HQ user=Office6
add name=Office7_to_HQ user=Office7
add name=Office8_to_HQ user=Office8
/ip neighbor discovery
set ether1-WAN1 discover=no
set ether2-WAN2 discover=no
set ether3-WAN3 discover=no
set ether4-WAN4 discover=no
set ether5 discover=no
set ether6 discover=no
set ether7 discover=no
set ether8 discover=no
set ether9 discover=no
set ether10 discover=no
set ether11 discover=no
set ether12 discover=no
/interface bonding
add mode=802.3ad name=CISCO3750 slaves=ether13-LAN,ether12,ether11,ether10 \
transmit-hash-policy=layer-2-and-3
/interface vlan
add interface=CISCO3750 name=VLAN0 vlan-id=10
add interface=CISCO3750 name=VLAN2 vlan-id=2
add interface=CISCO3750 name=VLAN3 vlan-id=3
add interface=CISCO3750 name=VLAN15 vlan-id=15
add interface=CISCO3750 name=VLAN100 vlan-id=100
add interface=CISCO3750 name=VLAN101 vlan-id=101
add interface=CISCO3750 name=VLAN102 vlan-id=102
add interface=CISCO3750 name=VLAN210 vlan-id=210
/interface list
add name=lst-WAN
/ip pool
add name=pool-VLAN0 ranges=192.168.0.51-192.168.0.250
add name=pool-VLAN2 ranges=192.168.2.6-192.168.2.250
add name=pool-VLAN3 ranges=192.168.3.6-192.168.3.250
add name=pool-VLAN15 ranges=192.168.15.6-192.168.15.250
add name=pool-VLAN100 ranges=192.168.100.6-192.168.100.250
add name=pool-VLAN101 ranges=192.168.101.6-192.168.101.250
add name=pool-VLAN102 ranges=192.168.102.6-192.168.102.250
/ip dhcp-server
add add-arp=yes address-pool=pool-VLAN0 always-broadcast=yes authoritative=\
yes disabled=no interface=VLAN0 name=DHCP-VLAN0
add add-arp=yes address-pool=pool-VLAN2 always-broadcast=yes authoritative=\
yes disabled=no interface=VLAN2 name=DHCP-VLAN2
add add-arp=yes address-pool=pool-VLAN3 always-broadcast=yes authoritative=\
yes disabled=no interface=VLAN3 name=DHCP-VLAN3
add add-arp=yes address-pool=pool-VLAN15 always-broadcast=yes authoritative=\
yes disabled=no interface=VLAN15 name=DHCP-VLAN15
add add-arp=yes address-pool=pool-VLAN100 always-broadcast=yes authoritative=\
yes disabled=no interface=VLAN100 name=DHCP-VLAN100
add add-arp=yes address-pool=pool-VLAN101 always-broadcast=yes authoritative=\
yes disabled=no interface=VLAN101 name=DHCP-VLAN101
add add-arp=yes address-pool=pool-VLAN102 always-broadcast=yes authoritative=\
yes disabled=no interface=VLAN102 name=DHCP-VLAN102
/ppp profile
set *FFFFFFFE use-compression=yes
/queue type
add kind=pcq name=pcq-download-1M pcq-classifier=dst-address \
pcq-dst-address6-mask=64 pcq-rate=1M pcq-src-address6-mask=64
add kind=pcq name=pcq-upload-1M pcq-classifier=src-address \
pcq-dst-address6-mask=64 pcq-rate=1M pcq-src-address6-mask=64
/queue simple
add max-limit=50M/50M name=GuestWiFi-limit-1M queue=\
pcq-upload-1M/pcq-download-1M target=192.168.3.0/24
/routing ospf instance
set [ find default=yes ] disabled=yes router-id=192.168.0.0
/interface bridge port
add
/interface l2tp-server server
set authentication=mschap2 enabled=yes
/interface list member
add interface=ether1-WAN1 list=lst-WAN
add interface=ether2-WAN2 list=lst-WAN
add interface=ether3-WAN3 list=lst-WAN
add interface=ether4-WAN4 list=lst-WAN
/ip address
add address=192.168.220.1/24 interface=ether5 network=192.168.220.0
add address=192.168.210.1/24 interface=VLAN210 network=192.168.210.0
add address=1.1.1.1 interface=ether1-WAN1 network=5.5.5.5
add address=2.2.2.2 interface=ether2-WAN2 network=5.5.5.5
add address=3.3.3.3 interface=ether3-WAN3 network=5.5.5.5
add address=4.4.4.4 interface=ether4-WAN4 network=5.5.5.5
add address=192.168.0.1/24 interface=VLAN0 network=192.168.0.0
add address=192.168.2.1/24 interface=VLAN2 network=192.168.2.0
add address=192.168.3.1/24 interface=VLAN3 network=192.168.3.0
add address=192.168.15.1/24 interface=VLAN15 network=192.168.15.0
add address=192.168.100.1/24 interface=VLAN100 network=192.168.100.0
add address=192.168.101.1/24 interface=VLAN101 network=192.168.101.0
add address=192.168.102.1/24 interface=VLAN102 network=192.168.102.0
/ip dhcp-server network
add address=192.168.0.0/24 dns-server=192.168.0.2,192.168.0.1 gateway=\
192.168.0.2 netmask=24
add address=192.168.2.0/24 dns-server=192.168.2.2,192.168.2.1 gateway=\
192.168.2.2 netmask=24
/ip dns
set allow-remote-requests=yes servers=\
192.168.210.1,192.168.210.2
/ip firewall address-list
add address=192.168.0.21 list=HQ1
add address=192.168.0.22 list=HQ1
add address=192.168.0.9 list=HQ1
add address=192.168.0.50-192.168.0.250 list=HQ2
add address=192.168.2.0/24 list=HQ2
add address=192.168.3.0/24 list=HQ2
add address=192.168.102.0/24 list=HQ2
add address=192.168.0.23 list=HQ2
add address=192.168.0.24 list=HQ2
add address=192.168.0.25 list=HQ3
add address=192.168.0.26 list=HQ3
add address=192.168.0.27 list=HQ4
add address=192.168.0.71 list=HQ3
add address=192.168.0.28 list=HQ4
add address=192.168.0.47 list=HQ4
add address=192.168.0.90 list=HQ4
add address=0.0.0.0/8 list=BOGON
add address=10.0.0.0/8 list=BOGON
add address=100.64.0.0/10 list=BOGON
add address=127.0.0.0/8 list=BOGON
add address=169.254.0.0/16 list=BOGON
add address=172.16.0.0/12 list=BOGON
add address=192.0.0.0/24 list=BOGON
add address=192.0.2.0/24 list=BOGON
add address=192.168.0.0/16 list=BOGON
add address=198.18.0.0/15 list=BOGON
add address=198.51.100.0/24 list=BOGON
add address=203.0.113.0/24 list=BOGON
add address=224.0.0.0/4 list=BOGON
add address=240.0.0.0/4 list=BOGON
/ip firewall filter
add action=drop chain=input comment="BOGON Drop" in-interface=ether1-WAN1 \
src-address-list=BOGON
add action=drop chain=input comment="BOGON Drop" in-interface=ether4-WAN4 \
src-address-list=BOGON
add action=drop chain=input comment="BOGON Drop" in-interface=ether3-WAN3 \
src-address-list=BOGON
add action=drop chain=input comment="BOGON Drop" in-interface=ether2-WAN2 \
src-address-list=BOGON
add action=accept chain=input comment=Ping protocol=icmp
add action=accept chain=input comment=DNS dst-port=53 in-interface=CISCO3750 \
protocol=udp
add action=accept chain=input comment=L2TP dst-port=1701 in-interface=\
ether1-WAN1 protocol=udp
add action=accept chain=forward out-interface=all-ppp
add action=accept chain=input connection-state=established,related
add action=accept chain=input comment=\
"Access to Mikrotik only from our local network" src-address=\
192.168.0.0/16
add action=accept chain=forward connection-state=established,related
add action=accept chain=forward in-interface=all-ppp
add action=drop chain=input connection-state=invalid
add action=drop chain=input connection-state=new in-interface=!CISCO3750
/ip firewall mangle
add action=mark-connection chain=prerouting new-connection-mark=con-WAN1 \
src-address-list=HQ1
add action=mark-connection chain=prerouting new-connection-mark=con-WAN2 \
src-address-list=HQ2
add action=mark-connection chain=prerouting new-connection-mark=con-WAN3 \
src-address-list=HQ3
add action=mark-connection chain=prerouting new-connection-mark=con-WAN4 \
src-address-list=HQ4
add action=mark-routing chain=prerouting connection-mark=con-WAN1 \
in-interface-list=!lst-WAN new-routing-mark=WAN1 passthrough=yes \
src-address-list=HQ1
add action=mark-routing chain=prerouting connection-mark=con-WAN2 \
in-interface-list=!lst-WAN new-routing-mark=WAN2 passthrough=yes \
src-address-list=HQ2
add action=mark-routing chain=prerouting connection-mark=con-WAN3 \
in-interface-list=!lst-WAN new-routing-mark=WAN3 passthrough=yes \
src-address-list=HQ3
add action=mark-routing chain=prerouting connection-mark=con-WAN4 \
in-interface-list=!lst-WAN new-routing-mark=WAN4 passthrough=yes \
src-address-list=HQ4
add action=mark-routing chain=prerouting dst-address=192.168.32.0/24 \
new-routing-mark=rm_to_Office2 passthrough=yes
add action=mark-routing chain=prerouting dst-address=192.168.37.0/24 \
new-routing-mark=rm_to_Office4 passthrough=yes
add action=mark-routing chain=prerouting dst-address=192.168.34.0/24 \
new-routing-mark=rm_to_Office5 passthrough=yes
add action=mark-routing chain=prerouting dst-address=192.168.38.0/24 \
new-routing-mark=rm_to_Office8 passthrough=yes
add action=mark-routing chain=prerouting dst-address=192.168.36.0/24 \
new-routing-mark=rm_to_Office7 passthrough=yes
add action=mark-routing chain=prerouting dst-address=192.168.35.0/24 \
new-routing-mark=rm_to_Office6 passthrough=yes
add action=mark-routing chain=prerouting dst-address=192.168.31.0/24 \
new-routing-mark=rm_to_Office1 passthrough=yes
add action=mark-routing chain=prerouting dst-address=192.168.39.0/24 \
new-routing-mark=rm_to_Office3 passthrough=yes
/ip firewall nat
add action=netmap chain=dstnat comment="Emergency RDP 1C" dst-port=60086 \
in-interface=ether3-WAN3 protocol=tcp to-addresses=192.168.0.4 to-ports=\
3389
add action=netmap chain=dstnat comment="Emergency RDP Autodealer" dst-port=\
60087 in-interface=ether4-WAN4 protocol=tcp to-addresses=192.168.0.241 \
to-ports=3389
add action=netmap chain=dstnat comment="to SecurOS Mobile Client" dst-port=\
7777 in-interface=ether2-WAN2 protocol=tcp to-addresses=192.168.102.10 \
to-ports=7777
add action=masquerade chain=srcnat out-interface=all-ppp
add action=src-nat chain=srcnat out-interface=ether1-WAN1 to-addresses=\
1.1.1.1
add action=src-nat chain=srcnat out-interface=ether2-WAN2 to-addresses=\
2.2.2.2
add action=src-nat chain=srcnat out-interface=ether3-WAN3 to-addresses=\
3.3.3.3
add action=src-nat chain=srcnat out-interface=ether4-WAN4 to-addresses=\
4.4.4.4
/ip firewall raw
add action=drop chain=prerouting comment="sbl dshield" dst-address-list=\
"sbl dshield"
add action=drop chain=prerouting comment="sbl spamhaus" dst-address-list=\
"sbl spamhaus"
add action=drop chain=prerouting comment="sbl blocklist.de" dst-address-list=\
"sbl blocklist.de"
/ip route
add check-gateway=ping distance=1 gateway=5.5.5.5%ether1-WAN1 \
routing-mark=WAN1
add check-gateway=ping distance=1 gateway=5.5.5.5%ether2-WAN2 \
routing-mark=WAN2
add check-gateway=ping distance=1 gateway=5.5.5.5%ether3-WAN3 \
routing-mark=WAN3
add check-gateway=ping distance=1 gateway=5.5.5.5%ether4-WAN4 \
routing-mark=WAN4
add distance=1 gateway=Office2_to_HQ routing-mark=rm_to_Office2
add distance=1 gateway=Office1_to_HQ routing-mark=rm_to_Office1
add distance=1 gateway=Office6_to_HQ routing-mark=rm_to_Office6
add distance=1 gateway=Office7_to_HQ routing-mark=rm_to_Office7
add distance=1 gateway=Office8_to_HQ routing-mark=rm_to_Office8
add distance=1 gateway=Office5_to_HQ routing-mark=rm_to_Office5
add distance=1 gateway=Office4_to_HQ routing-mark=rm_to_Office4
add distance=1 gateway=172.16.30.9 routing-mark=rm_to_Office3
add distance=1 gateway="5.5.5.5%ether1-WAN1,5.5.5.5%ether3-WAN3,\
5.5.5.5%ether2-WAN2,5.5.5.5%ether4-WAN4"
add distance=1 dst-address=192.168.0.0/16 gateway=192.168.0.2 pref-src=\
172.16.30.1
/ip service
set telnet disabled=yes
set ftp disabled=yes
set www disabled=yes
set ssh disabled=yes
set api disabled=yes
set winbox address=192.168.0.0/24,192.168.210.0/24,192.168.220.0/24
set api-ssl disabled=yes
/ppp secret
add local-address=172.16.30.1 name=Office2 password=XXXXXXXXX \
profile=default-encryption remote-address=172.16.30.2 service=l2tp
add local-address=172.16.30.1 name=Office1 password=XXXXXXXXX \
profile=default-encryption remote-address=172.16.30.3 service=l2tp
add local-address=172.16.30.1 name=Office6 password=XXXXXXXXX \
profile=default-encryption remote-address=172.16.30.4 service=l2tp
add local-address=172.16.30.1 name=Office7 password=XXXXXXXXX \
profile=default-encryption remote-address=172.16.30.5 service=l2tp
add local-address=172.16.30.1 name=Office8 password=XXXXXXXXX profile=\
default-encryption remote-address=172.16.30.6 service=l2tp
add local-address=172.16.30.1 name=Office5 password=XXXXXXXXX profile=\
default-encryption remote-address=172.16.30.7 service=l2tp
add local-address=172.16.30.1 name=Office4 password=XXXXXXXXX \
profile=default-encryption remote-address=172.16.30.8 service=l2tp
add local-address=172.16.30.1 name=Office3 password=XXXXXXXXX profile=\
default-encryption remote-address=172.16.30.9 service=l2tp
/system clock
set time-zone-autodetect=no time-zone-name=Asia/Yekaterinburg
/system logging
set 0 disabled=yes
/system ntp client
set enabled=yes primary-ntp=88.147.254.232 secondary-ntp=88.147.254.230
/system ntp server
set enabled=yes manycast=no