Commands related to network configuration
This module provides procedures to retrieve network information for IPv4 and IPv6.
This module provides commands to retrieve various network-related data for the local system including DNS and DHCP information, type and configuration of network interfaces, traffic statistics and various other information.
The module also provides some client side name resolution lookup functions including nonblocking name and address lookups.
Some commands only support IPv4 due to lack of underlying Windows support for the underlying Windows API on Windows XP and Windows 2003. This is noted where applicable.
-ifindex INTERFACEINDEX | Limits the returned entries to those in the ARP table for the specified network interface with index INTERFACEINDEX. |
-sort | Returns the entries sorted by interface index, then IP address. |
-validonly | Skips entries that are marked invalid. |
-adapterdescription | Returns a description of the adapter associated with the interface. |
-adapterindex | Returns the index of the adapter associated with the interface. |
-adaptername | Returns the name of the adapter associated with the interface. |
-adminstatus | Returns 1 or 0 depending on whether the interface has been administratively enabled or not. |
-all | Returns all option values. |
-autoconfigactive | Returns 1 if the interface has been autoconfigured with an address, and 0 otherwise. |
-autoconfigenabled | Returns 1 if autoconfiguration is enabled on the interface if a DHCP server cannot be found, and 0 otherwise. |
-defaultgateway | Returns the address of the default gateway on the interface. |
-description | Returns a description of the interface. |
-dhcpenabled | Returns 1 if DHCP is enabled on the interface, else 0. |
-dhcpleaseend | Returns the time, in seconds since Jan 1, 1970, that the DHCP lease will expire. |
-dhcpleasestart | Returns the time, in seconds since Jan 1, 1970, that the DHCP lease was obtained. |
-dhcpserver | Returns the address of the DHCP server on the network interface. |
-dnsservers | Returns a list of DNS servers on that interface. |
-havewins | Returns 1 if the interface uses WINS, else 0. |
-ifindex | Returns the interface index. This is the same as INTERFACEINDEX unless the latter is specified as a name. |
-ifname | Returns the name of the network interface. |
-inbytes | Returns the number of bytes received through this interface. |
-indiscards | Returns the number of incoming packets on this interface that were discarded even though they had no errors. |
-inerrors | Returns the number of incoming packets on this interface that were discarded because of errors. |
-innonunicastpkts | Returns the number of broadcast or multicast packets received through this interface. |
-inunicastpkts | Returns the number of unicast packets received through this interface. |
-inunknownprotocols | Returns the number of incoming packets on this interface that were discarded because of the protocol was unknown. |
-laststatuschange | Returns the last time the operational status changed. |
-ipaddresses | Returns a list sublists containing the IP addresses and masks for the interface. |
-mtu | Returns the maximum transmission unit of the interface. |
-operstatus | Returns the operational status of the interface. This is one of the values nonoperational, wanunreachable, disconnected, wanconnecting, wanconnected, operational. |
-outbytes | Returns the number of bytes transmitted through this interface. |
-outdiscards | Returns the number of outgoing packets on this interface that were discarded even though they had no errors. |
-outerrors | Returns the number of outgoing packets on this interface that were discarded because of errors. |
-outnonunicastpkts | Returns the number of broadcast or multicast packets transmitted through this interface. |
-outqlen | Returns the output queue length on this interface. |
-outunicastpkts | Returns the number of unicast packets transmitted through this interface. |
-physicaladdress | Returns the physical address of the network interface. |
-primarywins | Returns the address of the primary WINS server, if any. |
-reassemblysize | Returns the maximum size of a reassembled packet that is supported by the interface. |
-secondarywins | Returns the address of the secondary WINS server, if any. |
-speed | Returns the speed of the network interface in bits per second. |
-type | Returns the network interface type. This is an integer value as defined by IANA. Some common values are 6 (Ethernet), 9 (token ring), 23 (PPP), 24 (loopback), 71 (802.11 wireless), 131 (tunneling) and 144 (IEEE 1394 Firewire). |
-adaptername | Returns the name of the adapter associated with the interface. |
-all | Returns all option values. |
-anycastaddresses | Returns list of anycast addresses associated with the interface. Each element in the list is a dictionary, with the key -address containing the address. Other keys in the dictionary should be ignored. |
-description | Returns a description of the interface. |
-dhcpenabled | Returns 1 if DHCP is enabled on the interface, else 0. |
-dnsservers | Returns a list of DNS servers on that interface. Each element in the list is a dictionary, with the key -address containing the address of the server. Other keys in the dictionary should be ignored. |
-ipv6ifindex | Returns the interface index. This is the same as INTERFACEINDEX unless the latter is specified as a name or friendly name. |
-multicastaddresses | Returns list of multicast addresses associated with the interface. Each element in the list is a dictionary, with the key -address containing the address. Other keys in the dictionary should be ignored. |
-operstatus | Returns the operational status of the interface as defined in RFC2863. Some common values are 1 (up), 2 (down), 3 (testing mode), 4 (unknown state), 5 (dormant), 6 (not present), 7 (lower layer is down). |
-physicaladdress | Returns the physical address of the network interface. |
-prefixes | Returns list of address prefixes associated with the interface. Each element in the list is a dictionary, with the key -address containing the address and the key -prefixlength containing the number of bits in the prefix. Other keys in the dictionary should be ignored. |
-type | Returns the network interface type. This is an integer value as defined by IANA. Some common values are 6 (Ethernet), 9 (token ring), 23 (PPP), 24 (loopback), 71 (802.11 wireless), 131 (tunneling) and 144 (IEEE 1394 Firewire). of ethernet, tokenring, fddi, ppp, loopback, slip or other. |
-unicastaddresses | Returns list of unicast addresses associated with the interface. Each element in the list is a dictionary, with the key -address containing the address. Other keys in the dictionary should be ignored. |
-all | Returns all values. |
-arpproxyenabled | Returns 1 if ARP proxying is enabled and 0 otherwise. |
-dhcpscopeid | Returns the DHCP scope id. |
-dnsenabled | Returns 1 if DNS name resolution is enabled on the system and 0 otherwise. |
-dnsservers | Returns a list of DNS server addresses used for name resolution. |
-domain | Returns the system domain. |
-hostname | Returns the host name of the system. |
-routingenabled | Returns 1 if routing is enabled on the system and 0 otherwise. |
-dest DESTADDR | Specifies the destination address for which the route is to be returned. If unspecified, defaults to 0.0.0.0 which corresponds to the default route. |
-source SRCADDR | Specifies the source address to be used. This can affect the route selected. Defaults to 0.0.0.0 which indicates the source address should not affect which route is selected. |
-addr | The destination address that together with the -mask field specifies the address range to which the route applies. |
-age | The age of the route in seconds. This is valid only if the Routing and Remote Access service is running and the protocol is netmgmt. |
-ifindex | The interface index for this route. |
-mask | The network mask that together with -dest specifies the address range to which the route applies. |
-metric1 | A routing protocol specific metric value. |
-metric2 | A routing protocol specific metric value. |
-metric3 | A routing protocol specific metric value. |
-metric4 | A routing protocol specific metric value. |
-metric5 | A routing protocol specific metric value. |
-nexthop | The IP address of next hop in the route to the destination. |
-nexthopas | The autonomous system number of the next hop. |
-policy | Multi-path route selector condition, typically in IP TOS format as defined in RFC 1354. |
-protocol | Protocol that generated the route. |
-type | The type of the route. This is one of local, remote, other or invalid. |
-all | Returns all fields for a connection. This option is assumed if no other field option is specified. |
-bindtime | Returns the time at which the last bind operation was done on the socket, or 0 if no bind has been done. This may not be available in which case, an empty string is returned for the value. Deprecated |
-localaddr | Returns the local address being used for the connection. |
-localport | Returns the local port number being used for the connection. |
-modulename | Returns the name of the process module that owns the socket. This may not be available in which case, an empty string is returned for the value. This value is always the empty string for IPv6 to work around a Windows bug. Deprecated |
-modulepath | Returns the path to the process module that owns the socket. This may not be available in which case, an empty string is returned for the value. This value is always the empty string for IPv6 to work around a Windows bug. Deprecated |
-pid | Returns the PID of the process communicating on the port. On some platforms, this may not be available in which case, an empty string is returned for the value. |
-remoteaddr | Returns the address of the remote end of the connection. |
-remoteport | Returns the port number of the remote end of the connection. |
-state | Returns the connection state. This is one of closed, listen, syn_sent, syn_rcvd, estab, fin_wait1, fin_wait2, close_wait, closing, last_ack, time_wait or delete_tcb. |
-ipversion IPVERSION | If IPVERSION is 0 (default), any or all, both IPv4 and IPv6 connections are returned. If IPVERSION is 4 or inet, only IPv4 connections are returned and if it is 6 or inet6, only IPv6 connections are returned. |
-matchlocaladdr HOSTLIST | Only returns those connections whose local address is one of those specified in HOSTLIST. Each element of HOSTLIST may be either an IP address or a host name. |
-matchlocalport PORTNUMBER | Only returns those connections whose local port is the specified number. |
-matchpid PID | Only returns those connections owned by the process with the specified PID. On platforms where the PID is not available, specifying this option will generate an error. |
-matchremoteaddr HOSTLIST | Only returns those connections whose remote address is one of those specified in HOSTLIST. Each element of HOSTLIST may be either an IP address or a host name. |
-matchremoteport PORTNUMBER | Only returns those connections whose remote port is PORTNUMBER. |
matchstate STATELIST | Only returns those connections whose state is one those specified in STATELIST which should be a list of connection state values (see above). |
-all | Returns all fields for a connection. This option is assumed if no other field option is specified. |
-bindtime | Returns the time at which the last bind operation was done on the socket, or 0 if no bind has been done. This may not be available in which case, an empty string is returned for the value. Deprecated |
-localaddr | Returns the local address being used for the connection. |
-localport | Returns the local port number being used for the connection. |
-modulename | Returns the name of the process module that owns the socket. This may not be available in which case, an empty string is returned for the value. This value is always the empty string for IPv6 to work around a Windows bug. Deprecated |
-modulepath | Returns the path to the process module that owns the socket. This may not be available in which case, an empty string is returned for the value. This value is always the empty string for IPv6 to work around a Windows bug. Deprecated |
-pid | Returns the PID of the process communicating on the port. On some platforms, this may not be available in which case, an empty string is returned for the value. |
-ipversion IPVERSION | If IPVERSION is 0 (default), any or all, both IPv4 and IPv6 connections are returned. If IPVERSION is 4 or inet, only IPv4 connections are returned and if it is 6 or inet6, only IPv6 connections are returned. |
-matchlocaladdr HOSTLIST | Only returns those connections whose local address is one of those specified in HOSTLIST. Each element of HOSTLIST may be either an IP address or a host name. |
-matchlocalport PORTNUMBER | Only returns those connections whose local port is the specified number. |
-matchpid PID | Only returns those connections owned by the process with the specified PID. On platforms where the PID is not available, specifying this option will generate an error. |
-matchlocaladdr IPADDR | Only matches those connections whose local address is bound to IPADDR. |
-matchlocalport PORTNUMBER | Only matches those connections whose local port is the specified number. |
-matchpid PID | Only matches those connections owned by the process with the specified PID. On platforms where the PID is not available, specifying this option will generate an error. |
-matchremoteaddr IPADDR | Only matches those connections whose remote address is bound to IPADDR. |
-matchremoteport PORTNUMBER | Only matches those connections whose remote port is PORTNUMBER. |
matchstate STATELIST | Only matches those connections whose state is one those specified in STATELIST which should be a list of connection state values. See get_tcp_connections for a list of valid values. |
Copyright © 2004-2011, Ashok P. Nadkarni