I cannot access my hAP’s SMB share from another vlan.
Router:
hAP ax3 with SSD connected to USB
Configuration:
main_pool – hAP, single desktop, and wifi
trusted_vlan20 – includes a Pi with SMB, desktop with SMB
IOT_vlan30
Setting:
home
I prefer to use the hAP instead of the Pi for file sharing, but not mandatory. My use is light.
Devices on the main_pool can access the haP SMB, so the file sharing is working in that regard. I assume it’s a firewall configuration.
Questions:
- Is it is a best security practice to not allow SMB access to my hAP from other vlans?
- How do I configure SMB access to the hAP from my trusted_vlan?
/interface vlan
add comment=IOT interface=bridge name=VLAN_IOT vlan-id=30
add comment=trusted20 interface=bridge name=VLAN_trusted20 vlan-id=20
/interface list
add comment=defconf name=WAN
add comment=defconf name=LAN
/ip pool
add name=main_pool ranges=10.0.2.50-10.0.2.254
add name="IOT pool" ranges=10.0.30.2-10.0.30.100
add name=trusted20_pool ranges=10.0.20.50-10.0.20.254
/ip dhcp-server
add address-pool=main_pool interface=bridge lease-time=1d name=defconf
add address-pool="IOT pool" comment=IOT interface=VLAN_IOT lease-time=1d \
name="IOT DHCP"
add address-pool=trusted20_pool interface=VLAN_trusted20 name=\
"trusted20 DHCP"
/ip smb users
set [ find default=yes ] disabled=yes
add name=me
/certificate settings
set builtin-trust-anchors=not-trusted
/disk settings
set auto-media-interface=bridge auto-media-sharing=yes auto-smb-sharing=yes
/interface bridge port
add bridge=bridge comment=defconf interface=ether2_switch
add bridge=bridge comment=defconf interface=ether3_Mac
add bridge=bridge comment=defconf interface=ether4_asus pvid=20
add bridge=bridge comment=defconf interface=" wifi for IOT" pvid=30
add bridge=containers interface=veth1-nginx
add bridge=bridge interface=hap5
add bridge=bridge interface=ether5_pvid1
/ip neighbor discovery-settings
set discover-interface-list=LAN
/interface bridge vlan
add bridge=bridge comment=IOT tagged=bridge untagged=\
" wifi for IOT,ether2_switch" vlan-ids=30
add bridge=bridge comment=trusted20 tagged=bridge untagged=\
ether4_asus,ether2_switch,ether3_Mac vlan-ids=20
/interface detect-internet
set detect-interface-list=all
/interface list member
add comment=defconf interface=bridge list=LAN
add comment=defconf interface=ether1_WAN list=WAN
/ip address
add address=10.0.2.1/24 interface=bridge network=10.0.2.0
add address=10.0.5.1/24 comment=containers interface=containers network=\
10.0.5.0
add address=10.0.30.1/24 comment=IOT interface=VLAN_IOT network=10.0.30.0
add address=10.0.20.1/24 comment=trusted interface=VLAN_trusted20 network=\
10.0.20.0
/ip dhcp-client
add comment=defconf interface=ether1_WAN use-peer-dns=no
/ip dhcp-server network
add address=10.0.2.0/24 comment=main dns-server=10.0.2.1 gateway=10.0.2.1
add address=10.0.20.0/24 comment=vlan_trusted dns-server=10.0.2.1 gateway=\
10.0.20.1
add address=10.0.30.0/24 comment=IOT_vlan dns-server=10.0.2.1 gateway=\
10.0.30.1
/ip dns
set allow-remote-requests=yes cache-size=25600KiB servers=\
9.9.9.9,149.112.112.112
/ip firewall filter
add action=accept chain=input comment=\
"defconf: accept established,related,untracked" connection-state=\
established,related,untracked
add action=drop chain=input comment="defconf: drop invalid" connection-state=\
invalid
add action=accept chain=input comment="defconf: accept ICMP" protocol=icmp
add action=accept chain=input comment=\
"defconf: accept to local loopback (for CAPsMAN)" dst-address=127.0.0.1
add action=accept chain=input comment="me: Adlist - allow DNS queries" \
dst-port=53 in-interface=all-vlan protocol=udp
add action=accept chain=input comment="me: Adlist - allow DNS queries" \
dst-port=53 in-interface=all-vlan protocol=tcp
add action=drop chain=input comment="defconf: drop all not coming from LAN" \
in-interface-list=!LAN
add action=accept chain=forward comment="defconf: accept in ipsec policy" \
ipsec-policy=in,ipsec
add action=accept chain=forward comment="defconf: accept out ipsec policy" \
ipsec-policy=out,ipsec
add action=fasttrack-connection chain=forward comment="defconf: fasttrack" \
connection-state=established,related hw-offload=yes
add action=accept chain=forward comment=\
"defconf: accept established,related, untracked" connection-state=\
established,related,untracked
add action=accept chain=forward comment="me: #1a - bridge to vlans" \
in-interface=bridge out-interface=all-vlan
add action=accept chain=forward comment="SMB access to hAP" dst-address=\
10.0.2.0/24 dst-port=445,139 protocol=tcp src-address=10.0.20.0/24
add action=accept chain=forward comment="SMB access to hAP" dst-address=\
10.0.2.0/24 dst-port=137,138 protocol=udp src-address=10.0.20.0/24
add action=drop chain=forward comment="me: IOT - vlans to bridge" \
in-interface=all-vlan out-interface=bridge
add action=drop chain=forward comment="me: IOT" dst-address=10.0.20.0/24 \
src-address=10.0.30.0/24
add action=drop chain=forward comment="me: IOT - outbound drop" \
out-interface=all-vlan src-address=10.0.30.0/24
add action=drop chain=forward comment="defconf: drop invalid" \
connection-state=invalid
add action=drop chain=forward comment=\
"defconf: drop all from WAN not DSTNATed" connection-nat-state=!dstnat \
connection-state=new in-interface-list=WAN
/ip firewall nat
add action=masquerade chain=srcnat comment="defconf: masquerade" \
ipsec-policy=out,none out-interface-list=WAN
add action=masquerade chain=srcnat comment=containers src-address=10.0.5.0/24
add action=redirect chain=dstnat comment="Adlist - allow DNS queries" \
dst-port=53 in-interface=all-vlan protocol=udp
add action=redirect chain=dstnat comment="Adlist - allow DNS queries" \
dst-port=53 in-interface=all-vlan protocol=tcp
add action=dst-nat chain=dstnat comment="Forwards main2 to routeros" \
disabled=yes dst-address=10.0.2.1 dst-port=80 protocol=tcp to-addresses=\
10.0.1.1 to-ports=80
/ip firewall service-port
set ftp disabled=yes
/ip service
set ftp disabled=yes
set telnet disabled=yes
set www-ssl disabled=no
/ip smb shares
add directory=usb1 name=usb1 valid-users=me
/ipv6 firewall address-list
add address=::/128 comment="defconf: unspecified address" list=bad_ipv6
add address=::1/128 comment="defconf: lo" list=bad_ipv6
add address=fec0::/10 comment="defconf: site-local" list=bad_ipv6
add address=::ffff:0.0.0.0/96 comment="defconf: ipv4-mapped" list=bad_ipv6
add address=::/96 comment="defconf: ipv4 compat" list=bad_ipv6
add address=100::/64 comment="defconf: discard only " list=bad_ipv6
add address=2001:db8::/32 comment="defconf: documentation" list=bad_ipv6
add address=2001:10::/28 comment="defconf: ORCHID" list=bad_ipv6
add address=3ffe::/16 comment="defconf: 6bone" list=bad_ipv6
/ipv6 firewall filter
add action=accept chain=input comment=\
"defconf: accept established,related,untracked" connection-state=\
established,related,untracked
add action=drop chain=input comment="defconf: drop invalid" connection-state=\
invalid
add action=accept chain=input comment="defconf: accept ICMPv6" protocol=\
icmpv6
add action=accept chain=input comment="defconf: accept UDP traceroute" \
dst-port=33434-33534 protocol=udp
add action=accept chain=input comment=\
"defconf: accept DHCPv6-Client prefix delegation." dst-port=546 protocol=\
udp src-address=fe80::/10
add action=accept chain=input comment="defconf: accept IKE" dst-port=500,4500 \
protocol=udp
add action=accept chain=input comment="defconf: accept ipsec AH" protocol=\
ipsec-ah
add action=accept chain=input comment="defconf: accept ipsec ESP" protocol=\
ipsec-esp
add action=accept chain=input comment=\
"defconf: accept all that matches ipsec policy" ipsec-policy=in,ipsec
add action=drop chain=input comment=\
"defconf: drop everything else not coming from LAN" in-interface-list=\
!LAN
add action=fasttrack-connection chain=forward comment="defconf: fasttrack6" \
connection-state=established,related
add action=accept chain=forward comment=\
"defconf: accept established,related,untracked" connection-state=\
established,related,untracked
add action=drop chain=forward comment="defconf: drop invalid" \
connection-state=invalid
add action=drop chain=forward comment=\
"defconf: drop packets with bad src ipv6" src-address-list=bad_ipv6
add action=drop chain=forward comment=\
"defconf: drop packets with bad dst ipv6" dst-address-list=bad_ipv6
add action=drop chain=forward comment="defconf: rfc4890 drop hop-limit=1" \
hop-limit=equal:1 protocol=icmpv6
add action=accept chain=forward comment="defconf: accept ICMPv6" protocol=\
icmpv6
add action=accept chain=forward comment="defconf: accept HIP" protocol=139
add action=accept chain=forward comment="defconf: accept IKE" dst-port=\
500,4500 protocol=udp
add action=accept chain=forward comment="defconf: accept ipsec AH" protocol=\
ipsec-ah
add action=accept chain=forward comment="defconf: accept ipsec ESP" protocol=\
ipsec-esp
add action=accept chain=forward comment=\
"defconf: accept all that matches ipsec policy" ipsec-policy=in,ipsec
add action=drop chain=forward comment=\
"defconf: drop everything else not coming from LAN" in-interface-list=\
!LAN