Simple haproxy Setup

I’m a bit confused about how I might be able to set up a raspberry pi as a simple http proxy on top of Balena. On a raw pi, I’ve figured out how to disallow a gateway and bind port eth0 to the subnet/address I’m trying to proxy too, but I’m not clear on how I might allow the same operation with Balena in the mix.

The steps I take with a vanilla Pi are as follows:

  1. create a wpa_supplicant.conf file to allow for headless wifi adoption on first boot (this shouldn’t be necessary if I use a Balena image with wifi & ethernet, correct?).

  2. Update the OS and install haproxy (pretty sure I can cobble this together)

  3. Modify dhcpcd.conf to disable gateway (this is where I’m getting hung up)

  4. Update the haproxy config for my purposes (also pretty sure I can cobble this together)

Thanks for the help!

You could start with the projects we use at balena for this:

A composition containing both will allow you to configure WiFi networking on a device via a browser/smartphone (via local temporary hotspot).

You’ll need to craft your own haproxy.conf, building on the empty one given in the repository.

I am not sure what is the purpose of disabling gateway - without a default gateway, the device has no network. A default gateway will be supplied by the WiFi AP you join to using wifi-connect bootstrap.

I need to disable the gateway on ETH0 so that the pi can communicate with a proprietary device. It’s my understanding that if the device I’m connecting to sets up a gateway, then the pi won’t continue to respond over wifi.

Hi digeratidoge,
Can you clarify what you are trying to do and why you need to disable ETH0 to communicate with your proprietary device? Why being proprietary requires a specific configuration?

I know this is super old at this point, but I did not see your question.

I wasn’t trying to disable communication to the custom hardware, but disable the default gateway so I could pin eth0 to a static (and different) subdomain than the Pi’s wifi (on my LAN).