Code: Select all
/interface bridge
add name=Bridge-Wifi/HotSpot
/interface ethernet
set [ find default-name=ether4 ] comment=Eth4 name=LAN
set [ find default-name=ether1 ] comment=Eth1 name=WAN1
set [ find default-name=ether2 ] comment=Eth2 name=WAN2
set [ find default-name=ether3 ] comment=Eth3 name=WAN3
/ip neighbor discovery
set LAN comment=Eth4
set WAN1 comment=Eth1
set WAN2 comment=Eth2
set WAN3 comment=Eth3
/interface wireless security-profiles
set [ find default=yes ] supplicant-identity=MikroTik
/ip pool
add name=dhcp_pool1 ranges=192.168.1.1-192.168.1.253
add name=dhcp_pool2 ranges=10.5.50.1-10.5.50.199,10.5.50.210-10.5.50.254
/ip dhcp-server
add address-pool=dhcp_pool1 disabled=no interface=LAN name=dhcp1
add address-pool=dhcp_pool2 disabled=no interface=Bridge-Wifi/HotSpot name=\
dhcp2
/interface bridge port
add bridge=Bridge-Wifi/HotSpot interface=ether5
add bridge=Bridge-Wifi/HotSpot interface=ether6
add bridge=Bridge-Wifi/HotSpot interface=ether7
add bridge=Bridge-Wifi/HotSpot interface=ether8
add bridge=Bridge-Wifi/HotSpot interface=ether9
add bridge=Bridge-Wifi/HotSpot interface=ether10
/ip address
add address=192.168.2.2/24 interface=WAN1 network=192.168.2.0
add address=192.168.3.2/24 interface=WAN2 network=192.168.3.0
add address=192.168.4.2/24 interface=WAN3 network=192.168.4.0
add address=192.168.1.254/24 interface=LAN network=192.168.1.0
add address=10.5.50.200/24 interface=Bridge-Wifi/HotSpot network=10.5.50.0
/ip cloud
set ddns-enabled=yes
/ip dhcp-server lease
add address=10.5.50.150 mac-address=B8:27:EB:B7:A3:EC
/ip dhcp-server network
add address=10.5.50.0/24 dns-server=10.5.50.200 gateway=10.5.50.200
add address=192.168.1.0/24 dns-server=192.168.1.254 gateway=192.168.1.254
/ip dns
set allow-remote-requests=yes servers=208.67.220.220,208.67.222.222
/ip firewall mangle
add action=mark-connection chain=input in-interface=WAN1 new-connection-mark=\
WAN2_conn
add action=mark-connection chain=input in-interface=WAN2 new-connection-mark=\
WAN3_conn
add action=mark-connection chain=input in-interface=WAN3 new-connection-mark=\
WAN4_conn
add action=mark-routing chain=output connection-mark=WAN2_conn \
new-routing-mark=to_WAN2
add action=mark-routing chain=output connection-mark=WAN3_conn \
new-routing-mark=to_WAN3
add action=mark-routing chain=output connection-mark=WAN4_conn \
new-routing-mark=to_WAN4
add chain=prerouting dst-address=192.168.2.0/24 in-interface=LAN
add chain=prerouting dst-address=192.168.2.0/24 in-interface=\
Bridge-Wifi/HotSpot
add chain=prerouting dst-address=192.168.3.0/24 in-interface=LAN
add chain=prerouting dst-address=192.168.3.0/24 in-interface=\
Bridge-Wifi/HotSpot
add chain=prerouting dst-address=192.168.4.0/24 in-interface=LAN
add chain=prerouting dst-address=192.168.4.0/24 in-interface=\
Bridge-Wifi/HotSpot
add action=mark-connection chain=prerouting dst-address-type=!local \
in-interface=LAN new-connection-mark=WAN2_conn per-connection-classifier=\
both-addresses-and-ports:3/0
add action=mark-connection chain=prerouting dst-address-type=!local \
in-interface=Bridge-Wifi/HotSpot new-connection-mark=WAN2_conn \
per-connection-classifier=both-addresses-and-ports:3/0
add action=mark-connection chain=prerouting dst-address-type=!local \
in-interface=LAN new-connection-mark=WAN3_conn per-connection-classifier=\
both-addresses-and-ports:3/1
add action=mark-connection chain=prerouting dst-address-type=!local \
in-interface=Bridge-Wifi/HotSpot new-connection-mark=WAN3_conn \
per-connection-classifier=both-addresses-and-ports:3/1
add action=mark-connection chain=prerouting dst-address-type=!local \
in-interface=LAN new-connection-mark=WAN4_conn per-connection-classifier=\
both-addresses-and-ports:3/2
add action=mark-connection chain=prerouting dst-address-type=!local \
in-interface=Bridge-Wifi/HotSpot new-connection-mark=WAN4_conn \
per-connection-classifier=both-addresses-and-ports:3/2
add action=mark-routing chain=prerouting connection-mark=WAN2_conn \
in-interface=LAN new-routing-mark=to_WAN2
add action=mark-routing chain=prerouting connection-mark=WAN2_conn \
in-interface=Bridge-Wifi/HotSpot new-routing-mark=to_WAN2
add action=mark-routing chain=prerouting connection-mark=WAN3_conn \
in-interface=LAN new-routing-mark=to_WAN3
add action=mark-routing chain=prerouting connection-mark=WAN3_conn \
in-interface=Bridge-Wifi/HotSpot new-routing-mark=to_WAN3
add action=mark-routing chain=prerouting connection-mark=WAN4_conn \
in-interface=LAN new-routing-mark=to_WAN4
add action=mark-routing chain=prerouting connection-mark=WAN4_conn \
in-interface=Bridge-Wifi/HotSpot new-routing-mark=to_WAN4
/ip firewall nat
add action=masquerade chain=srcnat out-interface=WAN1
add action=masquerade chain=srcnat out-interface=WAN2
add action=masquerade chain=srcnat out-interface=WAN3
/ip route
add check-gateway=ping distance=1 gateway=192.168.2.1 routing-mark=to_WAN2
add check-gateway=ping distance=1 gateway=192.168.3.1 routing-mark=to_WAN3
add check-gateway=ping distance=1 gateway=192.168.4.1 routing-mark=to_WAN4
add check-gateway=ping distance=1 gateway=192.168.2.1
add check-gateway=ping distance=2 gateway=192.168.3.1
add check-gateway=ping distance=3 gateway=192.168.4.1
/system clock
set time-zone-name=Europe/Rome
/system identity
set name=MikroTik-MonasteroSanGiuseppe
i've this problems:
i have 3 Wan with pcc and 2 subnets (1 for lan and 1 for wifi hotspot)
1° problem: i can't reach from Lan a specific ip of the second subnets (wifi subnet) (can't reach 10.5.50.150 from LAN 192.168.1.xx)
2° problem some website say to me json problem (i think depend at pcc wrong configuration).. i must change something
3° i don't know how make port forwarding from external ip to internal LAN IP with different ports:
- external request to 8081 must go to ip 192.168.1.250 (lan ip range)
- and from 8080 must go to ip 192.168.1.251 (lan ip range)
Someone can help me please? thanks