/user set admin password=qwFnnNn#4$2hWR#QirEx
/interface bridge add name=bridge1 protocol-mode=none
/interface bridge port add bridge=bridge1 interface=ether1 add bridge=bridge1 interface=ether2 add bridge=bridge1 interface=ether3 add bridge=bridge1 interface=wlan1
/interface vlan add interface=bridge1 name=VLAN10 vlan-id=10 add interface=bridge1 name=VLAN20 vlan-id=20
/interface ethernet switch vlan add independent-learning=yes ports=ether1,ether2,switch1-cpu switch=switch1 vlan-id=10 add independent-learning=yes ports=ether3,switch1-cpu switch=switch1 vlan-id=20 /interface ethernet switch port set 0 default-vlan-id=10 vlan-header=always-strip vlan-mode=secure set 1 default-vlan-id=10 vlan-header=always-strip vlan-mode=secure set 2 default-vlan-id=20 vlan-header=always-strip vlan-mode=secure set 3 vlan-mode=secure
/interface wireless security-profiles set [ find default=yes ] authentication-types=wpa2-psk eap-methods="" mode=dynamic-keys wpa2-pre-shared-key=MyWifiPassword /interface wireless set [ find default-name=wlan1 ] band=2ghz-onlyn disabled=no mode=ap-bridge ssid=MyWifiName vlan-id=20 vlan-mode=use-tag wireless-protocol=802.11 wps-mode=disabled
/ip dhcp-client add dhcp-options=hostname,clientid disabled=no interface=VLAN10
/ip address add address=192.168.11.1/24 interface=VLAN20 network=192.168.11.0 /ip pool add name=pool-lan ranges=192.168.11.2-192.168.11.99 /ip dhcp-server add address-pool=pool-lan disabled=no interface=VLAN20 lease-time=1h name=dhcp-server /ip dhcp-server network add address=192.168.11.0/24 dns-server=192.168.11.1 gateway=192.168.11.1 /ip dns set allow-remote-requests=yes
/interface list add name=WAN add name=LAN /interface list member add interface=VLAN10 list=WAN add interface=VLAN20 list=LAN
/ip firewall filter add action=accept chain=input comment="Allow icmp" protocol=icmp add action=accept chain=input comment="Allow established & related" connection-state=established,related add action=accept chain=input comment="Allow access for ManageIP group" src-address-list=ManageIP add action=drop chain=input comment="All other drop" add action=fasttrack-connection chain=forward comment=Fasttrack connection-state=established,related add action=accept chain=forward comment="Allow established & related" connection-state=established,related,untracked add action=drop chain=forward comment="Drop invalid connection packets" connection-state=invalid add action=accept chain=forward comment="Allow Internet" in-interface-list=LAN out-interface-list=WAN add action=drop chain=forward comment="All other drop"
/ip firewall address-list add address=192.168.11.0/24 list=ManageIP
/ip firewall nat add action=masquerade chain=srcnat out-interface-list=WAN
/ip cloud set ddns-enabled=yes update-time=no /system clock set time-zone-autodetect=no /system clock manual set time-zone=+03:00 /system identity set name=MyHome /system ntp client set enabled=yes primary-ntp=95.165.138.248 secondary-ntp=89.175.20.7
/ip neighbor discovery set ether1 discover=no set ether2 discover=no set ether3 discover=no set wlan1 discover=no set bridge1 discover=no
/ip neighbor discovery-settings set discover-interface-list=LAN
Source: https://habr.com/ru/post/425493/
All Articles