My problem is related to USB tethering and network interfaces.

When I run ifconfig -a, normally I see 3 interfaces - loopback, WiFi and Ethernet. I have defined gateway, netmask and broadcast for each one of them in /etc/networking/interfaces.

Sometimes I connect my phone to my machine for USB tethering and when running ifconfig -a I can see 1 more interface called enp0s20u2. This interface is shown only when the phone is connected and USB tethering is enabled in it. In order to bring up that interface, I've added the following lines in /etc/networking/interfaces:

# For USB tethering
auto enp0s20u2
iface enp0s20u2 inet dhcp

This way, When I connect my phone, this interface is automatically brought up and configured.

The problem is that the systemd service can't start if the phone is not connected. The enp0s20u2 interface is unknown most of the time, Therefore systemctl fails to bring it up on startup as well as when I manually run systemctl restart networking.

Is there a way to assure this interface configuration won't make the service fail to start?

  • You should not keep an interface that is not always present as auto. Yet, removing auto will create the problem that you will need to perform the ip link enp0s20u2 up command by hand. To not run it by hand you may be able to setup a ifplugd service but then it if ifplugd that will fail on startup. A better option may be nmcli (NetworkManager). – grochmal Jul 9 '16 at 2:09
  • This general approach should work for you: evadeflow.com/2012/11/… – Argonauts Jul 9 '16 at 5:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.