possible DNS rebinding issues with plex

Hi all,

I am having some issues with my plex server and my tik router and switch. I am able to connect to my plex server fine if I use the local IP of the node 10.0.0.10:32400 - for more context the server is running on k8s and with a nodeport service (10.0.0.10 is the IP of the actual machine that is running k8s). When I watch stuff directly I can see if full resolution just fine and plex report a local connection.

When I try to access from app.plex.tv or from my iPhone I get an “indirect” connection. This is when all devices are in the same network. So for example on my laptop browser I go to 10.0.0.10 on one tab it works fine but from app.plex.tv in another tab it cannot connect directly.

I think i have been able to nail it down to a DNS rebinding issue: https://support.plex.tv/articles/206225077-how-to-use-secure-server-connections/

I tried the solution from this post: http://forum.mikrotik.com/t/dns-rebinding-and-plex/104036/11 with no luck.

Not sure if its relevant but I do have one VLAN for my servers with the 10.0.0.0/24 range and other devices in the default 192.168.88.1/24.

Happy to give more info if needed, here is an export of my config:

Any hints are appreciated!

[admin@MikroTik] > export hide-sensitive
# 2024-06-22 11:42:29 by RouterOS 7.14.2
# software id = 6MS6-C50G
#
# model = RB5009UPr+S+
# serial number = HFA0952804P
/interface bridge
add admin-mac=78:9A:18:BB:C0:18 auto-mac=no comment=defconf name=bridge port-cost-mode=short vlan-filtering=yes
/interface ethernet
set [ find default-name=ether1 ] comment=WAN mac-address=78:9A:18:BB:C0:17
set [ find default-name=ether2 ] mac-address=78:9A:18:BB:C0:18 poe-out=off
set [ find default-name=ether3 ] mac-address=78:9A:18:BB:C0:19
set [ find default-name=ether4 ] comment=marissa-desk mac-address=78:9A:18:BB:C0:1A
set [ find default-name=ether5 ] comment=tplink-ap1 mac-address=78:9A:18:BB:C0:1B
set [ find default-name=ether6 ] comment=tplink-ap2 mac-address=78:9A:18:BB:C0:1C
set [ find default-name=ether7 ] mac-address=78:9A:18:BB:C0:1D
set [ find default-name=ether8 ] comment="link to CRS326-1" mac-address=78:9A:18:BB:C0:1E
set [ find default-name=sfp-sfpplus1 ] mac-address=78:9A:18:BB:C0:1F
/interface vlan
add interface=ether8 name=management vlan-id=10
add interface=ether8 name=servers vlan-id=100
/interface list
add comment=defconf name=WAN
add comment=defconf name=LAN
/interface wireless security-profiles
set [ find default=yes ] supplicant-identity=MikroTik
/ip firewall layer7-protocol
add name=plex.direct regexp=.*.plex.direct
/ip pool
add name=default-dhcp ranges=192.168.88.10-192.168.88.254
add name=dhcp-servers ranges=10.0.0.10-10.0.0.249
add name=management ranges=192.168.99.10-192.168.99.254
/ip dhcp-server
add address-pool=default-dhcp interface=bridge lease-time=10m name=defconf
add address-pool=dhcp-servers interface=servers lease-time=10m name=homelab
add address-pool=management interface=management lease-time=10m name=management
/interface bridge port
add bridge=bridge comment=defconf interface=ether2 internal-path-cost=10 path-cost=10 pvid=10
add bridge=bridge comment=defconf interface=ether3 internal-path-cost=10 path-cost=10
add bridge=bridge comment=defconf interface=ether4 internal-path-cost=10 path-cost=10
add bridge=bridge comment=defconf interface=ether5 internal-path-cost=10 path-cost=10
add bridge=bridge comment=defconf interface=ether6 internal-path-cost=10 path-cost=10
add bridge=bridge comment=defconf interface=ether7 internal-path-cost=10 path-cost=10
add bridge=bridge comment=defconf interface=ether8 internal-path-cost=10 path-cost=10 pvid=100
add bridge=bridge comment=defconf interface=sfp-sfpplus1 internal-path-cost=10 path-cost=10
/ip firewall connection tracking
set udp-timeout=10s
/ip neighbor discovery-settings
set discover-interface-list=LAN
/interface bridge vlan
add bridge=bridge comment=servers tagged=ether8,bridge vlan-ids=100
add bridge=bridge comment=management tagged=ether8,bridge untagged=ether2 vlan-ids=10
/interface list member
add comment=defconf interface=bridge list=LAN
add comment=defconf interface=ether1 list=WAN
add interface=management list=LAN
/ip address
add address=192.168.88.1/24 comment=defconf interface=bridge network=192.168.88.0
add address=10.0.0.1/24 comment=homelab interface=servers network=10.0.0.0
add address=10.0.100.0/24 comment=kubernetes-metallb interface=servers network=10.0.100.0
add address=192.168.99.1/24 interface=management network=192.168.99.0
/ip dhcp-client
add comment=defconf interface=ether1 use-peer-dns=no
/ip dhcp-server lease
add address=10.0.0.10 client-id=ff:b6:22:f:eb:0:2:0:0:ab:11:b7:8e:73:46:40:fe:13:53 mac-address=1C:69:7A:03:50:8A server=homelab
add address=10.0.0.100 client-id=1:0:11:32:a8:96:96 mac-address=00:11:32:A8:96:96 server=homelab
add address=192.168.88.10 client-id=1:f0:a7:31:f6:b4:6e comment=tplink-ap1 mac-address=F0:A7:31:F6:B4:6E server=defconf
add address=192.168.88.11 client-id=1:74:fe:ce:d2:2:d2 comment=tplink-ap2 mac-address=74:FE:CE:D2:02:D2 server=defconf
/ip dhcp-server network
add address=10.0.0.0/24 gateway=10.0.0.1
add address=192.168.88.0/24 comment=defconf gateway=192.168.88.1
add address=192.168.99.0/24 gateway=192.168.99.1
/ip dns
set allow-remote-requests=yes servers=1.1.1.1,1.0.0.1
/ip dns static
add address=192.168.88.1 comment=defconf name=router.lan
add address=10.0.0.10 disabled=yes regexp=.*.plex.direct
add address=10.0.0.10 disabled=yes regexp=plex.direct
add address=10.0.0.10 disabled=yes regexp=*.plex.direct
/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=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=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=dst-nat chain=dstnat comment=plex dst-port=32422 in-interface-list=WAN protocol=tcp to-addresses=10.0.0.10 to-ports=32400
add action=dst-nat chain=dstnat comment=plex-udp dst-port=32422 in-interface-list=WAN protocol=udp to-addresses=10.0.0.10 to-ports=32400
add action=dst-nat chain=dstnat dst-address-type=local dst-port=53 in-interface-list=!LAN layer7-protocol=plex.direct protocol=udp to-addresses=8.8.8.8
/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
add action=drop chain=forward comment="defconf: drop everything else not coming from LAN" in-interface-list=!LAN
/system clock
set time-zone-name=America/Chicago
/system note
set show-at-login=no
/tool mac-server
set allowed-interface-list=LAN
/tool mac-server mac-winbox
set allowed-interface-list=LAN
/tool romon
set enabled=yes