DaemonForums  

Go Back   DaemonForums > FreeBSD > FreeBSD General

FreeBSD General Other questions regarding FreeBSD which do not fit in any of the categories below.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 1st November 2008
zelut zelut is offline
Port Guard
 
Join Date: Oct 2008
Posts: 11
Default dhcpd within ezjail?

I've not been able to get dhcpd working properly within a jail. I have a number of other jails setup, but dhcpd doesn't seem to respond to any requests.

It will start up and the process is active in top, etc. When I have another client ask for an address however nothing happens. No output in the logs regarding dhcpd either.

I have this in my jail /etc/rc.conf:
Code:
## dhcpd options
dhcpd_enable="YES"
dhcpd_flags="-q"
dhcpd_conf="/usr/local/etc/dhcpd.conf"
dhcpd_ifaces="hme0"
dhcpd_withumask="022"

dhcpd_chuser_enable="YES" # runs w/o privileges?
dhcpd_withuser="dhcpd" # user name to run as
dhcpd_withgroup="dhcpd" # group name to run as
dhcpd_chroot_enable="NO" # runs chrooted?
dhcpd_devfs_enable="NO" # use devfs if available?
#dhcpd_makedev_enable="YES"
dhcpd_rootdir="/var/db/dhcpd"
dhcpd_includedir=""
#dhcpd_jail_enable="YES"
dhcpd_hostname="hostname.domain.tld"
dhcpd_ipaddress="192.168.0.13"
I've also got the following in my dhcpd.conf:

Code:
option domain-name "domain.tld";
option domain-name-servers 192.168.0.13;
default-lease-time 600;
max-lease-time 7200;

authoritative;
ddns-update-style none;

subnet 192.168.0.0 netmask 255.255.255.0 {
  range 192.168.0.20 192.168.0.29;
  option domain-name-servers 192.168.0.13;
  option domain-name "domain.tld";
  option routers 192.168.0.1;
  option broadcast-address 192.168.0.255;
  default-lease-time 6000;
  max-lease-time 7200;
}
thanks in advance
Reply With Quote
  #2   (View Single Post)  
Old 1st November 2008
anomie's Avatar
anomie anomie is offline
Local
 
Join Date: Apr 2008
Location: Texas
Posts: 445
Default

AFAIK, as FBSD Jails are currently implemented, your jailed environment's IP address must be specified in your host environment - i.e. at the time you start up the Jail. (In other words, I don't think it's possible to have a Jail dhcp client.)
__________________
Kill your t.v.
Reply With Quote
  #3   (View Single Post)  
Old 8th February 2009
terryd terryd is offline
Port Guard
 
Join Date: Nov 2008
Posts: 22
Default

To run a dhcpd in my jail I had to use a custom devfs

[devfsrules_jail_dhcp=5]
add include $devfsrules_hide_all
add include $devfsrules_unhide_basic
add include $devfsrules_unhide_login
add path 'bpf*' unhide
add path net unhide
add path 'net/*' unhide
Reply With Quote
  #4   (View Single Post)  
Old 9th February 2009
anomie's Avatar
anomie anomie is offline
Local
 
Join Date: Apr 2008
Location: Texas
Posts: 445
Default

Good one, terryd. I didn't know it was possible. (Hopefully OP checks this thread again eventually.)

Out of curiosity, what do your jail-related rc.conf directives look like on the host?
__________________
Kill your t.v.
Reply With Quote
  #5   (View Single Post)  
Old 10th February 2009
terryd terryd is offline
Port Guard
 
Join Date: Nov 2008
Posts: 22
Default

Quote:
Originally Posted by anomie View Post
Good one, terryd. I didn't know it was possible. (Hopefully OP checks this thread again eventually.)

Out of curiosity, what do your jail-related rc.conf directives look like on the host?

I was given this link off some one on another mailing list
http://markmail.org/message/3dtdyok4hxtb7hou

Because I use ezjail the settings are not in rc.conf but in the ezjail configs

Code:
cf# more /usr/local/etc/ezjail/thttpd
# To specify the start up order of your ezjails, use these lines to
# create a Jail dependency tree. See rcorder(8) for more details.
#
# PROVIDE: standard_ezjail
# REQUIRE:
# BEFORE:
#

export jail_thttpd_hostname="thttpd"
export jail_thttpd_ip="192.168.1.207"
export jail_thttpd_rootdir="/storage/ezjail/thttpd"
export jail_thttpd_exec="/bin/sh /etc/rc"
export jail_thttpd_mount_enable="YES"
export jail_thttpd_devfs_enable="YES"
export jail_thttpd_devfs_ruleset="devfsrules_jail_dhcp"
export jail_thttpd_procfs_enable="YES"
export jail_thttpd_fdescfs_enable="YES"
export jail_thttpd_image=""
export jail_thttpd_imagetype=""
export jail_thttpd_attachparams=""
export jail_thttpd_attachblocking=""
export jail_thttpd_forceblocking=""
Code:
cf# more /etc/devfs.rules
[devfsrules_jail_dhcp=5]
add include $devfsrules_hide_all
add include $devfsrules_unhide_basic
add include $devfsrules_unhide_login
add path 'bpf*' unhide
add path net unhide
add path 'net/*' unhide
Reply With Quote
  #6   (View Single Post)  
Old 10th February 2009
anomie's Avatar
anomie anomie is offline
Local
 
Join Date: Apr 2008
Location: Texas
Posts: 445
Default

I see. So, the directive jail_thttpd_ip="192.168.1.207" basically just provides a dummy IP address to fire up the jail? (I say "dummy IP address" because at jail initialization time you're getting a new IP address via dhcp.)

Thanks for the info.
__________________
Kill your t.v.
Reply With Quote
  #7   (View Single Post)  
Old 10th February 2009
terryd terryd is offline
Port Guard
 
Join Date: Nov 2008
Posts: 22
Default

Quote:
Originally Posted by anomie View Post
I see. So, the directive jail_thttpd_ip="192.168.1.207" basically just provides a dummy IP address to fire up the jail? (I say "dummy IP address" because at jail initialization time you're getting a new IP address via dhcp.)

Thanks for the info.
Hi anomie no the ip 207 is an ip alias which has all ready been added for the jail. The dhcp server is just for the other machines on the lan
Reply With Quote
  #8   (View Single Post)  
Old 10th February 2009
anomie's Avatar
anomie anomie is offline
Local
 
Join Date: Apr 2008
Location: Texas
Posts: 445
Default

Oof, I can't believe it. This whole thread I thought OP was asking how to set up a jail as a dhcp client. Now that you say it, he's obviously trying to run a dhcp server within the jail.

@zelut: If you read this, sorry - I got the wrong idea about what you're trying to do. terryd's comments should straighten you out.
__________________
Kill your t.v.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
dhcpd, vista and wlan hamba FreeBSD Ports and Packages 5 8th September 2009 04:34 PM
dhcpd and dns sputnik OpenBSD General 8 8th May 2009 02:50 PM
ezjail /usr/home users and groups question neurosis FreeBSD Security 7 8th September 2008 08:40 PM
Jails, ezjail, apache, very newbie question. neurosis FreeBSD General 15 23rd August 2008 01:38 PM
help for setting ezjail? bgobs FreeBSD General 13 15th June 2008 10:50 AM


All times are GMT. The time now is 04:01 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick