Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ######################################################
- ### Ethernet
- ######################################################
- /interface ethernet
- set [ find default-name=ether1 ] name=ether1-UP-RT
- set [ find default-name=ether2 ] name=ether2-LAN
- set [ find default-name=ether3 ] master-port=ether2-LAN
- set [ find default-name=ether4 ] master-port=ether2-LAN
- set [ find default-name=ether5 ] master-port=ether2-LAN
- ######################################################
- ### WiFi
- ######################################################
- /interface wireless
- set [ find default-name=wlan1 ] name=wlan0 ampdu-priorities=0,1,2,3,4,5,6,7 antenna-mode=txa-rxb arp=disabled band=2ghz-onlyn basic-rates-a/g=6Mbps,9Mbps,12Mbps,18Mbps,24Mbps,36Mbps,48Mbps,54Mbps basic-rates-b=1Mbps,2Mbps,5.5Mbps,11Mbps channel-width=20/40mhz-Ce country=russia default-authentication=no default-forwarding=no disabled=no distance=indoors frequency=2442 hide-ssid=yes ht-basic-mcs=mcs-6,mcs-7,mcs-8,mcs-9,mcs-10,mcs-11,mcs-12,mcs-13,mcs-14,mcs-15 ht-supported-mcs=mcs-6,mcs-7,mcs-8,mcs-9,mcs-10,mcs-11,mcs-12,mcs-13,mcs-14,mcs-15,mcs-16,mcs-17,mcs-18,mcs-19,mcs-20,mcs-21,mcs-22,mcs-23 hw-retries=5 mode=ap-bridge multicast-helper=full rate-set=configured rx-chains=1 security-profile=ap-home ssid="" tx-chains=0 wireless-protocol=802.11 wmm-support=enabled wps-mode=disabled
- /interface wireless security-profiles
- set [ find default=yes ] supplicant-identity=""
- add name=ap-home authentication-types=wpa2-psk wpa2-pre-shared-key="${WPA2-PSK KEY}" group-key-update=1h mode=dynamic-keys eap-methods="" supplicant-identity=""
- /interface wireless
- add master-interface=wlan0 name=wlan-home mac-address=${wlan0 MAC + 1} ssid=Home wmm-support=enabled wps-mode=disabled disabled=no security-profile=ap-home
- add master-interface=wlan0 name=wlan-free mac-address=${wlan0 MAC + 2} ssid=Free wmm-support=enabled wps-mode=disabled disabled=yes
- ######################################################
- ### IP addresses
- ######################################################
- /ip address
- add address=169.254.13.37 interface=ether1-UP-RT network=169.254.13.37
- add address=192.168.88.1/24 interface=ether2-LAN network=192.168.88.0
- add address=192.168.0.1/24 interface=wlan-home network=192.168.0.0
- add address=192.168.1.1/24 interface=wlan-free network=192.168.1.0
- ######################################################
- ### DHCP
- ######################################################
- /ip pool
- add name=dhcp-pool-ether-lan ranges=192.168.88.10-192.168.88.254
- add name=dhcp-pool-wifi-home ranges=192.168.0.2-192.168.0.254
- add name=dhcp-pool-wifi-free ranges=192.168.1.2-192.168.1.254
- /ip dhcp-server
- add name=dhcpd-ether-lan address-pool=dhcp-pool-ether-lan interface=ether2-LAN always-broadcast=yes authoritative=yes disabled=no add-arp=yes lease-time=20w4d
- add name=dhcpd-wifi-home address-pool=dhcp-pool-wifi-home interface=wlan-home always-broadcast=yes authoritative=yes disabled=no add-arp=yes lease-time=20w4d
- add name=dhcpd-wifi-free address-pool=dhcp-pool-wifi-free interface=wlan-free always-broadcast=yes authoritative=yes disabled=no add-arp=yes lease-time=1d
- /ip dhcp-server network
- add address=192.168.88.0/24 dns-server=192.168.88.1 gateway=192.168.88.1 netmask=24 ntp-server=192.168.88.1
- add address=192.168.0.0/24 dns-server=192.168.0.1 gateway=192.168.0.1 netmask=24 ntp-server=192.168.0.1
- add address=192.168.1.0/24 dns-server=192.168.1.1 gateway=192.168.1.1 netmask=24 ntp-server=192.168.1.1
- ######################################################
- ### DNS
- ######################################################
- /ip dns
- set allow-remote-requests=yes cache-max-ttl=1d cache-size=4096KiB query-server-timeout=3s query-total-timeout=5s
- ######################################################
- ### PPPoE
- ######################################################
- /ppp profile
- add change-tcp-mss=no name=pppoe-RT only-one=no use-encryption=no
- /interface pppoe-client
- add name=pppoe-RT profile=pppoe-RT user=${PPPoE login} password=${PPPoE password} interface=ether1-UP-RT add-default-route=yes default-route-distance=200 use-peer-dns=yes keepalive-timeout=disabled disabled=no
- ######################################################
- ### WiFi::Free traffic shaper
- ######################################################
- ### download
- ### overall = 4194304
- ### per user = 4194304
- ### upload
- ### overall = 2097152
- ### per user = 262144
- /queue tree
- add name=wififree-DL parent=global queue=default max-limit=4194304
- add name=wififree-DL-pcq parent=wififree-DL queue=pcq-download-default max-limit=524288 limit-at=507904 packet-mark=wififree-P-DL
- add name=wififree-UL parent=global queue=default max-limit=2097152
- add name=wififree-UL-pcq parent=wififree-UL queue=pcq-upload-default max-limit=262144 limit-at=245760 packet-mark=wififree-P-UL
- ######################################################
- ### firewall
- ######################################################
- /ip firewall address-list
- add list=BAN address=169.254.0.0/16
- /ip firewall filter
- add chain=- comment="====" action=log
- add chain=input comment="DROP <- BANNED" action=drop src-address-list=BAN
- add chain=forward comment="DROP <=| BANNED" action=drop src-address-list=BAN
- add chain=forward comment="DROP |=> BANNED" action=drop dst-address-list=BAN
- add chain=output comment="DROP -> BANNED" action=drop dst-address-list=BAN
- add chain=- comment="====" action=log
- add chain=input comment="DROP limited broadcast" action=drop dst-address=255.255.255.255 in-interface=ether1-UP-RT
- add chain=input comment="DROP limited broadcast" action=drop dst-address=255.255.255.255 in-interface=pppoe-RT
- add chain=- comment="====" action=log
- add chain=input comment="ACCEPT incoming multicast" dst-address-type=multicast in-interface=ether1-UP-RT
- add chain=input comment="ACCEPT incoming multicast" dst-address-type=multicast in-interface=ether2-LAN
- add chain=input comment="ACCEPT incoming multicast" dst-address-type=multicast in-interface=wlan-home
- add chain=input comment="DROP incoming multicast" action=drop dst-address-type=multicast
- add chain=- comment="----" action=log
- add chain=forward comment="ACCEPT forwarded multicast" dst-address-type=multicast in-interface=ether1-UP-RT out-interface=ether2-LAN
- add chain=forward comment="ACCEPT forwarded multicast" dst-address-type=multicast in-interface=ether1-UP-RT out-interface=wlan-home
- add chain=forward comment="ACCEPT forwarded multicast" dst-address-type=multicast in-interface=ether2-LAN out-interface=ether1-UP-RT
- add chain=forward comment="ACCEPT forwarded multicast" dst-address-type=multicast in-interface=wlan-home out-interface=ether1-UP-RT
- add chain=forward comment="DROP forwarded multicast" action=drop dst-address-type=multicast
- add chain=- comment="----" action=log
- add chain=output comment="ACCEPT outgoing multicast" dst-address-type=multicast out-interface=ether1-UP-RT
- add chain=output comment="ACCEPT outgoing multicast" dst-address-type=multicast out-interface=wlan-home
- add chain=output comment="ACCEPT outgoing multicast" dst-address-type=multicast out-interface=ether2-LAN
- add chain=output comment="DROP outgoing multicast" action=drop dst-address-type=multicast
- add chain=- comment="====" action=log
- add chain=input comment="ACCEPT always MikroTik admin" dst-port=8291 protocol=tcp
- add chain=- comment="----" action=log
- add chain=input comment="ACCEPT ct::established" connection-state=established
- add chain=input comment="ACCEPT ct::related" connection-state=related
- add chain=input comment="ACCEPT icmp" protocol=icmp
- add chain=- comment="----" action=log
- add chain=input comment="ACCEPT ct::new" connection-state=new in-interface=ether2-LAN
- add chain=input comment="ACCEPT ct::new" connection-state=new in-interface=wlan-home
- add chain=input comment="ACCEPT ct::new" connection-state=new in-interface=wlan-free
- add chain=- comment="----" action=log
- add chain=input comment="DROP default input" action=drop
- add chain=- comment="====" action=log
- add chain=forward comment="ACCEPT ct::established" connection-state=established
- add chain=forward comment="ACCEPT ct::related" connection-state=related
- add chain=- comment="----" action=log
- add chain=forward comment="ACCEPT LAN -> UP-RT" in-interface=ether2-LAN out-interface=pppoe-RT
- add chain=forward comment="ACCEPT wifi home -> UP-RT" in-interface=wlan-home out-interface=pppoe-RT
- add chain=- comment="----" action=log
- add chain=forward comment="ACCEPT wifi free -> UP-RT" in-interface=wlan-free out-interface=pppoe-RT
- add chain=forward comment="DROP wifi free -> *" action=drop in-interface=wlan-free
- add chain=- comment="----" action=log
- add chain=forward comment="DROP default forward" action=drop
- add chain=- comment="====" action=log
- /ip firewall mangle
- add chain=- comment="====" action=log
- add chain=prerouting action=mark-connection in-interface=wlan-free new-connection-mark=wififree-C-UL
- add chain=prerouting action=mark-packet connection-mark=wififree-C-UL new-packet-mark=wififree-P-UL passthrough=no
- add chain=- comment="----" action=log
- add chain=postrouting action=mark-connection out-interface=wlan-free new-connection-mark=wififree-C-DL
- add chain=postrouting action=mark-packet connection-mark=wififree-C-DL new-packet-mark=wififree-P-DL passthrough=no
- add chain=- comment="====" action=log
- add chain=prerouting action=set-priority in-interface=ether1-UP-RT dst-address-type=multicast new-priority=63
- add chain=prerouting action=set-priority in-interface=ether2-LAN dst-address-type=multicast new-priority=63
- add chain=prerouting action=set-priority in-interface=wlan-home dst-address-type=multicast new-priority=63
- add chain=- comment="====" action=log
- add chain=forward action=change-mss out-interface=pppoe-RT protocol=tcp tcp-flags=syn new-mss=clamp-to-pmtu
- add chain=- comment="====" action=log
- /ip firewall nat
- add chain=- comment="====" action=log
- add chain=srcnat action=masquerade out-interface=pppoe-RT
- add chain=srcnat action=masquerade out-interface=ether2-LAN
- add chain=srcnat action=masquerade out-interface=wlan-home
- add chain=- comment="====" action=log
- add chain=dstnat action=dst-nat in-interface=pppoe-RT protocol=tcp dst-port=6881-6889,7881 to-addresses=${Torrent seeding PC}
- add chain=dstnat action=dst-nat in-interface=pppoe-RT protocol=udp dst-port=6881-6889,7881 to-addresses=${Torrent seeding PC}
- add chain=- comment="====" action=log
- /ip route
- add distance=1 dst-address=169.254.0.0/16 type=blackhole
- /ip firewall connection tracking
- set enabled=yes tcp-close-timeout=20s tcp-close-wait-timeout=20s tcp-established-timeout=3h tcp-fin-wait-timeout=20s tcp-last-ack-timeout=20s tcp-syn-received-timeout=20stcp-syn-sent-timeout=20s tcp-time-wait-timeout=20s udp-stream-timeout=2m udp-timeout=15s
- /interface bridge settings
- set allow-fast-path=no use-ip-firewall-for-pppoe=yes use-ip-firewall-for-vlan=yes
- /ip settings
- set rp-filter=loose tcp-syncookies=yes
- ######################################################
- ### access control
- ######################################################
- /ip service
- set ssh address=192.168.88.0/24,192.168.0.0/24
- set disabled=yes telnet
- set disabled=yes ftp
- set disabled=yes www
- set disabled=yes api
- set disabled=yes api-ssl
- ######################################################
- ### UPnP
- ######################################################
- /ip upnp
- set enabled=yes
- /ip upnp interfaces
- add interface=pppoe-RT type=external
- add interface=ether2-LAN type=internal
- add interface=wlan-home type=internal
- ######################################################
- ### IPTV via IGMP snooping
- ######################################################
- /routing igmp-proxy
- set query-interval=30s quick-leave=yes
- /routing igmp-proxy interface
- add interface=ether1-UP-RT upstream=yes alternative-subnets=0.0.0.0/0
- add interface=ether2-LAN
- add interface=wlan-home
- ######################################################
- ### time zone & clock
- ######################################################
- /system clock
- set time-zone-autodetect=no
- /system clock manual
- set time-zone=+03:00
- # primary = 0.ru.pool.ntp.org
- # secondary = 1.ru.pool.ntp.org
- /system ntp client
- set enabled=yes primary-ntp=62.76.96.4 secondary-ntp=87.229.205.7
- /system ntp server
- set enabled=yes broadcast=yes broadcast-addresses=192.168.88.255,192.168.0.255,192.168.1.255 manycast=no
- ######################################################
- ### logging
- ######################################################
- /system logging action
- set 1 disk-file-count=8 disk-lines-per-file=10000
- /system logging
- set 0 disabled=yes
- add topics=firewall
- ######################################################
- ### tweaks
- ######################################################
- /system package update
- set channel=current
- /ip neighbor discovery
- set ether1-UP-RT discover=no
- set ether2-LAN discover=no
- set ether3 discover=no
- set ether4 discover=no
- set ether5 discover=no
- set wlan0 discover=no
- set wlan-free discover=no
- set wlan-home discover=no
- set pppoe-RT discover=no
- /routing bgp instance
- set default disabled=yes
- /routing ospf area
- set [ find default=yes ] disabled=yes
- /routing ospf instance
- set [ find default=yes ] disabled=yes
- /routing pim
- set switch-to-spt=no
- /system leds
- set 0 interface=wlan0
- /interface wireless nstreme
- set wlan0 enable-polling=no
- /ip ipsec proposal
- set [ find default=yes ] disabled=yes enc-algorithms=3des
- /ip firewall service-port
- set ftp disabled=yes
- set tftp disabled=yes
- set irc disabled=yes
- set h323 disabled=yes
- set sip disabled=yes
- set pptp disabled=yes
- /ip ipsec policy
- set 0 disabled=yes dst-address=0.0.0.0/0 src-address=0.0.0.0/0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement