Setting the Network Bandwidth Limit
Use the ldm add-vnet
command to create a virtual network device and specify the bandwidth limit by providing a value for the maxbw property.
primary# ldm add-vnet maxbw=limit if-name vswitch-name domain-name
Use the ldm set-vnet
command to specify the bandwidth limit for an existing virtual network device.
primary# ldm set-vnet maxbw=limit if-name domain-name
You can also clear the bandwidth limit by specifying a blank value for the maxbw property:
primary# ldm set-vnet maxbw= if-name domain-name
The following examples show how to use the ldm
command to specify the bandwidth limit. The bandwidth is specified as an integer with a unit. The unit is M
for megabits-per-second or G
for gigabits-per-second. The unit is megabits-per-second if you do not specify a unit.
Example 13-4 Setting the Bandwidth Limit When Creating a Virtual Network Device
The following command creates a virtual network device (vnet0
) that has a bandwidth limit of 100 Mbps.
primary# ldm add-vnet maxbw=100M vnet0 primary-vsw0 ldg1
The following command would issue an error message when attempting to set a bandwidth limit below the minimum value, which is 10 Mbps.
primary# ldm add-vnet maxbw=1M vnet0 primary-vsw0 ldg1
Example 13-5 Setting the Bandwidth Limit on an Existing Virtual Network Device
The following command sets the bandwidth limit to 200 Mbps on the existing vnet0
device.
Depending on the real-time network traffic pattern, the amount of bandwidth might not reach the specified limit of 200 Mbps. For example, the bandwidth might be 95 Mbps, which does not exceed the 200 Mbps limit.
primary# ldm set-vnet maxbw=200M vnet0 ldg1
The following command sets the bandwidth limit to 2 Gbps on the existing vnet0
device.
Because there is no upper limit on bandwidth in the MAC layer, you can still set the limit to be 2 Gbps even if the underlying physical network speed is less than 2 Gbps. In such a case, there is no bandwidth limit effect.
primary# ldm set-vnet maxbw=2G vnet0 ldg1
Example 13-6 Clearing the Bandwidth Limit on an Existing Virtual Network Device
The following command clears the bandwidth limit on the specified virtual network device (vnet0
). By clearing this value, the virtual network device uses the maximum bandwidth available, which is provided by the underlying physical device.
primary# ldm set-vnet maxbw= vnet0 ldg1
Example 13-7 Viewing the Bandwidth Limit of an Existing Virtual Network Device
The ldm list-bindings
command shows the value of the maxbw property for the specified virtual network device, if defined.
The following command shows that the vnet3
virtual network device has a bandwidth limit of 15 Mbps. If no bandwidth limit is set, the MAXBW
field is blank.
primary# ldm ls-bindings -e -o network ldg3
NAME
ldg3
MAC
00:14:4f:f8:5b:12
NETWORK
NAME SERVICE MACADDRESS PVID|PVLAN|VIDs
---- ------- ---------- ---------------
vnet3 primary-vsw0@primary 00:14:4f:fa:ba:b9 1|--|--
DEVICE :network@0 ID :0
LINKPROP :-- MTU :1500
MAXBW :15M MODE :--
CUSTOM :disable
PRIORITY :-- COS :--
PROTECTION :--
PEER MACADDRESS PVID|PVLAN|VIDs
---- ---------- ---------------
primary-vsw0@primary 00:14:4f:f9:08:28 1|--|--
LINKPROP :-- MTU :1500
MAXBW :-- LDC :0x0
MODE :--
You can also use the dladm show-linkprop
command to view the maxbw property value as follows:
# dladm show-linkprop -p maxbw
LINK PROPERTY PERM VALUE EFFECTIVE DEFAULT POSSIBLE
...
ldoms-vsw0.vport0 maxbw rw 15 15 -- --