# aug/28/2014 22:56:34 by RouterOS 6.7
# software id = XXXXXXXX
#
/interface bridge
add admin-mac=4C:XXXXXXXXX auto-mac=no l2mtu=1598 name=bridge-local \
protocol-mode=rstp
/interface ethernet
set [ find default-name=ether1 ] name=ether1-gateway
set [ find default-name=ether6 ] name=ether6-master-local
set [ find default-name=ether7 ] master-port=ether6-master-local name=\
ether7-slave-local
set [ find default-name=ether8 ] master-port=ether6-master-local name=\
ether8-slave-local
set [ find default-name=ether9 ] master-port=ether6-master-local name=\
ether9-slave-local
set [ find default-name=ether10 ] master-port=ether6-master-local name=\
ether10-slave-local
set [ find default-name=sfp1 ] disabled=yes name=sfp1-gateway
/interface pptp-server
add name="Home VPN" user=""
/interface pptp-client
add connect-to=us-east.privateinternetaccess.com disabled=no max-mru=1400 \
max-mtu=1400 name="Transmission PIA VPN" password=XXXXXXXXXXXXXXXX user=\
XXXXXXXXXXX
/ip neighbor discovery
set ether1-gateway discover=no
set sfp1-gateway discover=no
/ip hotspot user profile
set [ find default=yes ] idle-timeout=none keepalive-timeout=2m \
mac-cookie-timeout=3d
/ip ipsec proposal
set [ find default=yes ] enc-algorithms=3des,aes-128-cbc pfs-group=none
/ip pool
add name=pool2 ranges=10.10.0.1
add name=VPN-Pool ranges=10.10.10.50-10.10.10.254
add name=dhcp_pool2 ranges=67.XXXXXXX-67.XXXXXX
add name=dhcp_pool1 next-pool=pool2 ranges=10.10.10.2-10.10.10.254
/ip dhcp-server
add address-pool=dhcp_pool1 disabled=no interface=bridge-local lease-time=1w \
name=dhcp1
/port
set 0 name=serial0
/ppp profile
add local-address=10.10.10.1 name="Home VPN VPS" remote-address=VPN-Pool
set 2 dns-server=8.8.8.8 local-address=10.10.10.1 remote-address=VPN-Pool \
wins-server=8.8.4.4
/interface bridge port
add bridge=bridge-local interface=ether2
add bridge=bridge-local interface=ether3
add bridge=bridge-local interface=ether4
add bridge=bridge-local interface=ether5
add bridge=bridge-local interface=ether6-master-local
/interface ethernet switch vlan
add ports=ether6-master-local,ether7-slave-local switch=switch2 vlan-id=20
/interface l2tp-server server
set enabled=yes
/interface ovpn-server server
set enabled=yes
/interface pptp-server server
set default-profile="Home VPN VPS" enabled=yes
/ip address
add address=192.168.88.1/24 comment="default configuration" disabled=yes \
interface=bridge-local network=192.168.88.0
add address=10.10.10.1/24 interface=bridge-local network=10.10.10.0
/ip arp
add address=10.10.10.1 comment=ARP interface=bridge-local mac-address=\
00:90:F5:EC:2A:05
add address=10.10.10.2 comment=Plex interface=bridge-local mac-address=\
02:A6:54:00:09:0B
add address=10.10.10.5 comment=Transmission interface=bridge-local \
mac-address=02:39:CF:00:11:0B
add address=10.10.10.3 comment=CouchPotato interface=bridge-local \
mac-address=02:22:9D:00:0A:0B
add address=10.10.10.4 comment=SickBeard interface=bridge-local mac-address=\
02:09:2F:00:10:0B
add address=10.10.10.6 comment=BTSync interface=bridge-local mac-address=\
02:55:CB:00:0D:0B
add address=10.10.10.7 comment=ownClowd interface=bridge-local mac-address=\
0C:77:1A:31:EB:CA
add address=10.10.10.8 comment=CrashPlan interface=bridge-local mac-address=\
30:46:9A:46:A0:75
add address=10.10.10.20 comment=FreeNAS interface=bridge-local mac-address=\
BC:5F:F4:E7:9B:36
add address=10.10.10.100 comment="Asus RT" interface=bridge-local \
mac-address=74:D0:2B:42:FE:38
/ip dhcp-client
add comment="default configuration" dhcp-options=hostname,clientid disabled=\
no interface=sfp1-gateway
add comment="default configuration" dhcp-options=hostname,clientid disabled=\
no interface=ether1-gateway
/ip dhcp-server config
set store-leases-disk=immediately
/ip dhcp-server lease
add address=10.10.10.20 client-id=1:bc:5f:f4:e7:9b:36 comment=FreeNAS \
mac-address=BC:5F:F4:E7:9B:36 server=dhcp1
/ip dhcp-server network
add address=10.10.10.0/24 dns-server=10.10.10.1 gateway=10.10.10.1
add address=67.87.240.0/21 gateway=67.XXXXXXXXX
/ip dns
set allow-remote-requests=yes servers=8.8.8.8,8.8.4.4
/ip dns static
add address=192.168.88.1 name=router
/ip firewall filter
add chain=input comment="default configuration" protocol=icmp
add chain=input comment="default configuration" connection-state=established
add chain=input comment="default configuration" connection-state=related
add action=drop chain=input comment="default configuration" in-interface=\
sfp1-gateway
add action=drop chain=input comment="default configuration" in-interface=\
ether1-gateway
add chain=forward comment="default configuration" connection-state=\
established
add chain=forward comment="default configuration" connection-state=related
add action=drop chain=forward comment="default configuration" \
connection-state=invalid
add action=add-dst-to-address-list address-list=10.10.10.2 chain=forward \
dst-port=32400 in-interface=ether1-gateway protocol=tcp src-address=\
67.XXXXXXXXXXX
/ip firewall mangle
add action=mark-routing chain=prerouting new-routing-mark=\
"Transmission PIA VPN" src-address=10.10.10.5
/ip firewall nat
add action=masquerade chain=srcnat comment="default configuration" \
out-interface=sfp1-gateway
add action=masquerade chain=srcnat comment="default configuration" \
out-interface=ether1-gateway to-addresses=0.0.0.0
add action=masquerade chain=srcnat out-interface="Transmission PIA VPN"
add action=dst-nat chain=dstnat comment=Plex dst-address=67.XXXXXXXXXX \
dst-port=32400 in-interface=ether1-gateway protocol=tcp to-addresses=\
10.10.10.2 to-ports=32400
/ip ipsec peer
add enc-algorithm=3des exchange-mode=main-l2tp generate-policy=port-override \
nat-traversal=yes secret=XXXXXXXXX
add enc-algorithm=3des generate-policy=port-override secret=123Gandara
/ip proxy
set cache-on-disk=yes enabled=yes
/ip route
add distance=1 gateway="Transmission PIA VPN" routing-mark=\
"Transmission PIA VPN"
/ip upnp
set enabled=yes
/ip upnp interfaces
add interface=bridge-local type=internal
/lcd
set backlight-timeout=never default-screen=stats-all
/lcd pin
set pin-number=0364
/lcd interface
set sfp1-gateway interface=sfp1-gateway
set ether1-gateway interface=ether1-gateway
set ether2 interface=ether2
set ether3 interface=ether3
set ether4 interface=ether4
set ether5 interface=ether5
set ether6-master-local interface=ether6-master-local
set ether7-slave-local interface=ether7-slave-local
set ether8-slave-local interface=ether8-slave-local
set ether9-slave-local interface=ether9-slave-local
set ether10-slave-local interface=ether10-slave-local
/ppp secret
add name=XXXXXXXXX password=XXXXXXXXXX
add name=XXXXXXXXXpassword=XXXXXXXXX profile="Home VPN VPS" service=pptp
/system clock
set time-zone-name=America/New_York
/system ntp client
set enabled=yes mode=unicast primary-ntp=17.171.4.33
/system scheduler
add interval=1m name="DDNS Scheduller " on-event="DDNS No-IP" policy=\
ftp,reboot,read,write,policy,test,winbox,password,sniff,sensitive,api \
start-time=startup
/system script
add name="DDNS No-IP" policy=\
ftp,reboot,read,write,policy,test,winbox,password,sniff,sensitive,api \
source="# No-IP automatic Dynamic DNS update\r\
\n\r\
\n#--------------- Change Values in this section to match your setup -----\
-------------\r\
\n\r\
\n# No-IP User account info\r\
\n:local noipuser \"XXXXXXXXXXXXXX\";\r\
\n:local noippass \"XXXXXXXXXXXXXX\";\r\
\n\r\
\n# Set the hostname or label of network to be updated.\r\
\n:local noiphost \"XXXXXXXXXX.com\";\r\
\n\r\
\n# Change to the name of interface that gets the dynamic IP address\r\
\n:local inetinterface \"ether1-gateway\";\r\
\n\r\
\n#-----------------------------------------------------------------------\
-------------\r\
\n# No more changes need\r\
\n\r\
\n:global previousIP;\r\
\n\r\
\n:if ([/interface get \$inetinterface value-name=running]) do={\r\
\n# Get the current IP on the interface\r\
\n :local currentIP [/ip address get [find interface=\"\$inetinterface\"\
\_disabled=no] address];\r\
\n\r\
\n# Strip the net mask off the IP address\r\
\n :for i from=( [:len \$currentIP] - 1) to=0 do={\r\
\n :if ( [:pick \$currentIP \$i] = \"/\") do={ \r\
\n :set currentIP [:pick \$currentIP 0 \$i];\r\
\n } \r\
\n }\r\
\n\r\
\n :if (\$currentIP != \$previousIP) do={\r\
\n :log info \"No-IP: Current IP \$currentIP is not equal to previous\
\_IP, update needed\";\r\
\n :set previousIP \$currentIP;\r\
\n :local url \"http://dynupdate.no-ip.com/nic/update\\3Fmyip=\$curre\
ntIP\";\r\
\n :log info \"No-IP: Sending update for \$noiphost\";\r\
\n /tool fetch url=(\$url . \"&hostname=\$noiphost\") user=\$noipuser\
\_password=\$noippass mode=http dst-path=(\"no-ip_ddns_update-\" . \$host \
. \".txt\")\r\
\n :log info \"No-IP: Host \$noiphost updated on No-IP with IP \$curr\
entIP\";\r\
\n \r\
\n } else={\r\
\n :log info \"No-IP: Previous IP \$previousIP is equal to current IP, n\
o update needed\";\r\
\n }\r\
\n} else={\r\
\n :log info \"No-IP: \$inetinterface is not currently running, so there\
fore will not update.\";\r\
\n}"
/tool graphing interface
add interface="Transmission PIA VPN"
add interface="Home VPN"
add interface=ether1-gateway
/tool mac-server
set [ find default=yes ] disabled=yes
add interface=ether2
add interface=ether3
add interface=ether4
add interface=ether5
add interface=ether6-master-local
add interface=ether7-slave-local
add interface=ether8-slave-local
add interface=ether9-slave-local
add interface=ether10-slave-local
add interface=bridge-local
/tool mac-server mac-winbox
set [ find default=yes ] disabled=yes
add interface=ether2
add interface=ether3
add interface=ether4
add interface=ether5
add interface=ether6-master-local
add interface=ether7-slave-local
add interface=ether8-slave-local
add interface=ether9-slave-local
add interface=ether10-slave-local
add interface=bridge-local
/tool traffic-monitor
add interface="Transmission PIA VPN" name="Transmission VPN In" threshold=0 \
traffic=received trigger=always
add interface="Transmission PIA VPN" name="Transmission VPN Out" threshold=0 \
trigger=always
add interface=ether1-gateway name="Gateway Out" threshold=0 trigger=always