I would like to setup on a debian 9 machine inside the /etc/interfaces file both the dhcp and pppoe config.

So that I can move my machine with it's eth0 and attach it:

  • to a friend house that has pppoe, in this case the machine see pppoe available and establish a connection with it (I have the provider config file already setup on the machine)

  • to my house where I have my router with dhcp, and I benefit from dhcp for getting my IP address

  • Is it possible to do that?

  • Should I specify inside interfaces both pppoe and inet dhcp?

1 Answer 1


To answer your question, yes it should be possible to use both dynamic and static IP interface configurations. You do this by creating virtual interfaces to use the same physical interface. Each virtual interface will need to be configured properly to your network's needs.

I am not as familiar with PPPoE but I have found some links that could help you. This post covers how to configure having both static and dynamic interfaces. Here is the Official Debian Wiki on how to set up PPPoE. Again I suggest you read through the Debian Wiki on how to do network configuration using different interface settings.

According to the aforementioned links, your /etc/network/interfaces should look something like this:

auto lo eth0 eth0:0
iface lo inet loopback

iface eth0 inet dhcp

iface eth0:0 inet manual

auto dsl-provider
iface dsl-provider inet ppp
pre-up    /sbin/ifconfig eth0:0 up
provider dsl-provider

Don't forget to run pppoeconf to generate and/or modify /etc/ppp/peers/dsl-provider, /etc/ppp/*ap-secrets files and /etc/network/interfaces. It is best, in most cases, to keep the suggested answers

I would substitute eth0 with whatever the name of your device actually appears by default to keep things simple. However I highly suggest you read through the Debian manual on how to set up networking before you do anything. Remember to figure out where your network is getting its configuration information from and make the appropriate changes there. Best of Luck!

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .