This section provides an example that shows how to create a combination of network configurations that uses link aggregations and VLANs.
In the following example, a system that uses four NICs must be configured to be a router for eight separate subnets. Therefore, eight links are configured, one for each subnet. First, a trunk aggregation is created on all four NICs. This untagged link that does not include a VLAN tag in the outgoing frame becomes the default untagged subnet for the network to which the default route points.
VLAN interfaces are then configured over the link aggregation for the other subnets. The subnets are named based on a color-coded scheme. Accordingly, the VLAN names are likewise named to correspond to their respective subnets. The final configuration consists of eight links for the eight subnets: one untagged link and seven tagged VLAN links. The example begins with verifying whether IP interfaces already exist on the datalinks. These interfaces must be deleted before the datalinks can be combined into an aggregation.
Remove any IP interfaces that have been configured over the datalinks.
# ipadm show-if IFNAME CLASS STATE ACTIVE OVER lo0 loopback ok yes -- net0 ip ok yes -- net1 ip ok yes -- net2 ip ok yes -- net3 ip ok yes -- # ipadm delete-ip net0 # ipadm delete-ip net1 # ipadm delete-ip net2 # ipadm delete-ip net3
Create the trunk aggregation default0.
# dladm create-aggr -P L2,L3 -l net0 -l net1 -l net2 -l net3 default0 # dladm show-link LINK CLASS MTU STATE OVER net0 phys 1500 up -- net1 phys 1500 up -- net2 phys 1500 up -- net3 phys 1500 up -- default0 aggr 1500 up net0 net1 net2 net3
Configure an IP interface over the aggregation.
# ipadm create-ip default0 # ipadm create-addr -a 10.2.3.4/24 default0
Create the VLANs over default0.
# dladm create-vlan -v 2 -l default0 orange0 # dladm create-vlan -v 3 -l default0 green0 # dladm create-vlan -v 4 -l default0 blue0 # dladm create-vlan -v 5 -l default0 white0 # dladm create-vlan -v 6 -l default0 yellow0 # dladm create-vlan -v 7 -l default0 red0 # dladm create-vlan -v 8 -l default0 cyan0 # dladm show-link LINK CLASS MTU STATE OVER net0 phys 1500 up -- net1 phys 1500 up -- net2 phys 1500 up -- net3 phys 1500 up -- default0 aggr 1500 up net0 net1 net2 net3 orange0 vlan 1500 up default0 green0 vlan 1500 up default0 blue0 vlan 1500 up default0 white0 vlan 1500 up default0 yellow0 vlan 1500 up default0 red0 vlan 1500 up default0 cyan0 vlan 1500 up default0 # dladm show-vlan LINK VID OVER FLAGS orange0 2 default0 ----- green0 3 default0 ----- blue0 4 default0 ----- white0 5 default0 ----- yellow0 6 default0 ----- red0 7 default0 ----- cyan0 8 default0 -----
Create IP interfaces over the VLAN links and assign IP addresses to the interfaces.
# ipadm create-ip orange0 # ipadm create-ip green0 # ipadm create-ip blue0 # ipadm create-ip white0 # ipadm create-ip yellow0 # ipadm create-ip red0 # ipadm create-ip cyan0 # ipadm create-addr -a 10.2.3.5/24 orange0 # ipadm create-addr -a 10.2.3.6/24 green0 # ipadm create-addr -a 10.2.3.7/24 blue0 # ipadm create-addr -a 10.2.3.8/24 white0 # ipadm create-addr -a 10.2.3.9/24 yellow0 # ipadm create-addr -a 10.2.3.10/24 red0 # ipadm create-addr -a 10.2.3.11/24 cyan0