If you have two switches which support 802.1Q-based VLANs (most managed switches do), the actual configuration should be simple like this (identical on both switches) – only the way it's presented in the switch's web UI varies greatly between manufacturers and even firmware versions.
The port for IPTV should be removed from the default VLAN, and added to a new "IPTV" VLAN. It should still remain "untagged" or "access" port. (Note: Some switches let you configure the port's "PVID" separately from VLAN membership – make sure to change both.)
The ports for regular LAN usually don't need to be changed (factory defaults usually make them untagged members of VLAN ID 1).
The port facing the powerline adapter should be a member of both VLANs: the 'LAN' untagged, the 'IPTV' VLAN tagged. (Some switches call this a "general" or "mixed" port. In other switches this is how all ports always work.)
(This port can also have both VLANs tagged – also known as a "trunk" port – but the disadvantage is that you will no longer be able to HomePlug management software, as the powerline adapters themselves only react to commands in untagged frames.)
Assuming that this screenshot from 2012 still matches your switches today, the actual instructions for this model would be:
- Open 'VLAN → 802.1Q-based VLAN' from the menu.
- Click VLAN ID 1 in the list. Mark your IPTV port as "Not Member" and click 'Apply'.
- Enter e.g. "6" as VID. Mark your powerline port as "Tagged", mark your IPTV port as "Untagged", and click 'Apply'.
In summary:
router switch 1 switch 2
port 1 (tg.6, untg.1) ======== port 1 (tg.6, untg.1)
port 1 (IPTV) --- port 2 (untagged 6) port 2 (untagged 6) --- TV
port 2 (LAN) --- port 3 (untagged 1) port 3 (untagged 1) --- computer
port 4 (untagged 1) port 4 (untagged 1)
... ...
(I just randomly chose VLAN ID 6 for IPTV, but any value from 2 to 4095 will work.)
Make sure the powerline adapters – and all other Ethernet devices between the two D-Links – actually support carrying VLAN-tagged packets (as the tag adds 4 bytes on top of the "normal" 1518 byte maximum). Your adapters should work fine, as HomePlug AV already uses 802.1p tags for indicating packet priority. But e.g. old 100 Mbps era Ethernet switches might either drop or truncate frames which they think are "oversized" due to the VLAN tags.
Are you sure the IPTV is supposed to be on a different VLAN in your local network? That’s quite unusual. What’s your ISP? – Daniel B – 2019-10-26T10:38:20.607
@DanielB yeah, it's either internet or IPTV, so I needed to split them up into VLANs. MGTS, it's a Russian ISP. – Alex – 2019-10-26T13:42:47.047
@DanielB: IPTV on a different VLAN is very common in different countries – it's how many ISPs get it to the router in the first place, often configuring the router to dedicate one port for bridged IPTV (set-top box) and the rest for routed Internet (LAN). – user1686 – 2019-10-26T13:54:01.170
Different WAN VLANs for IPTV are very common, yes. Not in the local network though, especially because tagged VLANs are not compatible with Wi-Fi. – Daniel B – 2019-10-26T18:51:01.557
@DanielB: Well, they are; the VLAN tag can be carried over Wi-Fi just like any other ethertype. (And many APs are capable of putting different clients in different untagged VLANs depending on authentication.) But regardless of that, using tagged VLANs for wired Ethernet doesn't mean they also have to be present on Wi-Fi – most set-top boxes are wired, so it would be perfectly fine to have an Ethernet port with LAN+IPTV while still having no VLANs on Wi-Fi at all. – user1686 – 2019-10-26T20:23:13.313