|
| 1 | +fb_dhcprelay Cookbook |
| 2 | +===================== |
| 3 | +Manage ISC DHCP Relay |
| 4 | + |
| 5 | +Requirements |
| 6 | +------------ |
| 7 | + |
| 8 | +Attributes |
| 9 | +---------- |
| 10 | +* node['fb_dhcprelay']['manage_packages'] |
| 11 | +* node['fb_dhcprelay']['sysconfig'] |
| 12 | + |
| 13 | +Usage |
| 14 | +----- |
| 15 | + |
| 16 | +ISC DHCP Relay is a very simple package which forwards DHCP requests and |
| 17 | +responses across a router. It does not have a configuration file and is |
| 18 | +configured purely through command-line options. |
| 19 | + |
| 20 | +### Configuration (sysconfig) |
| 21 | + |
| 22 | +The sysconfig hash is how you can configure dhcprelay. There are two values |
| 23 | +here: `servers`, and `options`. On Debian-derived OSes, there is also |
| 24 | +`interfaces`. All 3 are arrays. |
| 25 | + |
| 26 | +**NOTE**: You must use all-lowercase keys in the `sysconfig` hash, this |
| 27 | +cookbook will upcase them for you. Using non-all-lowercase keys will cause the |
| 28 | +run to fail. |
| 29 | + |
| 30 | +You must point `servers` to the list of DHCP servers to forward requests to. |
| 31 | +Then, on Debian systems you'll want to specify which interface or interfaces to |
| 32 | +listen to in 'interfaces`. Finally, you'll want to specify, at a minimum the |
| 33 | +`-iu` and `-id` options to specify upstream and downstream interface(s). For |
| 34 | +example, let's say you have a 3-legged router with `eth0` being WAN, `eth1` |
| 35 | +being the internal network that has a DHCP server and `eth2` being the internal |
| 36 | +network without a DHCP server. On Debian-derived OSes you would do: |
| 37 | + |
| 38 | +```ruby |
| 39 | +{ |
| 40 | + 'servers' => ['10.0.0.200'], # whatever your DHCP server is |
| 41 | + 'interfaces' => ['eth2'], |
| 42 | + 'options' => ['-iu eth1', '-id eth2'], |
| 43 | +}.each do |key, val| |
| 44 | + node.default['fb_dhcprelay']['sysconfig'][key] = val |
| 45 | +end |
| 46 | +``` |
| 47 | + |
| 48 | +Or on Fedora-derived OSes: |
| 49 | + |
| 50 | +```ruby |
| 51 | +{ |
| 52 | + 'servers' => ['10.0.0.200'], # whatever your DHCP server is |
| 53 | + 'options' => ['-iu eth1', '-id eth2', '-i eth2'], |
| 54 | +}.each do |key, val| |
| 55 | + node.default['fb_dhcprelay']['sysconfig'][key] = val |
| 56 | +end |
| 57 | +``` |
| 58 | + |
| 59 | +*NOTE*: Fedora's package does not include a sysconfig file or a way to specify |
| 60 | +options, so this cookbook adds a drop-in unit file to add such functionality |
| 61 | +and a sysconfig file. You can see |
| 62 | +[bz#2348883](https://bugzilla.redhat.com/show_bug.cgi?id=2348883) for details. |
| 63 | + |
| 64 | +### Packages |
| 65 | + |
| 66 | +By default this cookbook will install the appropriate package(s). To disable |
| 67 | +this set `node['fb_dhcprelay']['manage_packages']` to `false`. |
| 68 | + |
| 69 | +### A note on EOL |
| 70 | + |
| 71 | +Technically, ISC has deprecated DHCP Relay. However, it is still currently the |
| 72 | +primary DHCP Relay used in the world and the only one widely packaged. OpenBSD |
| 73 | +has forked it, but that fork is not yet available for other OSes. You can see |
| 74 | +[this page](https://www.isc.org/blogs/dhcp-client-relay-eom/) for details. |
0 commit comments