Example 1 Creating IPv4 Static Addresses
The following command creates the address 10.2.3.4/24 on
interface bge1 (linkname net1) and marks the address up, for
use.
# ipadm create-ip net1
# ipadm create-addr -T static -a local=10.2.3.4/24 net1/v4static1
# ipadm create-addr -T static -d -a 10.2.3.5/24 net1/v4static2
# ipadm up-addr net1/v4static2
If the DUPLICATE flag was set on the address object, then
refresh-addr will verify that the address is still a dupli-
cate on the network. If it is not, the address will be
marked up.
# ipadm refresh-addr net1/v4static2
The following command lists the addresses that were config-
ured. This shows that the address net1/v4static2 is not a
duplicate.
# ipadm show-addr
ADDROBJ TYPE STATE ADDR
lo0/v4 static ok 127.0.0.1/8
lo0/v6 static ok ::/128
net1/v4static1 static ok 10.2.3.4/24
net1/v4static2 static ok 10.2.3.10/24
Example 2 Creating DHCPv4-controlled Addresses
The following command obtains a DHCPv4 address on interface
bge1 (linkname net1).
# ipadm create-ip net1
# ipadm create-addr -T dhcp net1/dhaddr
# ipadm show-addr net1/dhaddr
ADDROBJ TYPE STATE ADDR
net1/dhaddr dhcp ok 10.8.48.173/25
SunOS 5.11 Last change: 22 Jul 2011 39
System Administration Commands ipadm(1M)
The following command extends the lease duration for the
DHCPv4 address object net1/dhaddr.
# ipadm refresh-addr net1/dhaddr
# ipadm create-addr -T static -a local=2ff0::f3ad/64 net1/v6static
# ipadm set-addrprop -p prefixlen=80 net1/v6static
# ipadm show-addr
ADDROBJ TYPE STATE ADDR
lo0/v4 static ok 127.0.0.1/8
Example 4 Configuring an IPv4 Tunnel
The first command below (ipadm) creates the tunnel source
address. Then, a dladm command creates the tunnel link. The
final ipadm commands configure the IPv4 and IPv6 addresses
on the tunnel IP interface.
# ipadm create-ip net1
# ipadm create-addr -T static -a local=10.2.3.4/24 net1/v4static
# dladm create-iptun -T ipv4 -a local=10.2.3.4,remote=10.2.3.5 tun0
# ipadm create-ip tun0
# ipadm create-addr -T static \
-a local=173.129.134.1,remote=173.129.134.2 tun0/v4tunaddr
# ipadm create-addr -T static \
-a local=2ff1::3344,remote=2ff1::3345 tun0/v6tunaddr
# ipadm show-addr
ADDROBJ TYPE STATE ADDR
lo0/v4 static ok 127.0.0.1/8
lo0/v6 static ok ::/128
net1/v4static static ok 10.2.3.4/24
tun0/v4tunaddr static ok 173.129.134.1-->173.129.134.2
tun0/v6tunaddr static ok 2ff1::3344-->2ff1::3345
Example 5 Viewing All of the Interfaces
The following command enables you to view all interfaces.
# ipadm show-if -o all
IFNAME CLASS STATE ACTIVE CURRENT PERSISTENT OVER
lo0 loopback ok yes -m-v------46 --46 --
net0 ip ok yes bm--------46 --46 --
e1000g0 ip ok yes bm---l----46 -l46 --
e1000g1 ip ok yes bm---l----46 -l46 --
ipmp0 ipmp down yes bm--------46 --46 e1000g0 e1000g1
tun0 ip failed no -mp-------46 --46 --
vni0 vni disabled no bm-v-------- --46 --
SunOS 5.11 Last change: 22 Jul 2011 41
System Administration Commands ipadm(1M)
Example 6 Displaying Interface Properties
The following command displays all interface properties for
a specified interface.
# ipadm show-ifprop net0
IFNAME PROPERTY PROTO PERM CURRENT PERSISTENT DEFAULT POSSIBLE
net0 arp ipv4 rw on -- on on,off
net0 forwarding ipv4 rw off on off on,off
net0 metric ipv4 rw 2 2 0 --
net0 mtu ipv4 rw 1500 -- 1500 68-1500
net0 exchange_routes ipv4 rw off -- off on,off
net0 usesrc ipv4 rw none -- none --
net0 forwarding ipv6 rw off -- off on,off
net0 metric ipv6 rw 2 2 0 --
net0 mtu ipv6 rw 1500 -- 1500 1280-1500
net0 nud ipv6 rw on -- on on,off
net0 exchange_routes ipv6 rw off on off on,off
net0 usesrc ipv6 rw none -- none --
net0 group ip rw grp0 -- -- --
net0 standby ip r- off -- off on,off
Example 7 Configuring per-Interface Properties
The following command sets the IPv4 MTU of the interface
net0 to 900.
# ipadm set-ifprop -m ipv4 -p mtu=900 net0
The following command sets the IPv6 MTU of the interface
net0 to 1400.
# ipadm set-ifprop -m ipv6 -p mtu 1400 net0
View the results:
# ipadm show-ifprop -p mtu net0
IFNAME PROPERTY PROTO PERM CURRENT PERSISTENT DEFAULT POSSIBLE
SunOS 5.11 Last change: 22 Jul 2011 42
System Administration Commands ipadm(1M)
net0 mtu ipv4 rw 900 900 1500 68-1500
net0 mtu ipv6 rw 1400 1400 1500 1280-1500
# ipadm show-ifprop -m ipv6 -p mtu net0
IFNAME PROPERTY PROTO PERM CURRENT PERSISTENT DEFAULT POSSIBLE
net0 mtu ipv6 rw 1400 1400 1500 1280-1500
Example 8 Displaying Supported Properties
The following command displays the properties supported on
TCP.
# ipadm show-prop tcp
Example 12 Creating IPMP Interfaces
The following command sequence creates an IPMP interface and
adds underlying interfaces to it.
# ipadm create-ip e1000g0
# ipadm create-ip e1000g1
# ipadm create-ip e1000g2
# ipadm set-ifprop -p standby=on -m ip e1000g2
# ipadm create-ipmp testgroup0
# ipadm add-ipmp -i e1000g0 -i e1000g1 -i e1000g2 testgroup0
# ipadm create-addr -T static -a local=192.168.80.5/24 testgroup0/data1
# ipadm create-addr -T static -a local=192.168.80.6/24 testgroup0/data2
# ipadm show-if
IFNAME CLASS STATE ACTIVE OVER
lo0 loopback ok yes --
net0 ip ok yes --
e1000g0 ip ok yes --
e1000g1 ip ok yes --
ipmp0 ipmp ok yes e1000g0 e1000g1
testing IPMP:-
# ipadm show-addr
ADDROBJ TYPE STATE ADDR
lo0/v4 static ok 127.0.0.1/8
testgroup0/v4 static ok 10.66.10.107/24
net1/_a static ok fe80::214:4fff:fefa:9a9b/10
# ipadm show-if
IFNAME CLASS STATE ACTIVE OVER
lo0 loopback ok yes --
testgroup0 ipmp ok yes net0 net1
net0 ip ok yes --
net1 ip ok yes --
net2 ip down no --
# if_mpadm -d net1
# ipadm show-if
IFNAME CLASS STATE ACTIVE OVER
lo0 loopback ok yes --
testgroup0 ipmp ok yes net0 net1
net0 ip ok yes --
net1 ip offline no --
net2 ip down no --
# ipadm show-addr
ADDROBJ TYPE STATE ADDR
lo0/v4 static ok 127.0.0.1/8
testgroup0/v4 static ok 10.66.10.107/24
net1/_a static down fe80::214:4fff:fefa:9a9b/10
# ifconfig -a
lo0: flags=2001000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4,VIRTUAL> mtu 8232 index 1
inet 127.0.0.1 netmask ff000000
testgroup0: flags=8001000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4,IPMP> mtu 1500 index 2
inet 10.66.10.107 netmask ffffff00 broadcast 10.66.10.255
groupname testgroup0
net0: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 3
inet 0.0.0.0 netmask ff000000 broadcast 0.255.255.255
groupname testgroup0
ether 0:14:4f:f8:cd:ac
net1: flags=81000842<BROADCAST,RUNNING,MULTICAST,IPv4,OFFLINE> mtu 1500 index 4
inet 0.0.0.0 netmask ff000000 broadcast 0.255.255.255
groupname testgroup0
ether 0:14:4f:fa:9a:9b
net2: flags=1000842<BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 5
inet 0.0.0.0 netmask 0
ether 0:14:4f:fb:99:b6
testgroup0: flags=28002000840<RUNNING,MULTICAST,IPv6,IPMP> mtu 1500 index 2
inet6 ::/0
groupname testgroup0
net1: flags=20082000840<RUNNING,MULTICAST,IPv6,OFFLINE> mtu 1500 index 4
inet6 fe80::214:4fff:fefa:9a9b/10
groupname testgroup0
ether 0:14:4f:fa:9a:9b
net2: flags=20002000840<RUNNING,MULTICAST,IPv6> mtu 1500 index 5
inet6 ::/0
ether 0:14:4f:fb:99:b6
# if_mpadm -r net1
# ipadm show-addr
ADDROBJ TYPE STATE ADDR
lo0/v4 static ok 127.0.0.1/8
testgroup0/v4 static ok 10.66.10.107/24
net1/_a static ok fe80::214:4fff:fefa:9a9b/10
# ipadm show-if
IFNAME CLASS STATE ACTIVE OVER
lo0 loopback ok yes --
testgroup0 ipmp ok yes net0 net1
net0 ip ok yes --
net1 ip ok yes --
net2 ip down no --
1 Displaying Statistics
To display statistics for all the links, enter following
command. Statistics are displayed as 3-digits followed by
decimal and then 2 digits with the appropriate unit.
# dlstat
LINK IPKTS RBYTES OPKTS OBYTES
e1000g0 101.88K 32.86M 40.16K 4.37M
nxge1 4.50M 6.78G 1.38M 90.90M
vnic1 8 336 0 0
net0 73.96K 6.81M 0 0
zone1/net0 144.47K 13.32M 247 16.29K
zone2/net0 132.89K 12.25M 236 15.82K
2 Displaying RX-side Statistics
The following command displays receive-side statistics every
one second.
# dlstat -r -i 1
LINK IPKTS RBYTES INTRS POLLS IDROPS
e1000g0 101.91K 32.86M 87.56K 14.35K 0
nxge1 9.61M 14.47G 5.79M 3.82M 0
vnic1 8 336 0 0 0
e1000g0 0 0 0 0 0
nxge1 82.13K 123.69M 50.00K 32.13K 0
vnic1 0 0 0 0 0
. . . . . .
. . . . . .
3 Displaying Statistics per Hardware Ring
The following commands displays statistics on a per
receive-side hardware ring basis.
# dlstat show-phys -r nxge1
LINK TYPE INDEX IPKTS RBYTES
nxge1 rx 0 0 0
nxge1 rx 1 0 0
nxge1 rx 2 1.73M 2.61G
nxge1 rx 3 0 0
nxge1 rx 4 8.44M 12.71G
nxge1 rx 5 5.68M 8.56G
nxge1 rx 6 4.90M 7.38G
nxge1 rx 7 0 0
4 Displaying Statistics per Lane
The following commands displays statistics on a per
receive-side lane basis. First, an interface with dedicated
hardware lanes:
# dlstat show-link -r nxge1
LINK TYPE ID INDEX IPKTS RBYTES INTRS POLLS IDROPS
nxge1 rx local -- 0 0 0 0 0
nxge1 rx hw 1 0 0 0 0 0
nxge1 rx hw 2 1.73M 2.61G 1.33M 400.22K 0
nxge1 rx hw 3 0 0 0 0 0
nxge1 rx hw 4 8.44M 12.71G 4.35M 4.09M 0
nxge1 rx hw 5 5.68M 8.56G 3.72M 1.97M 0
nxge1 rx hw 6 4.90M 7.38G 3.11M 1.80M 0
nxge1 rx hw 7 0 0 0 0 0
Then, an interface without dedicated hardware lanes, that
is, a software lane only:
# dlstat show-link -r ixgbe0
LINK TYPE ID INDEX IPKTS RBYTES INTRS POLLS IDROPS
ixgbe0 rx local -- 0 0 0 0 0
ixgbe0 rx sw -- 794.28K 1.19G 794.28K 0 0
5 Displaying Transmit-Side Statistics
The following command displays transmit-side statistics at
five-second intervals.
# dlstat -t -i 5
LINK OPKTS OBYTES ODROPS
e1000g0 40.24K 4.37M 0
nxge1 9.76M 644.14M 0
vnic1 0 0 0
e1000g0 0 0 0
nxge1 26.82K 1.77M 0
vnic1 0 0 0
. . . .
6 Displaying Transmit-Side Ring Statistics
The following command displays transmit-side hardware ring
statistics.
# dlstat show-phys -t nxge1
LINK TYPE INDEX OPKTS OBYTES
nxge1 tx 0 44 3.96K
nxge1 tx 1 0 0
nxge1 tx 2 1.48M 121.68M
nxge1 tx 3 2.45M 201.11M
nxge1 tx 4 1.47M 120.82M
nxge1 tx 5 0 0
nxge1 tx 6 1.97M 161.57M
nxge1 tx 7 4.59M 376.21M
nxge1 tx 8 2.43M 199.24M
nxge1 tx 9 0 0
nxge1 tx 10 3.23M 264.69M
nxge1 tx 11 1.88M 153.96M
7 Displaying Transmit-Side Lane Statistics
The following command displays transmit-side lane statis-
tics.
# dlstat show-link -t nxge1
LINK TYPE ID INDEX OPKTS OBYTES ODROPS
nxge1 tx hw 0 32 1.44K 0
nxge1 tx hw 1 0 0 0
nxge1 tx hw 2 1.48M 97.95M 0
nxge1 tx hw 3 2.45M 161.87M 0
nxge1 tx hw 4 1.47M 97.25M 0
8 Selecting a Particular Set of Statistics
The following command shows how you can select a set of
statistics of particular interest.
# dlstat show-link -r -o LINK,TYPE,ID,INDEX,INTRS,POLLS nxge1
LINK TYPE ID INDEX INTRS POLLS
nxge1 rx local -- 0 0
nxge1 rx other -- 0 0
nxge1 rx hw 1 0 0
nxge1 rx hw 2 2.47M 753.90K
nxge1 rx hw 3 0 0
nxge1 rx hw 4 8.24M 7.72M
nxge1 rx hw 5 6.96M 3.68M
nxge1 rx hw 6 5.82M 3.36M
nxge1 rx hw 7 0 0
9 Displaying Historical Network Usage
Network usage history statistics can be stored by using the
extended accounting facility, acctadm(1M), with a command
such as the following:
# acctadm -e basic -f /var/log/net.log net
acctadm net
Network accounting: active
Network accounting file: /var/log/net.log
Tracked Network resources: basic
Untracked Network resources: src_ip,dst_ip,src_port,dst_port,protocol,
dsfield
# dlstat show-link -h -f /var/log/net.log
LINK DURATION IPACKETS RBYTES OPACKETS OBYTES BANDWIDTH
e1000g0 80 1031 546908 0 0 2.44 Kbps
The following command creates the address 10.2.3.4/24 on
interface bge1 (linkname net1) and marks the address up, for
use.
# ipadm create-ip net1
# ipadm create-addr -T static -a local=10.2.3.4/24 net1/v4static1
# ipadm create-addr -T static -d -a 10.2.3.5/24 net1/v4static2
# ipadm up-addr net1/v4static2
If the DUPLICATE flag was set on the address object, then
refresh-addr will verify that the address is still a dupli-
cate on the network. If it is not, the address will be
marked up.
# ipadm refresh-addr net1/v4static2
The following command lists the addresses that were config-
ured. This shows that the address net1/v4static2 is not a
duplicate.
# ipadm show-addr
ADDROBJ TYPE STATE ADDR
lo0/v4 static ok 127.0.0.1/8
lo0/v6 static ok ::/128
net1/v4static1 static ok 10.2.3.4/24
net1/v4static2 static ok 10.2.3.10/24
Example 2 Creating DHCPv4-controlled Addresses
The following command obtains a DHCPv4 address on interface
bge1 (linkname net1).
# ipadm create-ip net1
# ipadm create-addr -T dhcp net1/dhaddr
# ipadm show-addr net1/dhaddr
ADDROBJ TYPE STATE ADDR
net1/dhaddr dhcp ok 10.8.48.173/25
SunOS 5.11 Last change: 22 Jul 2011 39
System Administration Commands ipadm(1M)
The following command extends the lease duration for the
DHCPv4 address object net1/dhaddr.
# ipadm refresh-addr net1/dhaddr
# ipadm create-addr -T static -a local=2ff0::f3ad/64 net1/v6static
# ipadm set-addrprop -p prefixlen=80 net1/v6static
# ipadm show-addr
ADDROBJ TYPE STATE ADDR
lo0/v4 static ok 127.0.0.1/8
Example 4 Configuring an IPv4 Tunnel
The first command below (ipadm) creates the tunnel source
address. Then, a dladm command creates the tunnel link. The
final ipadm commands configure the IPv4 and IPv6 addresses
on the tunnel IP interface.
# ipadm create-ip net1
# ipadm create-addr -T static -a local=10.2.3.4/24 net1/v4static
# dladm create-iptun -T ipv4 -a local=10.2.3.4,remote=10.2.3.5 tun0
# ipadm create-ip tun0
# ipadm create-addr -T static \
-a local=173.129.134.1,remote=173.129.134.2 tun0/v4tunaddr
# ipadm create-addr -T static \
-a local=2ff1::3344,remote=2ff1::3345 tun0/v6tunaddr
# ipadm show-addr
ADDROBJ TYPE STATE ADDR
lo0/v4 static ok 127.0.0.1/8
lo0/v6 static ok ::/128
net1/v4static static ok 10.2.3.4/24
tun0/v4tunaddr static ok 173.129.134.1-->173.129.134.2
tun0/v6tunaddr static ok 2ff1::3344-->2ff1::3345
Example 5 Viewing All of the Interfaces
The following command enables you to view all interfaces.
# ipadm show-if -o all
IFNAME CLASS STATE ACTIVE CURRENT PERSISTENT OVER
lo0 loopback ok yes -m-v------46 --46 --
net0 ip ok yes bm--------46 --46 --
e1000g0 ip ok yes bm---l----46 -l46 --
e1000g1 ip ok yes bm---l----46 -l46 --
ipmp0 ipmp down yes bm--------46 --46 e1000g0 e1000g1
tun0 ip failed no -mp-------46 --46 --
vni0 vni disabled no bm-v-------- --46 --
SunOS 5.11 Last change: 22 Jul 2011 41
System Administration Commands ipadm(1M)
Example 6 Displaying Interface Properties
The following command displays all interface properties for
a specified interface.
# ipadm show-ifprop net0
IFNAME PROPERTY PROTO PERM CURRENT PERSISTENT DEFAULT POSSIBLE
net0 arp ipv4 rw on -- on on,off
net0 forwarding ipv4 rw off on off on,off
net0 metric ipv4 rw 2 2 0 --
net0 mtu ipv4 rw 1500 -- 1500 68-1500
net0 exchange_routes ipv4 rw off -- off on,off
net0 usesrc ipv4 rw none -- none --
net0 forwarding ipv6 rw off -- off on,off
net0 metric ipv6 rw 2 2 0 --
net0 mtu ipv6 rw 1500 -- 1500 1280-1500
net0 nud ipv6 rw on -- on on,off
net0 exchange_routes ipv6 rw off on off on,off
net0 usesrc ipv6 rw none -- none --
net0 group ip rw grp0 -- -- --
net0 standby ip r- off -- off on,off
Example 7 Configuring per-Interface Properties
The following command sets the IPv4 MTU of the interface
net0 to 900.
# ipadm set-ifprop -m ipv4 -p mtu=900 net0
The following command sets the IPv6 MTU of the interface
net0 to 1400.
# ipadm set-ifprop -m ipv6 -p mtu 1400 net0
View the results:
# ipadm show-ifprop -p mtu net0
IFNAME PROPERTY PROTO PERM CURRENT PERSISTENT DEFAULT POSSIBLE
SunOS 5.11 Last change: 22 Jul 2011 42
System Administration Commands ipadm(1M)
net0 mtu ipv4 rw 900 900 1500 68-1500
net0 mtu ipv6 rw 1400 1400 1500 1280-1500
# ipadm show-ifprop -m ipv6 -p mtu net0
IFNAME PROPERTY PROTO PERM CURRENT PERSISTENT DEFAULT POSSIBLE
net0 mtu ipv6 rw 1400 1400 1500 1280-1500
Example 8 Displaying Supported Properties
The following command displays the properties supported on
TCP.
# ipadm show-prop tcp
Example 12 Creating IPMP Interfaces
The following command sequence creates an IPMP interface and
adds underlying interfaces to it.
# ipadm create-ip e1000g0
# ipadm create-ip e1000g1
# ipadm create-ip e1000g2
# ipadm set-ifprop -p standby=on -m ip e1000g2
# ipadm create-ipmp testgroup0
# ipadm add-ipmp -i e1000g0 -i e1000g1 -i e1000g2 testgroup0
# ipadm create-addr -T static -a local=192.168.80.5/24 testgroup0/data1
# ipadm create-addr -T static -a local=192.168.80.6/24 testgroup0/data2
# ipadm show-if
IFNAME CLASS STATE ACTIVE OVER
lo0 loopback ok yes --
net0 ip ok yes --
e1000g0 ip ok yes --
e1000g1 ip ok yes --
ipmp0 ipmp ok yes e1000g0 e1000g1
testing IPMP:-
# ipadm show-addr
ADDROBJ TYPE STATE ADDR
lo0/v4 static ok 127.0.0.1/8
testgroup0/v4 static ok 10.66.10.107/24
net1/_a static ok fe80::214:4fff:fefa:9a9b/10
# ipadm show-if
IFNAME CLASS STATE ACTIVE OVER
lo0 loopback ok yes --
testgroup0 ipmp ok yes net0 net1
net0 ip ok yes --
net1 ip ok yes --
net2 ip down no --
# if_mpadm -d net1
# ipadm show-if
IFNAME CLASS STATE ACTIVE OVER
lo0 loopback ok yes --
testgroup0 ipmp ok yes net0 net1
net0 ip ok yes --
net1 ip offline no --
net2 ip down no --
# ipadm show-addr
ADDROBJ TYPE STATE ADDR
lo0/v4 static ok 127.0.0.1/8
testgroup0/v4 static ok 10.66.10.107/24
net1/_a static down fe80::214:4fff:fefa:9a9b/10
# ifconfig -a
lo0: flags=2001000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4,VIRTUAL> mtu 8232 index 1
inet 127.0.0.1 netmask ff000000
testgroup0: flags=8001000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4,IPMP> mtu 1500 index 2
inet 10.66.10.107 netmask ffffff00 broadcast 10.66.10.255
groupname testgroup0
net0: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 3
inet 0.0.0.0 netmask ff000000 broadcast 0.255.255.255
groupname testgroup0
ether 0:14:4f:f8:cd:ac
net1: flags=81000842<BROADCAST,RUNNING,MULTICAST,IPv4,OFFLINE> mtu 1500 index 4
inet 0.0.0.0 netmask ff000000 broadcast 0.255.255.255
groupname testgroup0
ether 0:14:4f:fa:9a:9b
net2: flags=1000842<BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 5
inet 0.0.0.0 netmask 0
ether 0:14:4f:fb:99:b6
testgroup0: flags=28002000840<RUNNING,MULTICAST,IPv6,IPMP> mtu 1500 index 2
inet6 ::/0
groupname testgroup0
net1: flags=20082000840<RUNNING,MULTICAST,IPv6,OFFLINE> mtu 1500 index 4
inet6 fe80::214:4fff:fefa:9a9b/10
groupname testgroup0
ether 0:14:4f:fa:9a:9b
net2: flags=20002000840<RUNNING,MULTICAST,IPv6> mtu 1500 index 5
inet6 ::/0
ether 0:14:4f:fb:99:b6
# if_mpadm -r net1
# ipadm show-addr
ADDROBJ TYPE STATE ADDR
lo0/v4 static ok 127.0.0.1/8
testgroup0/v4 static ok 10.66.10.107/24
net1/_a static ok fe80::214:4fff:fefa:9a9b/10
# ipadm show-if
IFNAME CLASS STATE ACTIVE OVER
lo0 loopback ok yes --
testgroup0 ipmp ok yes net0 net1
net0 ip ok yes --
net1 ip ok yes --
net2 ip down no --
1 Displaying Statistics
To display statistics for all the links, enter following
command. Statistics are displayed as 3-digits followed by
decimal and then 2 digits with the appropriate unit.
# dlstat
LINK IPKTS RBYTES OPKTS OBYTES
e1000g0 101.88K 32.86M 40.16K 4.37M
nxge1 4.50M 6.78G 1.38M 90.90M
vnic1 8 336 0 0
net0 73.96K 6.81M 0 0
zone1/net0 144.47K 13.32M 247 16.29K
zone2/net0 132.89K 12.25M 236 15.82K
2 Displaying RX-side Statistics
The following command displays receive-side statistics every
one second.
# dlstat -r -i 1
LINK IPKTS RBYTES INTRS POLLS IDROPS
e1000g0 101.91K 32.86M 87.56K 14.35K 0
nxge1 9.61M 14.47G 5.79M 3.82M 0
vnic1 8 336 0 0 0
e1000g0 0 0 0 0 0
nxge1 82.13K 123.69M 50.00K 32.13K 0
vnic1 0 0 0 0 0
. . . . . .
. . . . . .
3 Displaying Statistics per Hardware Ring
The following commands displays statistics on a per
receive-side hardware ring basis.
# dlstat show-phys -r nxge1
LINK TYPE INDEX IPKTS RBYTES
nxge1 rx 0 0 0
nxge1 rx 1 0 0
nxge1 rx 2 1.73M 2.61G
nxge1 rx 3 0 0
nxge1 rx 4 8.44M 12.71G
nxge1 rx 5 5.68M 8.56G
nxge1 rx 6 4.90M 7.38G
nxge1 rx 7 0 0
4 Displaying Statistics per Lane
The following commands displays statistics on a per
receive-side lane basis. First, an interface with dedicated
hardware lanes:
# dlstat show-link -r nxge1
LINK TYPE ID INDEX IPKTS RBYTES INTRS POLLS IDROPS
nxge1 rx local -- 0 0 0 0 0
nxge1 rx hw 1 0 0 0 0 0
nxge1 rx hw 2 1.73M 2.61G 1.33M 400.22K 0
nxge1 rx hw 3 0 0 0 0 0
nxge1 rx hw 4 8.44M 12.71G 4.35M 4.09M 0
nxge1 rx hw 5 5.68M 8.56G 3.72M 1.97M 0
nxge1 rx hw 6 4.90M 7.38G 3.11M 1.80M 0
nxge1 rx hw 7 0 0 0 0 0
Then, an interface without dedicated hardware lanes, that
is, a software lane only:
# dlstat show-link -r ixgbe0
LINK TYPE ID INDEX IPKTS RBYTES INTRS POLLS IDROPS
ixgbe0 rx local -- 0 0 0 0 0
ixgbe0 rx sw -- 794.28K 1.19G 794.28K 0 0
5 Displaying Transmit-Side Statistics
The following command displays transmit-side statistics at
five-second intervals.
# dlstat -t -i 5
LINK OPKTS OBYTES ODROPS
e1000g0 40.24K 4.37M 0
nxge1 9.76M 644.14M 0
vnic1 0 0 0
e1000g0 0 0 0
nxge1 26.82K 1.77M 0
vnic1 0 0 0
. . . .
6 Displaying Transmit-Side Ring Statistics
The following command displays transmit-side hardware ring
statistics.
# dlstat show-phys -t nxge1
LINK TYPE INDEX OPKTS OBYTES
nxge1 tx 0 44 3.96K
nxge1 tx 1 0 0
nxge1 tx 2 1.48M 121.68M
nxge1 tx 3 2.45M 201.11M
nxge1 tx 4 1.47M 120.82M
nxge1 tx 5 0 0
nxge1 tx 6 1.97M 161.57M
nxge1 tx 7 4.59M 376.21M
nxge1 tx 8 2.43M 199.24M
nxge1 tx 9 0 0
nxge1 tx 10 3.23M 264.69M
nxge1 tx 11 1.88M 153.96M
7 Displaying Transmit-Side Lane Statistics
The following command displays transmit-side lane statis-
tics.
# dlstat show-link -t nxge1
LINK TYPE ID INDEX OPKTS OBYTES ODROPS
nxge1 tx hw 0 32 1.44K 0
nxge1 tx hw 1 0 0 0
nxge1 tx hw 2 1.48M 97.95M 0
nxge1 tx hw 3 2.45M 161.87M 0
nxge1 tx hw 4 1.47M 97.25M 0
8 Selecting a Particular Set of Statistics
The following command shows how you can select a set of
statistics of particular interest.
# dlstat show-link -r -o LINK,TYPE,ID,INDEX,INTRS,POLLS nxge1
LINK TYPE ID INDEX INTRS POLLS
nxge1 rx local -- 0 0
nxge1 rx other -- 0 0
nxge1 rx hw 1 0 0
nxge1 rx hw 2 2.47M 753.90K
nxge1 rx hw 3 0 0
nxge1 rx hw 4 8.24M 7.72M
nxge1 rx hw 5 6.96M 3.68M
nxge1 rx hw 6 5.82M 3.36M
nxge1 rx hw 7 0 0
9 Displaying Historical Network Usage
Network usage history statistics can be stored by using the
extended accounting facility, acctadm(1M), with a command
such as the following:
# acctadm -e basic -f /var/log/net.log net
acctadm net
Network accounting: active
Network accounting file: /var/log/net.log
Tracked Network resources: basic
Untracked Network resources: src_ip,dst_ip,src_port,dst_port,protocol,
dsfield
# dlstat show-link -h -f /var/log/net.log
LINK DURATION IPACKETS RBYTES OPACKETS OBYTES BANDWIDTH
e1000g0 80 1031 546908 0 0 2.44 Kbps
No comments:
Post a Comment