Blender NET_RENDER using command line
You can do it like this:

blender -b -y -P master.py -noaudio --addons netrender file.blend


Contents of master.py:

import bpy
bpy.ops.wm.addon_enable(module="netrender")
bpy.context.scene.render.engine="NET_RENDER"
bpy.context.scene.network_render.mode = 'RENDER_MASTER'
bpy.context.scene.network_render.path = "/tmp/"
bpy.context.scene.network_render.server_address = "[default]"
bpy.context.scene.network_render.server_port = 8200
bpy.ops.render.netclientstart()


For the slave you can use the same blender command with a second python script. Create a copy of master.py, name it slave.py or something and change the according line for the mode to:

[...]

bpy.context.scene.network_render.mode = 'RENDER_SLAVE'

[...]


Tested in blender 2.79a.

Note: this is currently broken in the latest daily builds of blender 2.80 (refer here) I'm currently searching for a workarround, to get the new gpu / host memory feature working with automated network rendering, but they'll probably fix it anyways when blender 2.80 comes out.