Skip to content
Andreas Misje edited this page Jul 2, 2019 · 3 revisions

Help

Please refer to the README or the help output from the dhcpoptinj binary (dhcpoptinj --help).

Practical use cases

What do you use dhcpoptinj for?

Bridged OpenVPN Setup

  • OpenVPN clients receive IP address from OpenVPN server in bridged tap configuration
  • OpenVPN clients provide bridge interface to other devices
  • Devices connected to client bridge receive IP address from primary DHCP server, but require a static route pushed for full connectivity
  • dhcpoptinj used on OpenVPN clients to inject option to tell primary DHCP server to push static route only to these devices

Bridged OpenVPN Setup

Layer 2 traffic is desired between two separated networks. This could be for a number of reasons. OpenVPN in TAP configuration provides this. However, it is pointless to route all Internet traffic through one gateway on one side of the bridged VPN network. This is where dhcpoptinj can help you. By intercepting DHCP packets on the bridged interface on one end, the gateway can be set either directly or by tagging the request for even more complicated logic by a DHCP server. The result is a bridged Ethernet as if there was no VPN involved, except no Internet traffic is routed unnecessarily through the VPN link to the other endpoint's gateway.

Clone this wiki locally