Set configuration setting

Synopsis

  set <setting> <value>

Examples

Configure a static IP address for the interface "net0"

  set net0/ip 192.168.0.100
  set net0/netmask 255.255.255.0
  set net0/gateway 192.168.0.1

Configure a DNS server

  set dns 192.168.0.1

Boot system, preserving any SAN connection

  set keep-san 1
  autoboot

Change MAC address of interface "net0"

  ifclose net0
  set net0/mac 52:54:00:12:34:56
  ifopen net0

Clear the screen

  set esc:hex 1b            # ANSI escape character - "^["
  set cls ${esc:string}[2J  # ANSI clear screen sequence - "^[[2J"
  echo ${cls}

Description

Set value of the specified configuration setting to the specified value.

The value will be interpreted according to the type specified as part of the setting name. For example, the command:

  set net0/ip:hex 0a:00:00:64

is equivalent to the command:

  set net0/ip:ipv4 10.0.0.100

If no type is explicitly specified, then the setting's default type will be used.

Command status

Success The configuration setting was applied successfully
Failure The configuration setting was not applied successfully

See also

Notes

You can use the config command to browse and edit settings interactively.

You can use the read command to prompt the user to enter a single setting.

Settings are generally applied immediately. For example, the command:

  set net0/ip 192.168.0.1

will immediately change the IPv4 address associated with the network interface “net0”. In some cases, further action may be required in order to apply a setting. For example, the command:

  set net0/mac 52:54:00:12:34:56

will not take effect properly until the network interface is closed and reopened. See the documentation on individual settings for further details.

Older versions of iPXE allowed ANSI escape sequences to be defined using code such as:

  set esc:hex 1b ; set cls ${esc}[2J ; echo ${cls}

This should instead be

  set esc:hex 1b ; set cls ${esc:string}[2J ; echo ${cls}
 
cmd/set.txt · Last modified: 2013/08/01 14:19 by mcb30
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki
All uses of this content must include an attribution to the iPXE project and the URL http://ipxe.org
References to "iPXE" may not be altered or removed.