You are not logged in.

#1 2016-05-05 21:54:30

zzggbb
Member
Registered: 2016-05-05
Posts: 4

How do I force a systemd service to use my wifi?

I have two network interfaces, eth0 and wlan0. How can I force a systemd service such as transmission-daemon to use wlan0?

Offline

#2 2016-05-05 23:19:21

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,224
Website

Re: How do I force a systemd service to use my wifi?

Network Namespaces will be your friend here I think: http://blogs.igalia.com/dpino/2016/04/1 … amespaces/

I don't have a step-by-step for you, I only learnt about network namespaces a couple of weeks ago myself.

Offline

#3 2016-05-06 00:35:26

djgera
Developer
From: Buenos Aires - Argentina
Registered: 2008-12-24
Posts: 723
Website

Re: How do I force a systemd service to use my wifi?

You have some interesting ways to do this from differents points of view.

1) Using a network namespace as said fakawi2 is one,
1.1) Place wlan0 in this namespace. (but said good bye to wifi outside this namespace).
1.2) Create a pair of veth keeping one veth in main then the other in the namespace on transmission. Then do a SNAT in wlan0 for veth, and DNAT for mapping port of transmission and enable ip forwarding in both interfaces, set policy based routing adding a default gw from packets coming from veth.
2) make transmission to bind only on wlan0 then setup a policy based routing adding a default gateway for packets with origin from the wlan0 IP.
3) mark packets from the user executing transmission-daemon, with netfilter mangle table, setup a policy based routing, and disable or set to loose rp_filter.

You also need to comunicate in some way with transmission-daemon via remote client.

EDIT: But all depends on your current setup.

Last edited by djgera (2016-05-06 02:56:16)

Offline

Board footer

Powered by FluxBB