Skip to content

Ruijie switch and MikroTik dual-VLAN trunk

Date: August 17, 2026 Overall result: Both VLAN 2 (TV network, ) and VLAN 26 (phone network, ) now pass simultaneously, tagged, over one physical cable through the Ruijie switch. Switch is now manageable via SSH without the console cable. Web UI login remains broken (unresolved, not blocking).


1. Console cable — finally working

The new FTDI-chipset USB-C to RJ45 console cable (replacement for the dead Prolific one from the earlier saga) worked immediately on macOS — recognized as /dev/tty.usbserial-<SERIAL>, no driver install needed.

Connected with:

screen /dev/tty.usbserial-<SERIAL> 9600

One hiccup along the way: screen got killed accidentally (Ctrl-A K) and the device briefly showed "cannot open line" on reconnect — fixed by finding and killing the stale detached session (screen -list, then screen -X -S <id> quit) before reconnecting.


2. Identifying the right switch ports

Used show running-config, show vlan, and show interface status to map the switch's 28 ports. Found VLAN-2 access ports with active links: 0/1, 0/3, 0/5, 0/7, 0/11.

Physically confirmed by checking the chassis: - Port 0/1 = MikroTik router (ether4) - Port 0/11 = Mac mini

(Ports 0/3, 0/5, 0/7 are other existing TV-network devices, never touched.)


3. Switch trunk configuration

Created VLAN 26 in the switch's VLAN database (it only had vlan range 1-3 before) and converted both identified ports from plain access-mode to 802.1Q trunks:

configure terminal
vlan 26
 name phone-net
 exit
interface GigabitEthernet 0/1
 switchport mode trunk
 switchport trunk allowed vlan add 2,26
 exit
interface GigabitEthernet 0/11
 switchport mode trunk
 switchport trunk allowed vlan add 2,26
 exit
exit
write

4. The native-VLAN troubleshooting saga (the hardest part)

Getting both VLANs to work at once required real trial and error. Summary table:

Port 0/1 (MikroTik) native Port 0/11 (Mac mini) native Result
2 2 VLAN 26 , VLAN 2 (100% loss — a regression)
1 1 Mac mini lost the ability to reach the router's own IP ()
2 1 Everything works together — this is the final, saved config

Root cause (found via investigation, not fully certain at the packet level): the router's own admin IP (<ROUTER_VLAN2_IP>) is bound directly to the BridgeMulticast bridge interface itself ("bridge self" traffic), which — per MikroTik's own VLAN table — has dual membership: untagged in VLAN 1 and tagged in VLAN 2 simultaneously. ether4's bridge port settings (PVID 1, Frame Types "admit all", Ingress Filtering off) mean the port doesn't reject either form. The asymmetric switch setting happens to preserve a valid path for both of the router's two "faces" at once — port 0/11's native being 1 (not 2) means VLAN 2 traffic is never stripped of its tag before reaching the Mac mini's tagged vlan0 interface, which is what it needs.

This was confirmed by direct testing, not derived cleanly from theory — worth remembering if this ever needs to be touched again, since it's not the "obvious" answer.


5. Mac mini network reconfiguration

Done entirely via SSH/Terminal (no GUI/VNC needed):

sudo networksetup -setnetworkserviceenabled "vlan2" on
sudo networksetup -setnetworkserviceenabled "vlan26" on
sudo networksetup -setv4off "Ethernet"

Order mattered — enabling the VLAN interfaces before turning off plain Ethernet's IP avoided a connectivity gap that would have locked out the SSH session mid-change.

Result confirmed via ifconfig: vlan0 (tag 2) = <MACMINI_VLAN2_IP>, vlan1 (tag 26) = <MACMINI_VLAN26_IP>, both active; en0 (plain Ethernet) has no IP.

Checked (and left alone, since it was already reasonable) networksetup -listnetworkserviceorder — vlan2 was already prioritized ahead of Wi-Fi.


6. Trunk VLAN list tightened (performance)

The trunk's allowed-VLAN list defaulted to ALL (1-4094) after the add command, which meant unrelated VLAN 3 broadcast/multicast traffic was also flooding across this link — extra background load, contributing to the "feels a bit slow" impression. Tightened to just what's needed:

configure terminal
interface GigabitEthernet 0/1
 switchport trunk allowed vlan only 1,2,26
 exit
interface GigabitEthernet 0/11
 switchport trunk allowed vlan only 1,2,26
 exit
exit
write

(VLAN 1 stays in the list since the router's admin path depends on it.)

Why "allow all" affects speed even with no deliberate traffic on those VLANs: broadcast/multicast frames (ARP, mDNS/Bonjour, DHCP, IGMP) from other devices on an allowed VLAN get flooded to every member port regardless of whether anything there actually wants them — consuming link bandwidth and forcing both ends to receive-and-discard irrelevant frames.


7. Switch management IP (no more console cable needed for routine access)

Added an IP directly reachable from the home LAN:

configure terminal
interface vlan 2
 ip address <SWITCH_MGMT_IP> 255.255.255.0
 no shutdown
 exit
exit
write

(VLAN 2 chosen over VLAN 1 because most existing devices — the other TVs — are plain access-mode members of VLAN 2, making this IP reachable without any of the trunk-native-VLAN quirks from Section 4.)

Also cleaned up an old, irrelevant leftover default route that pointed to an unrelated subnet (<OLD_UNRELATED_SUBNET>):

no ip route 0.0.0.0 0.0.0.0 VLAN 1 <OLD_DEFAULT_GATEWAY_IP>


8. Web UI login — broken, unresolved, not blocking

Created a new web-management account (webmaster level 1 username castisadmin ...) and even reset the pre-existing watza account's password to test — both fail the same way, bouncing back to the login page with no clear error. Restarting the web service via CLI (no enable service web-server http / enable service web-server http) didn't fix it.

Research into Ruijie's official RGOS documentation didn't turn up this exact issue, but did confirm the built-in default admin account is handled specially (its credentials are deliberately excluded from show running-config, unlike accounts created via the webmaster command) — suggesting CLI-created web accounts may go through a different internal code path that isn't being picked up live.

Likely fix (not yet done): a full switch reboot (Ruijie#reload), since the web management process probably caches its user database at boot. Not urgent since SSH now covers management needs — planned for a less disruptive time (reboot causes ~1-2 min network interruption for everyone).


9. SSH access set up (this is what actually solved remote management)

Several layered fixes were needed:

a) Enable SSH service + generate host key:

configure terminal
enable service ssh-server
crypto key generate rsa
exit
write

b) Allow SSH transport on the VTY lines (they defaulted to Telnet-only):

line vty 0 4
 transport input all
 exit

c) Switch to local-account authentication (the simple shared line password wasn't being accepted for SSH — needed a proper username account plus login local):

username castisadmin privilege 15 password 0 <PASSWORD>
line vty 0 4
 login local
 exit

d) Work around modern macOS SSH client rejecting this old switch's legacy crypto:

ssh -oKexAlgorithms=+diffie-hellman-group14-sha1 -oHostKeyAlgorithms=+ssh-rsa castisadmin@<SWITCH_MGMT_IP>
(macOS's OpenSSH refuses old key-exchange and host-key algorithms by default; this switch only offers old ones.)

e) Work around Warp Terminal breaking the connection. Password authentication was succeeding, but the connection died immediately after — turned out Warp Terminal injects its own shell-integration script (environment variables, motd checks) assuming a real Unix shell on the other end. The switch's CLI isn't a Unix shell, so it couldn't parse the injected script and dropped the connection. Fix: use plain Terminal.app instead of Warp for this specific host.

f) Saved a shortcut in ~/.ssh/config on the Mac mini so the long command isn't needed every time:

Host ruijie
    HostName <SWITCH_MGMT_IP>
    User castisadmin
    KexAlgorithms +diffie-hellman-group14-sha1
    HostKeyAlgorithms +ssh-rsa
Now ssh ruijie (from plain Terminal.app, not Warp) connects directly.


10. A side issue noticed along the way: k3s VM

The Mac mini's k3s VM (running in UTM/QEMU) went down partway through today's changes — very likely because it uses "Bridged" networking tied directly to en0, and bridged VM traffic goes out untagged. Since the switch's Mac-facing port now treats untagged traffic as VLAN 1 (not whatever network the VM actually needs), the VM's traffic likely landed in the wrong VLAN. Not yet resolved — needs checking UTM's VM network settings (bridge target interface) and deciding whether to point it at vlan0 instead, or reconsider VM networking approach. Flagged here as a follow-up, not fixed today.


11. Known issues / open items going into next time

  1. Web UI login on the switch (http://<SWITCH_MGMT_IP>) — broken for all accounts, likely needs Ruijie#reload to fix. Not done yet (deferred to avoid disruption).
  2. The k3s VM's UTM networking likely needs reconfiguring to work with the new VLAN-tagged setup (Section 10) — not yet fixed.
  3. Real-world testing of actual TV casting and phone connectivity (not just ICMP pings) was suggested earlier today but not yet explicitly confirmed done.
  4. WiFi is still connected on the Mac mini as a fallback for the phone network — safe to consider dropping once VLAN 26 is confirmed solid under real use, not just pings.
  5. The asymmetric native-VLAN requirement (Section 4) is empirically confirmed but not fully understood at a packet level — worth being cautious if this config is touched again.