Community discussions

MikroTik App
 
domon
just joined
Topic Author
Posts: 20
Joined: Sat Dec 03, 2016 4:20 pm

hapac trunk + access ports VLAN with switch chip

Tue Apr 26, 2022 5:25 pm

I am trying to setup a very basic switched VLAN configuration with a hapac (latest stable 7.x) with wireless disabled.

1 trunk port - ether1
1 local management port - ether2
1 access port (vlan 20) - ether3

When following the bridge VLAN example (1 trunk port, and access ports), the performance for wired clients on the access ports is max 45Mbit/sec. A bandwidth test directly from the hapac to another Mikrotik device results in about 800+Gbps no problem.

I tried to setup the VLAN using the switch chip exactly like the documentation but the hapac hangs when vlan-mode=secure on switch1-cpu is set:

/interface ethernet switch port
set switch1-cpu vlan-header=leave-as-is vlan-mode=secure

The config is a default config, with ether1 as trunk, ether2 as local management port, and ether3 as the access port for vlan 20.

I feel like something basic is missing, any ideas?
/interface bridge
add admin-mac=E4:8D:8C:A6:E1:D2 auto-mac=no comment=defconf name=bridge
add name=bridge1
/interface ethernet switch port
set 0 vlan-mode=secure
set 2 default-vlan-id=20 vlan-mode=secure
/interface list
add comment=defconf name=WAN
add comment=defconf name=LAN
/interface lte apn
set [ find default=yes ] ip-type=ipv4 use-network-apn=no
/interface wireless security-profiles
set [ find default=yes ] supplicant-identity=MikroTik
/ip pool
add name=default-dhcp ranges=192.168.88.10-192.168.88.254
/ip dhcp-server
add address-pool=default-dhcp interface=bridge name=defconf
/interface bridge port
add bridge=bridge ingress-filtering=no interface=ether2
add bridge=bridge1 interface=ether1
add bridge=bridge1 interface=ether3
/ip neighbor discovery-settings
set discover-interface-list=LAN
/ip settings
set max-neighbor-entries=8192
/ipv6 settings
set disable-ipv6=yes max-neighbor-entries=8192
/interface ethernet switch vlan
add independent-learning=yes ports=ether1,ether3 switch=switch1 vlan-id=20
/interface list member
add comment=defconf interface=bridge list=LAN
add comment=defconf interface=ether1 list=WAN
/interface ovpn-server server
set auth=sha1,md5
/ip address
add address=192.168.88.1/24 comment=defconf interface=bridge network=192.168.88.0
/ip dhcp-client
# DHCP client can not run on slave interface!
add comment=defconf interface=ether1
/ip dhcp-server network
add address=192.168.88.0/24 comment=defconf gateway=192.168.88.1
/ip dns
set allow-remote-requests=yes
/ip dns static
add address=192.168.88.1 comment=defconf name=router.lan
/ip firewall filter
add action=accept chain=input comment="defconf: accept established,related,untracked" connection-state=\
    established,related,untracked disabled=yes
add action=drop chain=input comment="defconf: drop invalid" connection-state=invalid disabled=yes
add action=accept chain=input comment="defconf: accept ICMP" disabled=yes protocol=icmp
add action=accept chain=input comment="defconf: accept to local loopback (for CAPsMAN)" disabled=yes dst-address=127.0.0.1
add action=drop chain=input comment="defconf: drop all not coming from LAN" disabled=yes in-interface-list=!LAN
add action=accept chain=forward comment="defconf: accept in ipsec policy" disabled=yes ipsec-policy=in,ipsec
add action=accept chain=forward comment="defconf: accept out ipsec policy" disabled=yes ipsec-policy=out,ipsec
add action=fasttrack-connection chain=forward comment="defconf: fasttrack" connection-state=established,related disabled=yes \
    hw-offload=yes
add action=accept chain=forward comment="defconf: accept established,related, untracked" connection-state=\
    established,related,untracked disabled=yes
add action=drop chain=forward comment="defconf: drop invalid" connection-state=invalid disabled=yes
add action=drop chain=forward comment="defconf: drop all from WAN not DSTNATed" connection-nat-state=!dstnat connection-state=\
    new disabled=yes in-interface-list=WAN
/ip firewall nat
add action=masquerade chain=srcnat comment="defconf: masquerade" ipsec-policy=out,none out-interface-list=WAN
/tool mac-server
set allowed-interface-list=LAN
/tool mac-server mac-winbox
set allowed-interface-list=LAN
Last edited by domon on Tue Apr 26, 2022 7:13 pm, edited 1 time in total.
 
User avatar
mkx
Forum Guru
Forum Guru
Posts: 11598
Joined: Thu Mar 03, 2016 10:23 pm

Re: hapac trunk + access ports VLAN with switch chip

Tue Apr 26, 2022 7:05 pm

Your setup is missing whole section /interface/ethernet/switch/vlan ... something like
/interface ethernet switch vlan
add independent-learning=yes ports=switch1-cpu,ether1,ether3 switch=switch1 vlan-id=20
add independent-learning=yes ports=switch1-cpu,ether1 switch=switch1 vlan-id=30
If you want ether2 to be local management port, then it should not be part of bridge, instead it should have own IP setup (address, DHCP server for management machine IP setup, ...).

There are other minor things that are not correct but your description of desired configuration is almost non-existant so I can't say what else needs to be set and how.
 
domon
just joined
Topic Author
Posts: 20
Joined: Sat Dec 03, 2016 4:20 pm

Re: hapac trunk + access ports VLAN with switch chip

Tue Apr 26, 2022 7:15 pm

Your setup is missing whole section /interface/ethernet/switch/vlan ... something like
/interface ethernet switch vlan
add independent-learning=yes ports=switch1-cpu,ether1,ether3 switch=switch1 vlan-id=20
add independent-learning=yes ports=switch1-cpu,ether1 switch=switch1 vlan-id=30
If you want ether2 to be local management port, then it should not be part of bridge, instead it should have own IP setup (address, DHCP server for management machine IP setup, ...).

There are other minor things that are not correct but your description of desired configuration is almost non-existant so I can't say what else needs to be set and how.
I have updated the post. The desired configuration is:

1 trunk port - ether1
1 local management port - ether2
1 access port (vlan 20) - ether3

The bridge for the local management port was on the default bridge of "bridge".

Edit: the snippet you mentioned as missing does not match up with the Switch Chip Features section in the docs:
/interface ethernet switch vlan
add independent-learning=yes ports=switch1-cpu,ether1,ether3 switch=switch1 vlan-id=20
Docs show:
/interface ethernet switch vlan
add ports=ether2,ether3 switch=switch1 vlan-id=200
Does the switch1-cpu need to be included where it is not in the docs?
 
User avatar
mkx
Forum Guru
Forum Guru
Posts: 11598
Joined: Thu Mar 03, 2016 10:23 pm

Re: hapac trunk + access ports VLAN with switch chip

Tue Apr 26, 2022 8:08 pm

Does the switch1-cpu need to be included where it is not in the docs?

No, it's not mandatory. Port switch1-cpu has to be member only of those VLANs with which ROS interacts, e.g. if there's corresponding vlan interface anchored off bridge interface.

I've never used untagged ports when I dived into VLAN on switch chip, so I don't know how ether2 port will interact with bridge interface. I still think setting managenent stuff directly on ether2 interface is safer way to go.
 
domon
just joined
Topic Author
Posts: 20
Joined: Sat Dec 03, 2016 4:20 pm

Re: hapac trunk + access ports VLAN with switch chip

Tue Apr 26, 2022 10:08 pm

Got it working nice and quick 840+Mbps, it's just that setting vlan-mode=secure on switch1-cpu causes it to hang.
/interface ethernet switch port
set switch1-cpu vlan-header=leave-as-is vlan-mode=secure

Who is online

Users browsing this forum: No registered users and 128 guests