Hi all, I have create a centos in domU using "xm create test.cfg". The content of test.cfg print as below: kernel = "/usr/lib/xen/boot/hvmloader" builder = ''hvm'' name = "test" memory = 512 disk = [ ''file:/root/xen/ubuntu-9.10-desktop-i386.iso,hdc:cdrom,r'', ''file:/srv/xen/mailserver.img,hda,w'' ] boot = "d" vif = [''ip=192.168.1.100,bridge=eth1''] dhcp = "off" vcpus=1 on_reboot = ''restart'' on_crash = ''restart'' sdl=0 vnc=1 vnclisten="0.0.0.0" vncpasswd=''password'' stdvga=0 serial=''pty'' usbdevice=''tablet'' I set static ip==192.168.1.100 in vif, but the centos in domU still use the dhcp. To be noted here, I can set static ip in centos when I connect to the console of domU. Who can tell me why and how to set static ip in config file. Thanks a lot. Best Wishes! Qiang Ma _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
On Mon, Feb 1, 2010 at 2:40 PM, ma qiang <maqiang1984@gmail.com> wrote:> I set static ip==192.168.1.100 in vif, but the centos in domU still > use the dhcp. To be noted here, I can set static ip in centos when I > connect to the console of domU. > > Who can tell me why and how to set static ip in config file. > Thanks a lot.Short answer: that''s the way it works. There are cases when setting IP in domU config file can be used (for example when deploying custom bridge+iptables script), but that''s kinda complicated. The short version is that using the default setup the setting is not used and has no effect on actual domU IP address. -- Fajar _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
hi, Thanks very much. I have many VMs to deploy and have to set static ip for each VM. So I want to try some methods. Can you send me some cases such as deploying custom bridge+iptables script? Best Wishes Qiang Ma On Mon, Feb 1, 2010 at 4:01 PM, Fajar A. Nugraha <fajar@fajar.net> wrote:> On Mon, Feb 1, 2010 at 2:40 PM, ma qiang <maqiang1984@gmail.com> wrote: >> I set static ip==192.168.1.100 in vif, but the centos in domU still >> use the dhcp. To be noted here, I can set static ip in centos when I >> connect to the console of domU. >> >> Who can tell me why and how to set static ip in config file. >> Thanks a lot. > > Short answer: that''s the way it works. > There are cases when setting IP in domU config file can be used (for > example when deploying custom bridge+iptables script), but that''s > kinda complicated. The short version is that using the default setup > the setting is not used and has no effect on actual domU IP address. > > -- > Fajar >_______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
> > Best Wishes > Qiang Ma > > > Short answer: that''s the way it works. > > There are cases when setting IP in domU config file can be used (for > > example when deploying custom bridge+iptables script), but that''s > > kinda complicated. The short version is that using the default setup > > the setting is not used and has no effect on actual domU IP address. > > > > -- > > Fajar > > >In addition to that the CentOS kernel is not compiled with CONFIG_IP_PNP so having a DomU with the ip set in the config file will never work. It will if you recompile the kernel or use a different OS like Debian in the DomU. The CentOS kernel does pay attention to the MAC address assigned in the DomU config file though so you can set up a DHCP server with that MAC in it and it will assign the IP you want. Grant McWilliams _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
On Mon, Feb 1, 2010 at 3:10 PM, ma qiang <maqiang1984@gmail.com> wrote:> hi, > Thanks very much. > I have many VMs to deploy and have to set static ip for each VM. So I > want to try some methods. > Can you send me some cases such as deploying custom bridge+iptables script?It''s not really how to DEPLOY, but how to LIMIT which IP address a domU can use with the help of ebtables. Try this thread, and see the linked post: http://markmail.org/message/kq4vnmpgwldqyv3k -- Fajar _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users