gen_udp does not currently provide a way to do this. you will need to change the inet layer below it to use this new functionality. This will not be difficult to do if you look at other parameters that they allow to set, for example multicast_ttl, and you can probably implement gen_udp: send, recv and open, which allow this suppoert.