Foreman Proxy Subnet Not Found

Hi Foreman Community,

after several hours of troubleshooting i decided to ask for help.

I setup a new Foreman (1.11) and i have an issue with foreman-proxy / DHCP.

Here is my issue :
I'm trying to configure a new host, but for interface, i can't get any IP
address (interface within subnet 192.168.1.0/24).

D, [2016-06-26T14:50:40.732666 #1782] DEBUG – : Rack::Handler::WEBrick is
invoked.
D, [2016-06-26T14:50:40.778870 #1782] DEBUG – : verifying remote client
xx.xx.xx.xx against trusted_hosts ["myforeman_host"]
D, [2016-06-26T14:50:40.779329 #1782] DEBUG – : Loading subnets for
127.0.0.1
D, [2016-06-26T14:50:40.779451 #1782] DEBUG – : Reading config file
/etc/dhcp/dhcpd.conf
D, [2016-06-26T14:50:40.779683 #1782] DEBUG – : Reading config file
/etc/ddns-update.dnskey
E, [2016-06-26T14:50:40.790457 #1782] ERROR – : Subnet 192.168.1.0 not
found
D, [2016-06-26T14:50:40.790516 #1782] DEBUG – : Subnet 192.168.1.0 not
found
I, [2016-06-26T14:50:40.790903 #1782] INFO – : xx.xx.xx.xx - -
[26/Jun/2016:14:50:40 +0200] "POST /dhcp/192.168.1.0 HTTP/1.1" 404 28 0.0573
D, [2016-06-26T14:50:40.831265 #1782] DEBUG – : close: xx.xx.xx.xx:50904
<http://10.195.49.231:50904/>

My configuration seems to be good, but i can not find what's going wrong.

# my dhcp.conf #

dhcpd.conf

··· #------------------------------- # Configuration file for ISC dhcpd #------------------------------- #

authoritative;
option domain-name “mydomain”;
log-facility local7;
option domain-name-servers dns1.mydomain, dns2.mydomain;
local-address 192.168.0.1;

#-------------------------------

Dynamic DNS

#-------------------------------

include “/etc/ddns-update.dnskey”;
ddns-update-style interim;
ddns-updates on;
ddns-domainname “mydomain”;
omapi-port 7911;
#update-static-lease on;

allow client-updates;
allow unknown-clients;

zone mydomain {
primary 192.168.0.1;
key ddns-update;
}

#-------------------------------

Subnet declaration

#-------------------------------

subnet 192.168.1.0 netmask 255.255.255.0 {
authoritative;
interface bond1;
range 192.168.1.10 192.168.1.200;
option routers 192.168.1.254;
option subnet-mask 255.255.255.0;
option broadcast-address 192.168.1.255;
option domain-name “mydomain”;
option domain-name-servers 192.168.0.1,192.168.0.2;
default-lease-time 600;
max-lease-time 7200;
filename “/pxelinux.0”;
zone 168.192.in-addr.arpa {
primary 192.168.0.1;
secondary 192.168.0.2;
key ddns-update;
}
ddns-rev-domainname “168.192.in-addr.arpa”;
}

# my foreman subnet configuration #

Network address: 192.168.1.0
Network mask: 255.255.255.0
Gateway address: 192.168.1.254
Primary DNS server: 192.168.0.1
Secondary DNS server: 192.168.0.2
IPAM: DHCP
Start of IP range: 192.168.1.10
End of IP range: 192.168.1.200
VLAN ID: none
Boot mode: DHCP
Domain: mydomain

=============================

My misconfiguration may be obvious for you, but after hours spent, i was
not able to figure it out.

Thank you for your help

David

> Hi Foreman Community,
>
> after several hours of troubleshooting i decided to ask for help.
>
> I setup a new Foreman (1.11) and i have an issue with foreman-proxy / DHCP.

Can you share your foreman-proxy .yml configs?

Do you have an option 'dhcp_subnets' option uncommented, on your
foreman-proxy config? That option limits networks to be queried for DHCP
and when it encounters a subnet that's not in that list, it will return
'not found', so I'm guessing it might be that. Try commenting out that
line if you have it.

··· On 06/26, David C. wrote:

Here is my issue :
I’m trying to configure a new host, but for interface, i can’t get any IP
address (interface within subnet 192.168.1.0/24).

D, [2016-06-26T14:50:40.732666 #1782] DEBUG – : Rack::Handler::WEBrick is
invoked.
D, [2016-06-26T14:50:40.778870 #1782] DEBUG – : verifying remote client
xx.xx.xx.xx against trusted_hosts [“myforeman_host”]
D, [2016-06-26T14:50:40.779329 #1782] DEBUG – : Loading subnets for
127.0.0.1
D, [2016-06-26T14:50:40.779451 #1782] DEBUG – : Reading config file
/etc/dhcp/dhcpd.conf
D, [2016-06-26T14:50:40.779683 #1782] DEBUG – : Reading config file
/etc/ddns-update.dnskey
E, [2016-06-26T14:50:40.790457 #1782] ERROR – : Subnet 192.168.1.0 not
found
D, [2016-06-26T14:50:40.790516 #1782] DEBUG – : Subnet 192.168.1.0 not
found
I, [2016-06-26T14:50:40.790903 #1782] INFO – : xx.xx.xx.xx - -
[26/Jun/2016:14:50:40 +0200] “POST /dhcp/192.168.1.0 HTTP/1.1” 404 28 0.0573
D, [2016-06-26T14:50:40.831265 #1782] DEBUG – : close: xx.xx.xx.xx:50904
http://10.195.49.231:50904/

My configuration seems to be good, but i can not find what’s going wrong.

# my dhcp.conf #

dhcpd.conf

#-------------------------------

Configuration file for ISC dhcpd

#-------------------------------

authoritative;
option domain-name “mydomain”;
log-facility local7;
option domain-name-servers dns1.mydomain, dns2.mydomain;
local-address 192.168.0.1;

#-------------------------------

Dynamic DNS

#-------------------------------

include “/etc/ddns-update.dnskey”;
ddns-update-style interim;
ddns-updates on;
ddns-domainname “mydomain”;
omapi-port 7911;
#update-static-lease on;

allow client-updates;
allow unknown-clients;

zone mydomain {
primary 192.168.0.1;
key ddns-update;
}

#-------------------------------

Subnet declaration

#-------------------------------

subnet 192.168.1.0 netmask 255.255.255.0 {
authoritative;
interface bond1;
range 192.168.1.10 192.168.1.200;
option routers 192.168.1.254;
option subnet-mask 255.255.255.0;
option broadcast-address 192.168.1.255;
option domain-name “mydomain”;
option domain-name-servers 192.168.0.1,192.168.0.2;
default-lease-time 600;
max-lease-time 7200;
filename “/pxelinux.0”;
zone 168.192.in-addr.arpa {
primary 192.168.0.1;
secondary 192.168.0.2;
key ddns-update;
}
ddns-rev-domainname “168.192.in-addr.arpa”;
}

# my foreman subnet configuration #

Network address: 192.168.1.0
Network mask: 255.255.255.0
Gateway address: 192.168.1.254
Primary DNS server: 192.168.0.1
Secondary DNS server: 192.168.0.2
IPAM: DHCP
Start of IP range: 192.168.1.10
End of IP range: 192.168.1.200
VLAN ID: none
Boot mode: DHCP
Domain: mydomain

=============================

My misconfiguration may be obvious for you, but after hours spent, i was
not able to figure it out.

Thank you for your help

David


You received this message because you are subscribed to the Google Groups “Foreman users” group.
To unsubscribe from this group and stop receiving emails from it, send an email to foreman-users+unsubscribe@googlegroups.com.
To post to this group, send email to foreman-users@googlegroups.com.
Visit this group at https://groups.google.com/group/foreman-users.
For more options, visit https://groups.google.com/d/optout.


Daniel Lobato Garcia

@dLobatog
blog.daniellobato.me
daniellobato.me

GPG: http://keys.gnupg.net/pks/lookup?op=get&search=0x7A92D6DD38D6DE30
Keybase: https://keybase.io/elobato

Hello Daniel,

thank you for your reply.

I figure out the issue.

It was a parsing issue with my dhcpd.conf configuration.

With foreman proxy, It's not allowed to have another block (with { & } )
within "subnet" block (in my case "zone" block).

My solution: I moved "zone" block outside, and now it's working fine.

But i have another issue right now with dhcp lease, not providing "gateway
ip address" to my client, therefore tftp request failed (my client is not
within the same subnet of foreman proxy, so need to be routed).
I would probably open a new topic if no solution found.

Thank for your help. This topic can be considered "SOLVED"

··· Le lundi 27 juin 2016 10:46:09 UTC+2, Daniel Lobato a écrit : > > On 06/26, David C. wrote: > > Hi Foreman Community, > > > > after several hours of troubleshooting i decided to ask for help. > > > > I setup a new Foreman (1.11) and i have an issue with foreman-proxy / > DHCP. > > Can you share your foreman-proxy .yml configs? > > Do you have an option 'dhcp_subnets' option uncommented, on your > foreman-proxy config? That option limits networks to be queried for DHCP > and when it encounters a subnet that's not in that list, it will return > 'not found', so I'm guessing it might be that. Try commenting out that > line if you have it. > > > > > Here is my issue : > > I'm trying to configure a new host, but for interface, i can't get any > IP > > address (interface within subnet 192.168.1.0/24). > > > > > > D, [2016-06-26T14:50:40.732666 #1782] DEBUG -- : Rack::Handler::WEBrick > is > > invoked. > > D, [2016-06-26T14:50:40.778870 #1782] DEBUG -- : verifying remote client > > xx.xx.xx.xx against trusted_hosts ["myforeman_host"] > > D, [2016-06-26T14:50:40.779329 #1782] DEBUG -- : Loading subnets for > > 127.0.0.1 > > D, [2016-06-26T14:50:40.779451 #1782] DEBUG -- : Reading config file > > /etc/dhcp/dhcpd.conf > > D, [2016-06-26T14:50:40.779683 #1782] DEBUG -- : Reading config file > > /etc/ddns-update.dnskey > > E, [2016-06-26T14:50:40.790457 #1782] ERROR -- : Subnet 192.168.1.0 not > > found > > D, [2016-06-26T14:50:40.790516 #1782] DEBUG -- : Subnet 192.168.1.0 not > > found > > I, [2016-06-26T14:50:40.790903 #1782] INFO -- : xx.xx.xx.xx - - > > [26/Jun/2016:14:50:40 +0200] "POST /dhcp/192.168.1.0 HTTP/1.1" 404 28 > 0.0573 > > D, [2016-06-26T14:50:40.831265 #1782] DEBUG -- : close: > xx.xx.xx.xx:50904 > > > > > > > > My configuration seems to be good, but i can not find what's going > wrong. > > > > > > > > *# my dhcp.conf #* > > # dhcpd.conf > > #------------------------------- > > # Configuration file for ISC dhcpd > > #------------------------------- > > # > > > > authoritative; > > option domain-name "mydomain"; > > log-facility local7; > > option domain-name-servers dns1.mydomain, dns2.mydomain; > > local-address 192.168.0.1; > > > > #------------------------------- > > # Dynamic DNS > > #------------------------------- > > # > > > > include "/etc/ddns-update.dnskey"; > > ddns-update-style interim; > > ddns-updates on; > > ddns-domainname "mydomain"; > > omapi-port 7911; > > #update-static-lease on; > > > > allow client-updates; > > allow unknown-clients; > > > > zone mydomain { > > primary 192.168.0.1; > > key ddns-update; > > } > > > > #------------------------------- > > # Subnet declaration > > #------------------------------- > > # > > > > subnet 192.168.1.0 netmask 255.255.255.0 { > > authoritative; > > interface bond1; > > range 192.168.1.10 192.168.1.200; > > option routers 192.168.1.254; > > option subnet-mask 255.255.255.0; > > option broadcast-address 192.168.1.255; > > option domain-name "mydomain"; > > option domain-name-servers 192.168.0.1,192.168.0.2; > > default-lease-time 600; > > max-lease-time 7200; > > filename "/pxelinux.0"; > > zone 168.192.in-addr.arpa { > > primary 192.168.0.1; > > secondary 192.168.0.2; > > key ddns-update; > > } > > ddns-rev-domainname "168.192.in-addr.arpa"; > > } > > > > > > > > *# my foreman subnet configuration #* > > ============================= > > Network address: 192.168.1.0 > > Network mask: 255.255.255.0 > > Gateway address: 192.168.1.254 > > Primary DNS server: 192.168.0.1 > > Secondary DNS server: 192.168.0.2 > > IPAM: DHCP > > Start of IP range: 192.168.1.10 > > End of IP range: 192.168.1.200 > > VLAN ID: none > > Boot mode: DHCP > > Domain: mydomain > > > > ============================= > > > > > > My misconfiguration may be obvious for you, but after hours spent, i was > > not able to figure it out. > > > > Thank you for your help > > > > David > > > > -- > > You received this message because you are subscribed to the Google > Groups "Foreman users" group. > > To unsubscribe from this group and stop receiving emails from it, send > an email to foreman-user...@googlegroups.com . > > To post to this group, send email to forema...@googlegroups.com > . > > Visit this group at https://groups.google.com/group/foreman-users. > > For more options, visit https://groups.google.com/d/optout. > > > -- > Daniel Lobato Garcia > > @dLobatog > blog.daniellobato.me > daniellobato.me > > GPG: http://keys.gnupg.net/pks/lookup?op=get&search=0x7A92D6DD38D6DE30 > Keybase: https://keybase.io/elobato >