Go to main content

手册页部分 8:系统管理命令

退出打印视图

更新时间: 2022年7月27日 星期三
 
 

netstrategy(8)

名称

netstrategy - return network configuration information

用法概要

/usr/sbin/netstrategy [-v]

描述

The netstrategy command determines the network configuration strategy in use on a system and returns information in a form that is easily consumable by a script. The command returns three tokens:

<root filesystem type> <primary interface> <network config strategy>

These tokens are described as follows:

<root filesystem type>

Type of filesystem that contains the bootable kernel, as would be specified in the fstype column of the mnttab(5).

<primary interface>

Name of the primary network interface. If the network config strategy is 'dhcp', then this token is the name of the interface with which the primary dhcp lease is associated. If the network config strategy is not 'dhcp', this token is 'none'.

<network config strategy>

The means by which a system obtains its IP address for booting. This can be one of dhcp or none.

The netstrategy command is not intended for use on a command line.

选项

The following option is supported:

–v

Includes the IP version of the primary interface as a fourth token. If the primary interface is 'none', then this token will also be 'none'. If the network config strategy is 'dhcp' and the primary interface specified a valid interface, this token will have the value of 'inet' (an IPv4 address is primary) or 'inet6' (and IPv6 address is primary).

退出状态

0

Success.

!=0

An error occurred.

属性

See attributes(7) for descriptions of the following attributes:

ATTRIBUTE TYPE
ATTRIBUTE VALUE
Availability
system/core-os
Interface Stability
Committed

另请参见

mnttab(5), attributes(7), ipadm(8)