On 31/08/15 16:45, Hadret wrote: > Hi Tom, > > a while back I had similar issue. Those images are prepared with SDC/Joyent > cloud in mind and it > is my understanding, that dhcp is a default and expected behavior. That being > said -- last time I > was establishing CentOS from the image provided by Joyent, there were some > scripts running from > /etc/rc.local that were setting up (and overwriting my changes) networking. > Check it out. >
Hi Filip, You got it! That is indeed where it's happening. The /etc/rc.local has a function setup_redhat() that clobbers the network configuration files. What's the safest way around that? Can I delete that script? Thanks, Tom > All the best > - Filip > > On Mon, Aug 31, 2015 at 8:05 AM Tom Robinson <[email protected] > <mailto:[email protected]>> wrote: > > 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 > > -- > > Tom Robinson > IT Manager/System Administrator > > MoTeC Pty Ltd > > 121 Merrindale Drive > Croydon South > 3136 Victoria > Australia > > T: +61 3 9761 5050 > F: +61 3 9761 5051 > E: [email protected] <mailto:[email protected]> > > > > > > > http://www.listbox.com > > *smartos-discuss* | Archives > <https://www.listbox.com/member/archive/184463/=now> > <https://www.listbox.com/member/archive/rss/184463/25908535-8e7ef2de> | Modify > <https://www.listbox.com/member/?&> Your > Subscription [Powered by Listbox] <http://www.listbox.com> >
signature.asc
Description: OpenPGP digital signature
------------------------------------------- smartos-discuss Archives: https://www.listbox.com/member/archive/184463/=now RSS Feed: https://www.listbox.com/member/archive/rss/184463/25769125-55cfbc00 Modify Your Subscription: https://www.listbox.com/member/?member_id=25769125&id_secret=25769125-7688e9fb Powered by Listbox: http://www.listbox.com
