D-Link DGS-3100-48P,If you are using the CLI then the below script should adequately demonstrate your requirements.
create link_aggregation type lacp group_id 1
config link_aggregation group_id 1 state enable ports 1-8
create link_aggregation type lacp group_id 2
config link_aggregation group_id 2 state enable ports 9-16
create vlan 1000 tag 1000
config vlan 1000 add untagged ch1,17-19
config vlan 1000 add tagged 23-24
create vlan 2000 tag 2000.
config vlan 2000 add untagged ch2,19-22
config vlan 2000 add tagged 23-24
config ipif System ipaddress 192.168.1.55/24 vlan 1000 state enable
D-Link DGS-3100-48P,If you are using the HTTP GUI then you will need to ensure that from the VLAN configuration page you select the unit “Trunk” from the stack unit drop-down.