I just received a 2-year old netbook, which seemed perfect for me to install as a network 'bridge': providing internet to a pc by:
* receiving internet through wlan
* routing it with iptables to the ethernet adapter
To expand the functionality, I am adding dhcpd, minidlna, ntpd, ... - services.
I have already setup netctl:
* netctl-auto@wlan is connecting automagically upon boot and providing network.target
* netctl-ifplugd@eth is connecting automagically whenever I plug in the ethernet-cable.
But: since connecting to the wlan provides the network.target, services like dhcpd and minidlna are started only to fail because the ethernet adapter is not brought up.
I think the best solution is to make a custom .target-file, f.e. an 'ifplugd.target' and edit the service files of the services that I wish to start only after the ethernet-adapter is brought up. Inside the service files I should only have to change 'After = network.target' to 'After = ifplugd.target' - but how do I provide the ifplugd.target through systemd or netctl?
(or am I doing this all wrong?)
/EDIT: to correct myself: this is not really a bridge, but rather a 'sharing of internet' as the wiki describes it (if this should be relevant at all) - subject changed
Last edited by zenlord (2013-04-16 19:53:03)
I thought I had found the answer:
1. Do not create a custom .target
2. Change the service files of minidlna, dhcpd4, nmbd (required by samba) to have:
3. Disable the above services to start at boot.
RESULT: ifplugd works, activating the netctl profile with the static IP-address, but the dependent services don't start automatically.
I solved it, but it's not the most elegant solution: I added to the netctl profile for my ethernet adapter two commands 'ExecUpPost' and 'ExecDownPre', each starting/stopping a series of systemctl services...
Happy to hear other / more elegant solutions...