romatlo
Enthusiast
Enthusiast

vSphere 5.5 kickstart to configure static IP

Jump to solution

Hello folks,

I've spent some time trying to an unintended install to work correctly and adding functionality as I go.

Right now I am trying to run a command after initial install and reboot to configure a static ip address for the host.

I can tell that the configuration file is applying but is not setting the IP.  Still set to DHCP when finished.

Anyone can tell from my ks.cfg file what I may be doing wrong?

Thanks, romatlo

# Sample scripted installation file

#

# Accept the VMWare End User License Agreement

vmaccepteula

# Set the root password for the DCUI and Tech Support mode

rootpw tet_password1

# The install media is in the CD-ROM drive

install --firstdisk --overwritevmfs

# Set the network to DHCP on the first network adapter

network --bootproto=dhcp --device=vmnic0 --addvmportgroup=0

reboot

%firstboot --interpreter=busybox

# Assign an IP address to the first VMkernel, used for management

esxcli network ip interface ipv4 set --interface-name=vmk0 --ipv4=192.168.32.15 --netmask=255.255.255.0 --gateway=192.168.32.1 --type=static

1 Solution

Accepted Solutions
virtualg_uk
Leadership
Leadership

From memory, don;t you need to create a VMkernel interface first?

--interface-name | -iThe name of the VMkernel network interface to set IPv4 settings for. This name must be an interface listed in the interface list command.

vSphere Documentation Center

Double check that vmk0 is listed when you run

network ip interface list

Also, what happens if you install ESXi manually and run this?

# Assign an IP address to the first VMkernel, used for management

esxcli network ip interface ipv4 set --interface-name=vmk0 --ipv4=192.168.32.15 --netmask=255.255.255.0 --gateway=192.168.32.1 --type=static

FYI In my ks.cfg I have this

network --bootproto=static --ip=192.168.250.21 --gateway=192.168.250.1 --nameserver=192.168.250.6 --netmask=255.255.255.0 --hostname=esxi5-.lab.local --device=vmnic0 --addvmportgroup=0

in place of

network --bootproto=dhcp --device=vmnic0 --addvmportgroup=0

and

esxcli network ip interface ipv4 set --interface-name=vmk0 --ipv4=192.168.32.15 --netmask=255.255.255.0 --gateway=192.168.32.1 --type=static


Graham | User Moderator | https://virtualg.uk

View solution in original post

0 Kudos
2 Replies
virtualg_uk
Leadership
Leadership

From memory, don;t you need to create a VMkernel interface first?

--interface-name | -iThe name of the VMkernel network interface to set IPv4 settings for. This name must be an interface listed in the interface list command.

vSphere Documentation Center

Double check that vmk0 is listed when you run

network ip interface list

Also, what happens if you install ESXi manually and run this?

# Assign an IP address to the first VMkernel, used for management

esxcli network ip interface ipv4 set --interface-name=vmk0 --ipv4=192.168.32.15 --netmask=255.255.255.0 --gateway=192.168.32.1 --type=static

FYI In my ks.cfg I have this

network --bootproto=static --ip=192.168.250.21 --gateway=192.168.250.1 --nameserver=192.168.250.6 --netmask=255.255.255.0 --hostname=esxi5-.lab.local --device=vmnic0 --addvmportgroup=0

in place of

network --bootproto=dhcp --device=vmnic0 --addvmportgroup=0

and

esxcli network ip interface ipv4 set --interface-name=vmk0 --ipv4=192.168.32.15 --netmask=255.255.255.0 --gateway=192.168.32.1 --type=static


Graham | User Moderator | https://virtualg.uk
0 Kudos
romatlo
Enthusiast
Enthusiast

Thank you for responding! That works great.  Thanks.