Hi! I have setup VLANS and some port forwarding, everything works as it is supposed to. But I cannot connect to the ssh server using the external IP address (ssh server is in VLAN10 and the device I am connecting from is in VLAN30). When I disable the last firewall rule, I can connect using it’s local address.
I have attempted to setup a Hairpin Nat rule, but that didn’t help it seemed. Also, since they are on different subnets, and vlans, I thought that this should “just work”.
Does anyone have any tips?
Firewall settings
/ip firewall address-list
add address=10.11.10.0/24 list=LANs
add address=192.168.30.0/24 list=LANs
/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=forward comment="Allow Port Forwarding" connection-nat-state=dstnat in-interface-list=WAN
add action=accept chain=forward comment="Torfinn SSH" dst-address=10.11.10.11 in-interface-list=WAN 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
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 all from WAN not DSTNATed" connection-nat-state=!dstnat connection-state=new in-interface-list=WAN
add action=accept chain=forward comment="ENABLE LAN to WAN" in-interface-list=LAN out-interface-list=WAN
add action=drop chain=forward comment="DROP ALL other FORWARD traffic" disabled=yes
/ip firewall nat
add action=masquerade chain=srcnat comment="defconf: masquerade" ipsec-policy=out,none out-interface-list=WAN
add action=dst-nat chain=dstnat comment="Torfinn SSH" dst-port=22 in-interface-list=WAN protocol=tcp to-addresses=10.11.10.11
Rest of config:
# aug/24/2021 17:36:05 by RouterOS 6.48.4
# software id = 6JIK-BB6Q
#
# model = RB760iGS
/interface bridge
add fast-forward=no name=bridge vlan-filtering=yes
/interface vlan
add comment=Management interface=bridge name=VLAN10 vlan-id=10
add comment=Management/BMC interface=bridge name=VLAN11 vlan-id=11
add comment="Remote Access" interface=bridge name=VLAN20 vlan-id=20
add comment=Devices interface=bridge name=VLAN30 vlan-id=30
add comment=Storage interface=bridge name=VLAN100 vlan-id=100
add comment=Auth interface=bridge name=VLAN110 vlan-id=110
add comment=DMZ interface=bridge name=VLAN120 vlan-id=120
/interface list
add name=LAN
add name=WAN
/interface wireless security-profiles
set [ find default=yes ] supplicant-identity=MikroTik
/ip dhcp-server
add disabled=no interface=VLAN20 name=VLAN20-DHCP
add disabled=no interface=VLAN11 name=VLAN11-DHCP
add disabled=no interface=VLAN100 name=VLAN100-DHCP
add disabled=no interface=VLAN110 name=VLAN110-DHCP
/ip pool
add name=VLAN30-POOL ranges=10.11.30.50-10.11.30.254
add name=VLAN120-POOL ranges=10.11.120.100-10.11.120.254
add name=VLAN20-POOL ranges=10.11.20.50-10.11.20.254
add name=VLAN10-POOL ranges=10.11.10.100-10.11.10.254
/ip dhcp-server
add address-pool=VLAN30-POOL disabled=no interface=VLAN30 name=VLAN30-DHCP
add address-pool=VLAN120-POOL disabled=no interface=VLAN120 name=VLAN120-DHCP
add address-pool=VLAN10-POOL disabled=no interface=VLAN10 name=VLAN10-DHCP
/ppp profile
set *FFFFFFFE local-address=10.11.20.1 remote-address=VLAN20-POOL
/interface bridge port
add bridge=bridge frame-types=admit-only-untagged-and-priority-tagged hw=no interface=ether5 pvid=10 tag-stacking=yes
add bridge=bridge hw=no interface=ether2 pvid=10
add bridge=bridge frame-types=admit-only-untagged-and-priority-tagged hw=no interface=ether3 pvid=11 tag-stacking=yes
add bridge=bridge frame-types=admit-only-untagged-and-priority-tagged hw=no interface=ether4 pvid=30 tag-stacking=yes
/ip neighbor discovery-settings
set discover-interface-list=!none
/interface bridge vlan
add bridge=bridge tagged=bridge,ether2 vlan-ids=30
add bridge=bridge tagged=bridge,ether2 untagged=ether5 vlan-ids=10
add bridge=bridge tagged=bridge,ether2 vlan-ids=11
add bridge=bridge tagged=bridge,ether2 vlan-ids=20
add bridge=bridge tagged=bridge,ether2 vlan-ids=100
add bridge=bridge tagged=bridge,ether2 vlan-ids=110
add bridge=bridge tagged=bridge,ether2 vlan-ids=120
/interface detect-internet
set detect-interface-list=all
/interface l2tp-server server
set enabled=yes use-ipsec=yes
/interface list member
add interface=bridge list=LAN
add interface=ether1 list=WAN
add interface=VLAN10 list=LAN
add interface=VLAN30 list=LAN
add interface=VLAN20 list=LAN
add interface=VLAN11 list=LAN
add interface=VLAN100 list=LAN
add interface=VLAN110 list=LAN
add interface=VLAN120 list=LAN
/ip address
add address=10.11.30.1/24 interface=VLAN30 network=10.11.30.0
add address=10.11.10.1/24 interface=VLAN10 network=10.11.10.0
add address=10.11.120.1/24 interface=VLAN120 network=10.11.120.0
add address=10.11.11.1/24 interface=VLAN11 network=10.11.11.0
add address=10.11.20.1/24 interface=VLAN20 network=10.11.20.0
add address=10.11.100.1/24 interface=VLAN100 network=10.11.100.0
add address=10.11.110.1/24 interface=VLAN110 network=10.11.110.0
/ip cloud
set ddns-enabled=yes
/ip dhcp-client
add disabled=no interface=ether1
/ip dhcp-server lease
add address=10.11.10.11 client-id=... comment=Torfinn mac-address=... server=VLAN10-DHCP
/ip dhcp-server network
add address=10.11.10.0/24 gateway=10.11.10.1
add address=10.11.11.0/24 gateway=10.11.11.1
add address=10.11.20.0/24 gateway=10.11.20.1
add address=10.11.30.0/24 gateway=10.11.30.1
add address=10.11.100.0/24 gateway=10.11.100.1
add address=10.11.110.0/24 gateway=10.11.110.1
add address=10.11.120.0/24 gateway=10.11.120.1
/ip service
set telnet disabled=yes
set ftp disabled=yes
set www address=10.11.10.0/24
set ssh address=10.11.10.0/24
set www-ssl address=10.11.10.0/24 disabled=no
set api disabled=yes
set winbox address=10.11.10.0/24,10.11.30.0/24
set api-ssl address=10.11.10.0/24 disabled=yes
/ip ssh
set strong-crypto=yes
/ppp secret
add name=...
/system clock
set time-zone-name=Europe/Oslo
/system identity
set name=Victor
/tool bandwidth-server
set enabled=no
/tool mac-server
set allowed-interface-list=none
/tool mac-server mac-winbox
set allowed-interface-list=none
/tool mac-server ping
set enabled=no
Also, I am a bit confused on VLANS yet, I don’t understand why i can connect to devices on different vlans, and that it only stops when I add the
action=drop chain=forward
rule. Could anyone clarify that for me?
Thanks!