6.3. Provisioning Hosts with Static IP Addresses
6.3.1. Using Custom Templates to Assign Static IP Addresses
Procedure 6.5. To Edit a PXE Template:
- Navigate to → and click the name of the host whose template you want to edit.
- Click the Templates tab to display the list of available template types.
- Click for the PXELinux Template type. The template displays in the template editor.
- Make the required changes and then click . See Example 6.1, “Editing the PXE Template to Assign Static IP Addresses” for an example of how to update a PXE template.
Example 6.1. Editing the PXE Template to Assign Static IP Addresses
default linux
label linux
kernel <%= @kernel %>
<% if @host.operatingsystem.name == 'Fedora' and @host.operatingsystem.major.to_i > 16 -%>
append initrd=<%= @initrd %> ks=<%= foreman_url('provision')%>&static=yes ks.device=bootif network ks.sendmac
<% elsif @host.operatingsystem.name != 'Fedora' and @host.operatingsystem.major.to_i >= 7 -%>
append initrd=<%= @initrd %> ks=<%= foreman_url('provision')%>&static=yes network ks.sendmac
<% else -%>
append initrd=<%= @initrd %> ks=<%= foreman_url('provision')%>&static=yes ksdevice=bootif network kssendmac
<% end -%>
IPAPPEND 26.3.2. Using Host Parameters to Assign Static IP Addresses
if statement in conjunction with host parameters to set a static IP address.
Example 6.2. Using Host Parameters to Assign Static IP Addresses
<% if @host.params['my_param_deploy_static'] == "true" -%>
network --bootproto <%= "static --ip=#{@host.ip} --netmask=#{@host.subnet.mask} --gateway=#{@host.subnet.gateway} --nameserver=#{[@host.subnet.dns_primary,@host.subnet.dns_secondary].reject{|n| n.blank?}.join(',')}" %> --hostname <%= @host %>
<% else -%>
network --bootproto 'dhcp' --hostname <%= @host %>
<% end -%>6.3.3. Using Subnets to Set Static IP Addresses
Procedure 6.6. To Specify Static Boot Mode by Default:
- Navigate to → and click the name of the subnet that you want to configure. To create a new subnet, follow the steps in Procedure 2.4, “To Select the Default Subnet:”.
- On the Subnet tab, select
Staticfrom the Boot mode drop-down list, and then click .

Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.