Hi,
to solve this problem you have to activate the "asymmetric VLAN" feature and configure the following:
.--------+----+----+----+----+----+----+----+----+----+----+-------------.
| Port | 01 | 02 | .. | 16 | 17 | 18 | 19 | 20 | .. | 24 | VLAN Name |
+--------+----+----+----+----+----+----+----+----+----+----+-------------+
| VID 3 | | | | X | X | X | X | X | X | X | company2 |
+--------+----+----+----+----+----+----+----+----+----+----+-------------+
| VID 2 | X | X | X | X | X | | | | | | company1 |
+--------+----+----+----+----+----+----+----+----+----+----+-------------+
| VID 1 | X | X | X | X | X | X | X | X | X | X | default |
+--------+----+----+----+----+----+----+----+----+----+----+-------------+
| PVID | 2 | 2 | 2 | 1 | 1 | 3 | 3 | 3 | 3 | 3 | |
`--------+----+----+----+----+----+----+----+----+----+----+-------------´
| | | | | | | | | |
A P P R P P P P P A
P C C O R C C C C P
1 1 x U I 1 2 3 x 2
- - - T N - - - - -
C C C E T C C C C C
1 1 1 R E 2 2 2 2 2
R(For a general discussion of the basics of "asymmetric VLANs" see e.g.
here and the links embedded there. If you know Cisco's private VLAN (PVLAN) implementation, then D-Link's "asymmetric VLANs" can be seen as a proprietary implementation of the PVLAN idea as described and standardized via
RFC5517, where the "shared VLAN" corresponds to the "primary VLAN" and any "access VLAN" corresponds to a secondary "community VLAN". The drawback of D-Link's implementation is that it lacks "isolated PVLANs")
Here an 'X' means: The switch port denominated by the column's title is an untagged member of the VLAN denominated by the row's title.
This perfectly reflects the asymmetric VLAN descriptions and examples given elsewhere, where
- VLAN 1 (default) is the shared VLAN and ports 16 (router) and 17 (printer assumed) span the shared port group.
- VLAN 2 (company1) is the first access VLAN with ports 1-15 spanning the corresponding access port group (AP1-C1, PC1-C1, PCx-C1, ...)
- VLAN 3 (company2) is the second access VLAN with ports 18-24 spanning the corresponding access port group (AP2-C2, PC1-C2, PCx-C2, ...)
Of course you have to adapt the port assignments to devices to your real conditions (you only told your router being plugged to port 16)
<EDIT>
One important remark: Leave the port where you connect your Admin PC for switch management unchanged (default: PVID=1, untagged member of VLAN 1 ), otherwise you might lose the connection to the switch management interface. Leave this port reserved/free for temporal management access. You can't access the switch management interface from any of the access VLANs 2 or 3.
</EDIT>
PT