Skip to content

Guest fixed IPv4 config file clobbered #3

@yzenezy

Description

@yzenezy

Hi,

I'm not sure if this is a CentOS-7 or SmartOS issue and it is driving me batty.

I've installed three KVM CentOS-7 images (using image d8e65ea2-1f3e-11e5-8557-6b43e0a88b38) but I can't get them configured with fixed IPv4 address in the guest.

My understanding is that to assign a static IP within the guest itself (i.e. no DHCP magic from QEMU - all networking to be configured in the guest), I should set the guest's JSON "ip" property to "dhcp" and configure the network in the guest. I have tried this and it fails, clobbering my network configs in the guest.

For example, the nics are configured in JSON like this:

vmadm get 58a4e021-bc65-4eb8-8f2f-d12b82c3946d | json nics
[
  {
    "interface": "net0",
    "mac": "62:3c:de:b7:52:76",
    "nic_tag": "vswitch6",
    "ip": "dhcp",
    "model": "virtio",
    "primary": true
  }
]

And in the guest I've configured the /etc/sysconfig/network-scripts/ifcfg-eth0 file with a fixed IP setting:

DEVICE=eth0
TYPE=Ethernet
HWADDR=62:3c:de:b7:52:76
ONBOOT=yes
BOOTPROTO=static
IPADDR=x.x.x.x
NETMASK=x.x.x.x

Now, every time I start/reboot the guest it clobbers the ifcfg-eth0 file reverting it to just three lines the guest:

DEVICE=eth0
ONBOOT=yes
BOOTPROTO=dhcp

Has anyone experienced this before? Is it a CentOS-7/SmartOS issue or just my own ignorance?

Any help is appreciated.

Kind regards,
Tom

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions