Incorrect IP after install

Hi,

While creating the vm via the interface. It assigns it an ip address
192.168.122.3 (This is the IP i want to remain). However after install
the systems again gets a new random IP via DHCP. I am wondering why
does it not change this to static ip in the configuration during
install or in postinstall. This way the whole process is broken with
ip address managment. Has someone faced this issue?

Regards,
Kevin

> Hi,
>
> While creating the vm via the interface. It assigns it an ip address
> 192.168.122.3 (This is the IP i want to remain). However after install
> the systems again gets a new random IP via DHCP. I am wondering why
> does it not change this to static ip in the configuration during
> install or in postinstall. This way the whole process is broken with
> ip address managment. Has someone faced this issue?

Assuming your mac address didnt change, and dhcp reservations were
created up front, the ip address should not change.

Are you sure foreman manages your dhcp server?

··· On Thu, Feb 23, 2012 at 5:14 PM, linuxbsdfreak wrote: > > Regards, > Kevin > > -- > You received this message because you are subscribed to the Google Groups "Foreman users" group. > To post to this group, send email to foreman-users@googlegroups.com. > To unsubscribe from this group, send email to foreman-users+unsubscribe@googlegroups.com. > For more options, visit this group at http://groups.google.com/group/foreman-users?hl=en. >

Hi Ohad,

Yes foreman is managing the DHCP, since i see it writes it in the
dhcpd.leases file. The mac address does not change. I had created the
dhcp reservations in dhcpd.conf. However foreman picks up the next
available random ip address from the subnet. I have the following in /
var/log/messages

Feb 23 15:27:15 foreman dhcpd: DHCPDISCOVER from 52:54:00:e5:f9:27 via
eth0
Feb 23 15:27:15 foreman dhcpd: DHCPOFFER on 192.168.122.3 to
52:54:00:e5:f9:27 via eth0
Feb 23 15:27:16 foreman dhcpd: DHCPDISCOVER from 52:54:00:e5:f9:27 via
eth0
Feb 23 15:27:16 foreman dhcpd: DHCPOFFER on 192.168.122.3 to
52:54:00:e5:f9:27 via eth0
Feb 23 15:27:18 foreman dhcpd: DHCPREQUEST for 192.168.122.3
(192.168.122.26) from 52:54:00:e5:f9:27 via eth0
Feb 23 15:27:18 foreman dhcpd: DHCPACK on 192.168.122.3 to
52:54:00:e5:f9:27 via eth0
Feb 23 15:27:29 foreman dhcpd: DHCPDISCOVER from 52:54:00:e5:f9:27 via
eth0
Feb 23 15:27:29 foreman dhcpd: DHCPOFFER on 192.168.122.3 to
52:54:00:e5:f9:27 via eth0
Feb 23 15:27:29 foreman dhcpd: DHCPREQUEST for 192.168.122.121
(192.168.122.1) from 52:54:00:e5:f9:27 via eth0: lease 192.168.122.121
unavailable.
Feb 23 15:27:29 foreman dhcpd: DHCPNAK on 192.168.122.121 to
52:54:00:e5:f9:27 via eth0

Following is my dhcpd.conf

omapi-port 7911;
allow booting;
allow bootp;
option bootfile-name "/gpxe/undionly.kpxe";
option space gpxe;
option gpxe-encap-opts code 175 = encapsulate gpxe;
option gpxe.bus-id code 177 = string;

subnet 192.168.122.0 netmask 255.255.255.0 {
range 192.168.122.40 192.168.122.50;
option domain-name-servers 192.168.122.1;
option domain-name "navteq.local";
option routers 192.168.122.1;
filename "/pxelinux.0";
next-server 192.168.122.26;
if exists user-class and option user-class = "gPXE" {
filename "http://192.168.122.26/pxelinux.cfg/gpxe.php";
} else {
filename "/gpxe/undionly.kpxe";
}
}

For info. foreman is running on a VM on the same host i am creating
the VM on.

Regards,
Kevin

··· On Feb 23, 4:17 pm, Ohad Levy wrote: > On Thu, Feb 23, 2012 at 5:14 PM, linuxbsdfreak wrote: > > Hi, > > > While creating the vm via the interface. It assigns it an ip address > > 192.168.122.3 (This is the IP i want to remain). However after install > > the systems again gets a new random IP via DHCP. I am wondering why > > does it not change this to static ip in the configuration during > > install or in postinstall. This way the whole process is broken with > > ip address managment. Has someone faced this issue? > > Assuming your mac address didnt change, and dhcp reservations were > created up front, the ip address should not change. > > Are you sure foreman manages your dhcp server? > > > > > > > > > > > Regards, > > Kevin > > > -- > > You received this message because you are subscribed to the Google Groups "Foreman users" group. > > To post to this group, send email to foreman-users@googlegroups.com. > > To unsubscribe from this group, send email to foreman-users+unsubscribe@googlegroups.com. > > For more options, visit this group athttp://groups.google.com/group/foreman-users?hl=en.

Hi Ohad,

I resolved the issue. The issue was that my Fedora16 KVM host machine
was having a dnsmasq process running which had started a dhcp server
in the range and listening on virbr0(192.168.122.1). After i had
killed the dnsmasq process, however since foreman is running on a VM
on the same host, for some reasons was not able to create a host,
since the bridge is virbr0 i suppose. I now added a PREROUTING
iptables rule with the dnsmasq process running to forward all dhcp
traffic to the foreman host. However what i still see is that the VM
get's the ip from the DHCP on the next boot. I have rectified the ip
management by setting the static ip on the postinstall of the
kickstart.

Regards,
Kevin

··· On Feb 23, 4:43 pm, linuxbsdfreak wrote: > Hi Ohad, > > Yes foreman is managing the DHCP, since i see it writes it in the > dhcpd.leases file. The mac address does not change. I had created the > dhcp reservations in dhcpd.conf. However foreman picks up the next > available random ip address from the subnet. I have the following in / > var/log/messages > > Feb 23 15:27:15 foreman dhcpd: DHCPDISCOVER from 52:54:00:e5:f9:27 via > eth0 > Feb 23 15:27:15 foreman dhcpd: DHCPOFFER on 192.168.122.3 to > 52:54:00:e5:f9:27 via eth0 > Feb 23 15:27:16 foreman dhcpd: DHCPDISCOVER from 52:54:00:e5:f9:27 via > eth0 > Feb 23 15:27:16 foreman dhcpd: DHCPOFFER on 192.168.122.3 to > 52:54:00:e5:f9:27 via eth0 > Feb 23 15:27:18 foreman dhcpd: DHCPREQUEST for 192.168.122.3 > (192.168.122.26) from 52:54:00:e5:f9:27 via eth0 > Feb 23 15:27:18 foreman dhcpd: DHCPACK on 192.168.122.3 to > 52:54:00:e5:f9:27 via eth0 > Feb 23 15:27:29 foreman dhcpd: DHCPDISCOVER from 52:54:00:e5:f9:27 via > eth0 > Feb 23 15:27:29 foreman dhcpd: DHCPOFFER on 192.168.122.3 to > 52:54:00:e5:f9:27 via eth0 > Feb 23 15:27:29 foreman dhcpd: DHCPREQUEST for 192.168.122.121 > (192.168.122.1) from 52:54:00:e5:f9:27 via eth0: lease 192.168.122.121 > unavailable. > Feb 23 15:27:29 foreman dhcpd: DHCPNAK on 192.168.122.121 to > 52:54:00:e5:f9:27 via eth0 > > Following is my dhcpd.conf > > omapi-port 7911; > allow booting; > allow bootp; > option bootfile-name "/gpxe/undionly.kpxe"; > option space gpxe; > option gpxe-encap-opts code 175 = encapsulate gpxe; > option gpxe.bus-id code 177 = string; > > subnet 192.168.122.0 netmask 255.255.255.0 { > range 192.168.122.40 192.168.122.50; > option domain-name-servers 192.168.122.1; > option domain-name "navteq.local"; > option routers 192.168.122.1; > filename "/pxelinux.0"; > next-server 192.168.122.26; > if exists user-class and option user-class = "gPXE" { > filename "http://192.168.122.26/pxelinux.cfg/gpxe.php"; > } else { > filename "/gpxe/undionly.kpxe"; > } > > } > > For info. foreman is running on a VM on the same host i am creating > the VM on. > > Regards, > Kevin > > On Feb 23, 4:17 pm, Ohad Levy wrote: > > > > > > > > > On Thu, Feb 23, 2012 at 5:14 PM, linuxbsdfreak wrote: > > > Hi, > > > > While creating the vm via the interface. It assigns it an ip address > > > 192.168.122.3 (This is the IP i want to remain). However after install > > > the systems again gets a new random IP via DHCP. I am wondering why > > > does it not change this to static ip in the configuration during > > > install or in postinstall. This way the whole process is broken with > > > ip address managment. Has someone faced this issue? > > > Assuming your mac address didnt change, and dhcp reservations were > > created up front, the ip address should not change. > > > Are you sure foreman manages your dhcp server? > > > > Regards, > > > Kevin > > > > -- > > > You received this message because you are subscribed to the Google Groups "Foreman users" group. > > > To post to this group, send email to foreman-users@googlegroups.com. > > > To unsubscribe from this group, send email to foreman-users+unsubscribe@googlegroups.com. > > > For more options, visit this group athttp://groups.google.com/group/foreman-users?hl=en.

> Hi Ohad,
>
> Yes foreman is managing the DHCP, since i see it writes it in the
> dhcpd.leases file. The mac address does not change. I had created the
> dhcp reservations in dhcpd.conf. However foreman picks up the next
> available random ip address from the subnet. I have the following in /
> var/log/messages
>
> Feb 23 15:27:15 foreman dhcpd: DHCPDISCOVER from 52:54:00:e5:f9:27 via
> eth0
> Feb 23 15:27:15 foreman dhcpd: DHCPOFFER on 192.168.122.3 to
> 52:54:00:e5:f9:27 via eth0
> Feb 23 15:27:16 foreman dhcpd: DHCPDISCOVER from 52:54:00:e5:f9:27 via
> eth0
> Feb 23 15:27:16 foreman dhcpd: DHCPOFFER on 192.168.122.3 to
> 52:54:00:e5:f9:27 via eth0
> Feb 23 15:27:18 foreman dhcpd: DHCPREQUEST for 192.168.122.3
> (192.168.122.26) from 52:54:00:e5:f9:27 via eth0
> Feb 23 15:27:18 foreman dhcpd: DHCPACK on 192.168.122.3 to
> 52:54:00:e5:f9:27 via eth0
> Feb 23 15:27:29 foreman dhcpd: DHCPDISCOVER from 52:54:00:e5:f9:27 via
> eth0
> Feb 23 15:27:29 foreman dhcpd: DHCPOFFER on 192.168.122.3 to
> 52:54:00:e5:f9:27 via eth0
> Feb 23 15:27:29 foreman dhcpd: DHCPREQUEST for 192.168.122.121
> (192.168.122.1) from 52:54:00:e5:f9:27 via eth0: lease 192.168.122.121
> unavailable.
> Feb 23 15:27:29 foreman dhcpd: DHCPNAK on 192.168.122.121 to
> 52:54:00:e5:f9:27 via eth0
>
> Following is my dhcpd.conf
>
> omapi-port 7911;
> allow booting;
> allow bootp;
> option bootfile-name "/gpxe/undionly.kpxe";
> option space gpxe;
> option gpxe-encap-opts code 175 = encapsulate gpxe;
> option gpxe.bus-id code 177 = string;
>
> subnet 192.168.122.0 netmask 255.255.255.0 {
> range 192.168.122.40 192.168.122.50;
> option domain-name-servers 192.168.122.1;
> option domain-name "navteq.local";
> option routers 192.168.122.1;
> filename "/pxelinux.0";
> next-server 192.168.122.26;
> if exists user-class and option user-class = "gPXE" {
> filename "http://192.168.122.26/pxelinux.cfg/gpxe.php";

btw: you can simply put here
filename "http://foreman/unattended/gPXE";

I think one thing that is missing, is to create that specific vendor
option in the dhcp reservation per host, this would ensure it can co
exists with another default script

Ohad

··· On Thu, Feb 23, 2012 at 5:43 PM, linuxbsdfreak wrote:

} else {
filename “/gpxe/undionly.kpxe”;
}
}

For info. foreman is running on a VM on the same host i am creating
the VM on.

Regards,
Kevin

On Feb 23, 4:17 pm, Ohad Levy ohadl...@gmail.com wrote:

On Thu, Feb 23, 2012 at 5:14 PM, linuxbsdfreak linuxbsdfr...@gmail.com wrote:

Hi,

While creating the vm via the interface. It assigns it an ip address
192.168.122.3 (This is the IP i want to remain). However after install
the systems again gets a new random IP via DHCP. I am wondering why
does it not change this to static ip in the configuration during
install or in postinstall. This way the whole process is broken with
ip address managment. Has someone faced this issue?

Assuming your mac address didnt change, and dhcp reservations were
created up front, the ip address should not change.

Are you sure foreman manages your dhcp server?

Regards,
Kevin


You received this message because you are subscribed to the Google Groups “Foreman users” group.
To post to this group, send email to foreman-users@googlegroups.com.
To unsubscribe from this group, send email to foreman-users+unsubscribe@googlegroups.com.
For more options, visit this group athttp://groups.google.com/group/foreman-users?hl=en.


You received this message because you are subscribed to the Google Groups “Foreman users” group.
To post to this group, send email to foreman-users@googlegroups.com.
To unsubscribe from this group, send email to foreman-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/foreman-users?hl=en.

Hi Ohad,

I know i could run the DHCP on the Fedora16 machine along with the
smart proxy. I just wanted to keep all the services on the same host
for now for testing. Anyways its fixed and it works. I guess the
normal situation would be to run foreman on a different physical
machine and then add the KVM host via the UI and it would work out of
the box via the bridge created on the KVM host.

Regards,
Kevin

··· On Feb 24, 2:29 pm, Ohad Levy wrote: > On Thu, Feb 23, 2012 at 5:43 PM, linuxbsdfreak wrote: > > Hi Ohad, > > > Yes foreman is managing the DHCP, since i see it writes it in the > > dhcpd.leases file. The mac address does not change. I had created the > > dhcp reservations in dhcpd.conf. However foreman picks up the next > > available random ip address from the subnet. I have the following in / > > var/log/messages > > > Feb 23 15:27:15 foreman dhcpd: DHCPDISCOVER from 52:54:00:e5:f9:27 via > > eth0 > > Feb 23 15:27:15 foreman dhcpd: DHCPOFFER on 192.168.122.3 to > > 52:54:00:e5:f9:27 via eth0 > > Feb 23 15:27:16 foreman dhcpd: DHCPDISCOVER from 52:54:00:e5:f9:27 via > > eth0 > > Feb 23 15:27:16 foreman dhcpd: DHCPOFFER on 192.168.122.3 to > > 52:54:00:e5:f9:27 via eth0 > > Feb 23 15:27:18 foreman dhcpd: DHCPREQUEST for 192.168.122.3 > > (192.168.122.26) from 52:54:00:e5:f9:27 via eth0 > > Feb 23 15:27:18 foreman dhcpd: DHCPACK on 192.168.122.3 to > > 52:54:00:e5:f9:27 via eth0 > > Feb 23 15:27:29 foreman dhcpd: DHCPDISCOVER from 52:54:00:e5:f9:27 via > > eth0 > > Feb 23 15:27:29 foreman dhcpd: DHCPOFFER on 192.168.122.3 to > > 52:54:00:e5:f9:27 via eth0 > > Feb 23 15:27:29 foreman dhcpd: DHCPREQUEST for 192.168.122.121 > > (192.168.122.1) from 52:54:00:e5:f9:27 via eth0: lease 192.168.122.121 > > unavailable. > > Feb 23 15:27:29 foreman dhcpd: DHCPNAK on 192.168.122.121 to > > 52:54:00:e5:f9:27 via eth0 > > > Following is my dhcpd.conf > > > omapi-port 7911; > > allow booting; > > allow bootp; > > option bootfile-name "/gpxe/undionly.kpxe"; > > option space gpxe; > > option gpxe-encap-opts code 175 = encapsulate gpxe; > > option gpxe.bus-id code 177 = string; > > > subnet 192.168.122.0 netmask 255.255.255.0 { > > range 192.168.122.40 192.168.122.50; > > option domain-name-servers 192.168.122.1; > > option domain-name "navteq.local"; > > option routers 192.168.122.1; > > filename "/pxelinux.0"; > > next-server 192.168.122.26; > > if exists user-class and option user-class = "gPXE" { > > filename "http://192.168.122.26/pxelinux.cfg/gpxe.php"; > > btw: you can simply put here > filename "http://foreman/unattended/gPXE"; > > I think one thing that is missing, is to create that specific vendor > option in the dhcp reservation per host, this would ensure it can co > exists with another default script > > Ohad > > > > > > > > > } else { > > filename "/gpxe/undionly.kpxe"; > > } > > } > > > For info. foreman is running on a VM on the same host i am creating > > the VM on. > > > Regards, > > Kevin > > > On Feb 23, 4:17 pm, Ohad Levy wrote: > >> On Thu, Feb 23, 2012 at 5:14 PM, linuxbsdfreak wrote: > >> > Hi, > > >> > While creating the vm via the interface. It assigns it an ip address > >> > 192.168.122.3 (This is the IP i want to remain). However after install > >> > the systems again gets a new random IP via DHCP. I am wondering why > >> > does it not change this to static ip in the configuration during > >> > install or in postinstall. This way the whole process is broken with > >> > ip address managment. Has someone faced this issue? > > >> Assuming your mac address didnt change, and dhcp reservations were > >> created up front, the ip address should not change. > > >> Are you sure foreman manages your dhcp server? > > >> > Regards, > >> > Kevin > > >> > -- > >> > You received this message because you are subscribed to the Google Groups "Foreman users" group. > >> > To post to this group, send email to foreman-users@googlegroups.com. > >> > To unsubscribe from this group, send email to foreman-users+unsubscribe@googlegroups.com. > >> > For more options, visit this group athttp://groups.google.com/group/foreman-users?hl=en. > > > -- > > You received this message because you are subscribed to the Google Groups "Foreman users" group. > > To post to this group, send email to foreman-users@googlegroups.com. > > To unsubscribe from this group, send email to foreman-users+unsubscribe@googlegroups.com. > > For more options, visit this group athttp://groups.google.com/group/foreman-users?hl=en.

> Hi Ohad,
>
> I resolved the issue. The issue was that my Fedora16 KVM host machine
> was having a dnsmasq process running which had started a dhcp server
> in the range and listening on virbr0(192.168.122.1). After i had
> killed the dnsmasq process, however since foreman is running on a VM
> on the same host, for some reasons was not able to create a host,
> since the bridge is virbr0 i suppose. I now added a PREROUTING
> iptables rule with the dnsmasq process running to forward all dhcp
> traffic to the foreman host. However what i still see is that the VM
> get's the ip from the DHCP on the next boot. I have rectified the ip
> management by setting the static ip on the postinstall of the
> kickstart.

Well, running two dhcp servers at the same network can explain most of
your issues :slight_smile:

if you disable dnsmasq and use isc within your bridge, i dont think
you would need any fancy forwarding stuff.

Ohad

··· On Fri, Feb 24, 2012 at 3:23 PM, linuxbsdfreak wrote: > > Regards, > Kevin > > On Feb 23, 4:43 pm, linuxbsdfreak wrote: >> Hi Ohad, >> >> Yes foreman is managing the DHCP, since i see it writes it in the >> dhcpd.leases file. The mac address does not change. I had created the >> dhcp reservations in dhcpd.conf. However foreman picks up the next >> available random ip address from the subnet. I have the following in / >> var/log/messages >> >> Feb 23 15:27:15 foreman dhcpd: DHCPDISCOVER from 52:54:00:e5:f9:27 via >> eth0 >> Feb 23 15:27:15 foreman dhcpd: DHCPOFFER on 192.168.122.3 to >> 52:54:00:e5:f9:27 via eth0 >> Feb 23 15:27:16 foreman dhcpd: DHCPDISCOVER from 52:54:00:e5:f9:27 via >> eth0 >> Feb 23 15:27:16 foreman dhcpd: DHCPOFFER on 192.168.122.3 to >> 52:54:00:e5:f9:27 via eth0 >> Feb 23 15:27:18 foreman dhcpd: DHCPREQUEST for 192.168.122.3 >> (192.168.122.26) from 52:54:00:e5:f9:27 via eth0 >> Feb 23 15:27:18 foreman dhcpd: DHCPACK on 192.168.122.3 to >> 52:54:00:e5:f9:27 via eth0 >> Feb 23 15:27:29 foreman dhcpd: DHCPDISCOVER from 52:54:00:e5:f9:27 via >> eth0 >> Feb 23 15:27:29 foreman dhcpd: DHCPOFFER on 192.168.122.3 to >> 52:54:00:e5:f9:27 via eth0 >> Feb 23 15:27:29 foreman dhcpd: DHCPREQUEST for 192.168.122.121 >> (192.168.122.1) from 52:54:00:e5:f9:27 via eth0: lease 192.168.122.121 >> unavailable. >> Feb 23 15:27:29 foreman dhcpd: DHCPNAK on 192.168.122.121 to >> 52:54:00:e5:f9:27 via eth0 >> >> Following is my dhcpd.conf >> >> omapi-port 7911; >> allow booting; >> allow bootp; >> option bootfile-name "/gpxe/undionly.kpxe"; >> option space gpxe; >> option gpxe-encap-opts code 175 = encapsulate gpxe; >> option gpxe.bus-id code 177 = string; >> >> subnet 192.168.122.0 netmask 255.255.255.0 { >> range 192.168.122.40 192.168.122.50; >> option domain-name-servers 192.168.122.1; >> option domain-name "navteq.local"; >> option routers 192.168.122.1; >> filename "/pxelinux.0"; >> next-server 192.168.122.26; >> if exists user-class and option user-class = "gPXE" { >> filename "http://192.168.122.26/pxelinux.cfg/gpxe.php"; >> } else { >> filename "/gpxe/undionly.kpxe"; >> } >> >> } >> >> For info. foreman is running on a VM on the same host i am creating >> the VM on. >> >> Regards, >> Kevin >> >> On Feb 23, 4:17 pm, Ohad Levy wrote: >> >> >> >> >> >> >> >> > On Thu, Feb 23, 2012 at 5:14 PM, linuxbsdfreak wrote: >> > > Hi, >> >> > > While creating the vm via the interface. It assigns it an ip address >> > > 192.168.122.3 (This is the IP i want to remain). However after install >> > > the systems again gets a new random IP via DHCP. I am wondering why >> > > does it not change this to static ip in the configuration during >> > > install or in postinstall. This way the whole process is broken with >> > > ip address managment. Has someone faced this issue? >> >> > Assuming your mac address didnt change, and dhcp reservations were >> > created up front, the ip address should not change. >> >> > Are you sure foreman manages your dhcp server? >> >> > > Regards, >> > > Kevin >> >> > > -- >> > > You received this message because you are subscribed to the Google Groups "Foreman users" group. >> > > To post to this group, send email to foreman-users@googlegroups.com. >> > > To unsubscribe from this group, send email to foreman-users+unsubscribe@googlegroups.com. >> > > For more options, visit this group athttp://groups.google.com/group/foreman-users?hl=en. > > -- > You received this message because you are subscribed to the Google Groups "Foreman users" group. > To post to this group, send email to foreman-users@googlegroups.com. > To unsubscribe from this group, send email to foreman-users+unsubscribe@googlegroups.com. > For more options, visit this group at http://groups.google.com/group/foreman-users?hl=en. >