I have set up our RB2011UiAS-RM with 3 VLANs and a wireguard client which connects to a VPS running the wireguard server.
The problem I have is that I can't access the managed switch on the management VLAN remotely via Wireguard.
I have added the subnet range that includes all the VLANs to AllowedAddresses in the wireguard config on my laptop, and on the wireguard server.
I can ping the RB2011 from my laptop, and ssh into it via any of the gateway IP addresses of the three VLANs including the management VLAN IP address. I can also access other devices on non-management VLANs, just not the switch on the management VLAN.
When connected directly to the RB2011 with an ethernet cable plugged into a management access port I can access the managed switch web interface.
I have added the wireguard-client interface on the RB2011 to the MGMT interface list.
Any suggestions as to what the problem could be welcome
thanks
Code: Select all
# 2023-12-11 17:39:10 by RouterOS 7.12.1
# model = RB2011UiAS
/interface bridge
add name=bridge vlan-filtering=yes
/interface ethernet
set [ find default-name=sfp1 ] disabled=yes
/interface wireguard
add listen-port=51820 mtu=1420 name=wireguard-client
/interface vlan
add interface=bridge name=MGMT_VLAN vlan-id=10
add interface=bridge name=VLAN_2_VLAN vlan-id=30
add interface=bridge name=VLAN_1_VLAN vlan-id=20
/interface list
add name=WAN
add name=LAN
add name=MGMT
/interface wireless security-profiles
set [ find default=yes ] supplicant-identity=MikroTik
/ip dhcp-server option
add code=121 name="Advertise VLANS to MGMT clients" value=0x100A2C0A2C0A01
/ip pool
add name=MGMT_POOL ranges=192.168.10.3-192.168.10.6
add name=VLAN_2_POOL ranges=192.168.30.2-192.168.30.254
add name=VLAN_1_POOL ranges=192.168.20.2-192.168.20.14
/ip dhcp-server
add address-pool=MGMT_POOL interface=MGMT_VLAN lease-time=8h name=MGMT
add address-pool=VLAN_1_POOL interface=VLAN_1_VLAN lease-time=6d name=VLAN_1
add address-pool=VLAN_2_POOL interface=VLAN_2_VLAN lease-time=8h name=VLAN_2
/port
set 0 name=serial0
/interface bridge port
add bridge=bridge frame-types=admit-only-untagged-and-priority-tagged interface=ether10 pvid=10
add bridge=bridge frame-types=admit-only-untagged-and-priority-tagged interface=ether6 pvid=20
add bridge=bridge frame-types=admit-only-untagged-and-priority-tagged interface=ether7 pvid=20
add bridge=bridge frame-types=admit-only-untagged-and-priority-tagged interface=ether8 pvid=20
add bridge=bridge frame-types=admit-only-untagged-and-priority-tagged interface=ether9 pvid=20
add bridge=bridge interface=ether3
add bridge=bridge interface=ether5 pvid=10
/interface bridge vlan
add bridge=bridge tagged=bridge,ether3 vlan-ids=10
add bridge=bridge tagged=bridge,ether3 vlan-ids=20
add bridge=bridge tagged=bridge,ether3 vlan-ids=30
/interface list member
add interface=VLAN_1_VLAN list=LAN
add interface=ether1 list=WAN
add interface=MGMT_VLAN list=LAN
add interface=VLAN_2_VLAN list=LAN
add interface=MGMT_VLAN list=MGMT
add interface=wireguard-client list=MGMT
add interface=wireguard-client list=LAN
/interface wireguard peers
add allowed-address=10.0.8.0/24,192.168.0.0/16 endpoint-address=example.com endpoint-port=51820 interface=wireguard-client \
persistent-keepalive=25s public-key="XXXX"
/ip address
add address=192.168.20.1/28 interface=VLAN_1_VLAN network=192.168.20.0
add address=192.168.30.1/24 interface=VLAN_2_VLAN network=192.168.30.0
add address=192.168.10.1/29 interface=MGMT_VLAN network=192.168.10.0
add address=10.0.8.7/24 interface=wireguard-client network=10.0.8.0
/ip dhcp-client
add interface=ether1 use-peer-dns=no
/ip dhcp-server lease
add address=192.168.10.2 comment="D-Link Switch" mac-address=BC:22:28:7C:BE:A0 server=MGMT
/ip dhcp-server network
add address=192.168.10.0/29 dhcp-option="Advertise VLANS to MGMT clients" dns-server=192.168.10.1 gateway=192.168.10.1
add address=192.168.20.0/28 dns-server=192.168.20.1 gateway=192.168.20.1
add address=192.168.30.0/24 dns-server=192.168.30.1 gateway=192.168.30.1
/ip dns
set allow-remote-requests=yes servers=9.9.9.9,8.8.8.8,8.8.4.4
/ip firewall filter
add action=accept chain=input comment="allow SSH" dst-port=1044 protocol=tcp
add action=accept chain=input comment="allow WireGuard" dst-port=51820 protocol=udp
add action=accept chain=forward comment="Allow access to all VLANs from MGMT list" in-interface-list=MGMT out-interface-list=LAN
add action=accept chain=forward comment="Allow access to VLAN_2 VLAN from VLAN_1 VLAN" in-interface=VLAN_1_VLAN out-interface=\
VLAN_2_VLAN
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=forward comment="defconf: accept established,related, untracked" connection-state=established,related,untracked
add action=accept chain=input comment="defconf: accept established,related, untracked" connection-state=established,related,untracked
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=drop chain=forward comment="defconf: drop invalid" connection-state=invalid
add action=accept chain=forward comment=internet in-interface-list=LAN out-interface-list=WAN
add action=accept chain=forward comment="port forwarding" connection-nat-state=dstnat
add action=drop chain=forward comment="drop all else"
/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 disabled=yes dst-port=80 protocol=tcp to-addresses=192.168.20.7 to-ports=8000
add action=dst-nat chain=dstnat disabled=yes dst-port=1194 protocol=udp to-addresses=192.168.30.4 to-ports=1194
/ip firewall service-port
set ftp disabled=yes
/ip route
add disabled=no distance=1 dst-address=0.0.0.0/0 gateway="" pref-src="" routing-table=main scope=30 suppress-hw-offload=no target-scope=\
10
/ip service
set telnet disabled=yes
set ftp disabled=yes
set www disabled=yes
set ssh port=1044
set api disabled=yes
set api-ssl disabled=yes
/ip ssh
set forwarding-enabled=remote strong-crypto=yes
/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" 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=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
/lcd
set backlight-timeout=5m default-screen=stat-slideshow
/lcd pin
set hide-pin-number=yes pin-number=XXXX
/system clock
set time-zone-name=Europe/London
/system identity
set name=Mikrotik
/system note
set show-at-login=no
/system ntp client
set enabled=yes
/system ntp client servers
add address=0.uk.pool.ntp.org
add address=1.uk.pool.ntp.org
add address=2.uk.pool.ntp.org
add address=3.uk.pool.ntp.org
/system routerboard settings
set silent-boot=yes
/tool bandwidth-server
set enabled=no
/tool mac-server
set allowed-interface-list=MGMT
/tool mac-server mac-winbox
set allowed-interface-list=MGMT