LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Other *NIX Forums > *BSD
User Name
Password
*BSD This forum is for the discussion of all BSD variants.
FreeBSD, OpenBSD, NetBSD, etc.

Notices


Reply
  Search this Thread
Old 07-18-2016, 03:41 PM   #1
alanware
Member
 
Registered: Aug 2011
Location: Midwest-USA
Distribution: Slackware
Posts: 85

Rep: Reputation: Disabled
dhcrelay configuration


I am trying to configure dhcrelay on OpenBSD. The man page is very brief and does not mention how to use rcctl. I can get rcctl to enable dhcrelay, but where to I place the interface(s) and dhcp server ip address. Some distributions have mentioned a config file and others just use command line switches.
 
Old 07-18-2016, 07:21 PM   #2
Emerson
LQ Sage
 
Registered: Nov 2004
Location: Saint Amant, Acadiana
Distribution: Gentoo ~amd64
Posts: 7,661

Rep: Reputation: Disabled
Not sure about OpenBSD, but in FreeBSD you could create a sh script and drop it in /usr/local/etc/rc.d. Everything that has executable bit set and has sh extension will be executed in this directory at startup.
 
Old 07-19-2016, 10:37 AM   #3
jggimi
Member
 
Registered: Jan 2016
Distribution: None. Just OpenBSD.
Posts: 289

Rep: Reputation: 169Reputation: 169
You might try:
Code:
# rcctl enable dhrelay
# rcctl set dhrelay flags -i <interface> <Server1> ...<ServerN>
See the rcctl(8) man page for examples of setting flags.

You may also manually edit your rc.conf.local(5) file, if you prefer.
 
Old 07-19-2016, 07:16 PM   #4
alanware
Member
 
Registered: Aug 2011
Location: Midwest-USA
Distribution: Slackware
Posts: 85

Original Poster
Rep: Reputation: Disabled
That looks like what I am after. Do I need to use a -i before each interface that dhcrelay listens on?
 
Old 07-19-2016, 07:22 PM   #5
alanware
Member
 
Registered: Aug 2011
Location: Midwest-USA
Distribution: Slackware
Posts: 85

Original Poster
Rep: Reputation: Disabled
When I use the above command and then try and start the service, it fails. Log says that it cannot find the address I enter after -i.

Quote:
rcctl set dhrelay flags -i 192.168.2.10 192.168.1.21
192.168.2.10 is my wifi interface and 192.168.1.21 is the dhcp server.

Quote:
Jul 3 15:22:32 pf dhcrelay: 192.168.3.10: not found
Jul 3 15:22:32 pf dhcrelay: exiting.
 
Old 07-19-2016, 10:14 PM   #6
jggimi
Member
 
Registered: Jan 2016
Distribution: None. Just OpenBSD.
Posts: 289

Rep: Reputation: 169Reputation: 169
I'm not a dhcrelay user. But according to the dhcrelay(8) man page, -i requires an interface, not an address. This is the interface that listens for DHCP/BOOTP requests. Server1 through ServerN are the addresses of the DHCP servers where dhcrelay forwards those requests for processing, on other networks. Each instance of dhcrelay can only listen to a single interface.

If you require forwarding of DHCP requests from more than one network, you will need multiple instances of dhcrelay. The rc.subr(8) system configured with rcctl(8) and rc.conf.local(5) cannot be used for more than a single instance of the same service. You may start as many instances as you need via rc.local(8), which is a user-defined shell script called at the end of the rc(8) bootup sequence.

Another alternative might be to run a DHCP server on the OpenBSD system, rather than relaying to external servers. A single server can be configured to support many interfaces.

Last edited by jggimi; 07-19-2016 at 10:22 PM. Reason: clarity
 
Old 07-19-2016, 11:25 PM   #7
alanware
Member
 
Registered: Aug 2011
Location: Midwest-USA
Distribution: Slackware
Posts: 85

Original Poster
Rep: Reputation: Disabled
Thank you for your responses. I changed the interface to athn0 and it seems to be working. I will test more tomorrow.
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
dhcrelay by MAC address? ncsuapex Linux - Networking 8 01-05-2011 06:24 PM
how to use dhcrelay? chickenjoy Linux - Networking 2 11-29-2010 04:13 AM
DHCRELAY setup metallica1973 Linux - Networking 6 02-26-2008 02:10 PM
dhcrelay problem deice Linux - Networking 2 09-23-2004 12:00 PM
RedHat 8.0 - dhcrelay, ip forwarding not working klnasveschuk Linux - Networking 1 12-04-2003 07:40 PM

LinuxQuestions.org > Forums > Other *NIX Forums > *BSD

All times are GMT -5. The time now is 04:43 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration