/interface bridge
add name=BrLAN
add name=containers
/interface ethernet
set [ find default-name=ether3 ] disable-running-check=no name=ether0
set [ find default-name=ether4 ] disable-running-check=no name=ether1
set [ find default-name=ether1 ] disable-running-check=no name=ether2
set [ find default-name=ether2 ] disable-running-check=no name=ether3
/interface pppoe-client
add add-default-route=yes disabled=no interface=ether0 name=FPTGiga user=\
Hnfxxx
/interface veth
add address=10.10.10.2/24 gateway=10.10.10.1 gateway6="" name=veth1
/interface vlan
add interface=ether2 name=VLAN11 vlan-id=11
add interface=ether1 name=VLAN35 vlan-id=35
/interface pppoe-client
add add-default-route=yes default-route-distance=2 disabled=no interface=\
VLAN35 name=VIETTELFast user=h00xxx
add add-default-route=yes default-route-distance=3 disabled=no interface=\
VLAN11 name=VNPTHome user=trxxxx
/interface list
add name=LAN
add comment=defconf name=WAN
/ip pool
add name=dhcp_pool0 ranges=192.168.100.100-192.168.100.254
/ip dhcp-server
add address-pool=dhcp_pool0 interface=BrLAN lease-time=1h name=dhcp1
/routing table
add disabled=no fib name=DiraFPT
add disabled=no fib name=DiraVIETTEL
add disabled=no fib name=DiraVNPT
/container
add interface=veth1 logging=yes root-dir=sata1-part1/adguardhome \
start-on-boot=yes workdir=/opt/adguardhome/work
/container config
set registry-url=https://registry-1.docker.io tmpdir=sata1-part1/pull
/interface bridge port
add bridge=BrLAN interface=ether3
add bridge=containers interface=veth1
/interface list member
add interface=BrLAN list=LAN
add interface=FPTGiga list=WAN
add interface=VIETTELFast list=WAN
add interface=VIETTELFast2 list=WAN
add interface=VNPTHome list=WAN
/ip address
add address=192.168.100.1/24 interface=BrLAN network=192.168.100.0
add address=10.10.10.1/24 interface=containers network=10.10.10.0
/ip dhcp-server network
add address=192.168.100.0/24 dns-server=1.1.1.1,8.8.8.8 gateway=192.168.100.1
/ip dns
set allow-remote-requests=yes servers=1.1.1.1,8.8.8.8
/ip firewall address-list
add address=10.10.10.2 list=exception
add address=192.168.100.20-192.168.100.29 list=OnlyFPT
add address=192.168.100.30-192.168.100.39 list=OnlyVIETTEL
add address=192.168.100.40-192.168.100.49 list=OnlyVNPT
/ip firewall filter
add action=accept chain=input comment="defconf: accept established,related" \
connection-state=established,related
add action=drop chain=input comment="defconf: drop invalid" connection-state=\
invalid
add action=accept chain=forward comment="defconf: accept established,related" \
connection-state=established,related
add action=drop chain=forward comment=" drop invalid" connection-state=\
invalid
add action=accept chain=forward comment="Internet traffic" disabled=yes \
in-interface-list=LAN out-interface-list=WAN
add action=accept chain=forward comment="Port forwarding" \
connection-nat-state=dstnat disabled=yes
add action=drop chain=forward comment="Drop all else" disabled=yes
add action=drop chain=input comment=WANFPTGiga dst-port=53 in-interface=\
FPTGiga protocol=tcp
add action=drop chain=input dst-port=53 in-interface=FPTGiga protocol=udp
add action=drop chain=input comment=WANVIETTELFast dst-port=53 in-interface=\
VIETTELFast protocol=tcp
add action=drop chain=input dst-port=53 in-interface=VIETTELFast protocol=udp
add action=drop chain=input comment=WANVNPTHome dst-port=53 in-interface=\
VNPTHome protocol=tcp
add action=drop chain=input dst-port=53 in-interface=VNPTHome protocol=udp
add action=accept chain=input comment="Coming only from LAN" disabled=yes \
in-interface-list=LAN
add action=drop chain=input comment="Drop all else" disabled=yes
add action=accept chain=forward comment=\
"Allow all users to access DNS server" dst-address=10.10.10.2 \
in-interface-list=LAN
/ip firewall mangle
add action=accept chain=prerouting dst-address=192.168.100.0/24 src-address=\
192.168.100.0/24
add action=accept chain=prerouting dst-address=10.10.10.0/24 src-address=\
10.10.10.0/24
add action=mark-routing chain=prerouting new-routing-mark=DiraFPT \
passthrough=yes src-address-list=OnlyFPT
add action=mark-routing chain=prerouting new-routing-mark=DiraVIETTEL \
passthrough=yes src-address-list=OnlyVIETTEL
add action=mark-routing chain=prerouting new-routing-mark=DiraVNPT \
passthrough=yes src-address-list=OnlyVNPT
add action=mark-connection chain=prerouting connection-mark=no-mark \
in-interface=FPTGiga new-connection-mark=DivaoFPT passthrough=yes
add action=mark-connection chain=prerouting connection-mark=no-mark \
in-interface=VIETTELFast new-connection-mark=DivaoVIETTEL passthrough=yes
add action=mark-connection chain=prerouting connection-mark=no-mark \
in-interface=VNPTHome new-connection-mark=DivaoVNPT passthrough=yes
add action=mark-connection chain=prerouting connection-mark=no-mark \
dst-address-type=!local in-interface=BrLAN new-connection-mark=LL1 \
passthrough=yes per-connection-classifier=both-addresses-and-ports:3/0
add action=mark-connection chain=prerouting connection-mark=no-mark \
dst-address-type=!local in-interface=BrLAN new-connection-mark=LL2 \
passthrough=yes per-connection-classifier=both-addresses-and-ports:3/1
add action=mark-connection chain=prerouting connection-mark=no-mark \
dst-address-type=!local in-interface=BrLAN new-connection-mark=LL3 \
passthrough=yes per-connection-classifier=both-addresses-and-ports:3/2
add action=mark-routing chain=prerouting connection-mark=LL1 in-interface=\
BrLAN new-routing-mark=DiraFPT passthrough=yes
add action=mark-routing chain=prerouting connection-mark=LL2 in-interface=\
BrLAN new-routing-mark=DiraVIETTEL passthrough=yes
add action=mark-routing chain=prerouting connection-mark=LL3 in-interface=\
BrLAN new-routing-mark=DiraVNPT passthrough=yes
add action=mark-routing chain=output connection-mark=DivaoFPT \
new-routing-mark=DiraFPT passthrough=yes
add action=mark-routing chain=output connection-mark=DivaoVIETTEL \
new-routing-mark=DiraVIETTEL passthrough=yes
add action=mark-routing chain=output connection-mark=DivaoVNPT \
new-routing-mark=DiraVNPT passthrough=yes
/ip firewall nat
add action=masquerade chain=srcnat out-interface=FPTGiga
add action=masquerade chain=srcnat out-interface=VIETTELFast
add action=masquerade chain=srcnat out-interface=VNPTHome
add action=masquerade chain=srcnat src-address=10.10.10.0/24
add action=dst-nat chain=dstnat dst-address=192.168.100.1 dst-port=6789 \
protocol=tcp to-addresses=10.10.10.2 to-ports=6789
add action=dst-nat chain=dstnat comment=\
" Ensure all users are forced to adguard for DNS, except adguard" \
dst-port=53 in-interface-list=LAN protocol=tcp src-address-list=\
!exception to-addresses=10.10.10.2
add action=dst-nat chain=dstnat dst-port=53 in-interface-list=LAN protocol=\
udp src-address-list=!exception to-addresses=10.10.10.2
/ip route
add disabled=no distance=1 dst-address=0.0.0.0/0 gateway=FPTGiga \
routing-table=DiraFPT scope=30 suppress-hw-offload=no target-scope=10
add disabled=no distance=1 dst-address=0.0.0.0/0 gateway=VIETTELFast \
pref-src="" routing-table=DiraVIETTEL scope=30 suppress-hw-offload=no \
target-scope=10
add disabled=no distance=1 dst-address=0.0.0.0/0 gateway=VNPTHome pref-src="" \
routing-table=DiraVNPT scope=30 suppress-hw-offload=no target-scope=10