# Assigning DHCP addresses to PPP clients

## friction

I'm actually setting up a VPN, but essentially I need to assign the PPP clients (i.e. VPN road-warriors) an address through DHCPd.

Apparantly there is a ppp plugin called ppp-dhcp, but there doesn't appear to be an ebuild for it. Which is weird since I would have thought assigning PPP clients a DHCP address would be extremely common.

Here is some background if its relevant:

The VPN will be an IPSec/L2TP VPN, using super-freeswan, rp-lt2p, ppp and dhcpd - and the setup is based on http://www.jacco2.dds.nl/networking/freeswan-l2tp.html

Anyway, I'm using super-freeswan as its an ebuild that means I don't have to add the delete/notification patch, and the nat-traversal patch.

I'm using rp-l2tp with the hope I won't need to patch it to get it working with freeswan

But rp-l2tp doesn't support dynamically assigned IP addresses, which is good since doing so is a violation of the OSI networking layering model, instead you need to use DHCP and a pppd plugin called, aptly..ppp-dhcp

From what I can find, the ppp-dhcp plugin has no ebuild, and I would have thought that assigning PPP clients an address via DHCP would be very very common.

Maybe it's an ebuild in something else, or whatever. Do I just have to build it manually?

----------

## friction

To reply to my own post...

I built and submitted an ebuild, you can view it here: https://bugs.gentoo.org/show_bug.cgi?id=62969

If you want to try it, download the ebuild and put it into your portage overlay directory (say, /usr/local/portage/net-dialup/ppp/), copy the "files" directory from /usr/portage/net-dialup/ppp/files into your portage overlay directory, add ppp-dhcpc.tgz to the new files directory, and emerge the new ebuild.

To your ppp options file (in my case, /etc/ppp/options.l2tp), add:

plugin dhcpc.so

dhcp-interface lo (replace with remote interface if not local)

dhcp-relay-address 192.168.0.1 (replace with ppp server's ip)

The limitation is that the plugin doesn't send a dhcp client-id when fetching an ip address, which is a real shame because that means I can't get dns to automatically update.

----------

