I have a simple pppoe connection which is working fine. A simple

# pon my-isp

creates a ppp0 device.

I have defined a namespace like

ip netns add physical

but after

ip netns exec physical pon my-isp

does not create a ppp0 neither in global namespace nor in physical namespace.

How can I get a ppp0 inside the mentioned namespace?

  • 1
    Can pppd access the PPPoE device from the namespace? I guess you need a veth pair and have to bridge the outer one with your real ethernet interface. – Hauke Laging Apr 29 '18 at 15:45


1) Let pon create the device in the default namespace, then move it into physical. Script the process.

2) pon is just a script, if you look at it, it calls pppd. Copy the script, modify it so that it uses netns exec to call pppd. See if that solves the problem. As Hauke has said, you need the PPPoE device in the namespace. A veth pair may or may not be necessary, depending on what you want to do with the namespace.


I don't know your exact setup (all ppp and pppoe configuration files are missing from the description), so I tried out a simplified setup that connects two namespaces via PPPoE. As expected, starting pppd in a namespace makes the ppp0 device appear in that namespace, so I really don't know what goes wrong in your configuration.

Test the following (as root):

ip netns add ns1
ip netns add ns2
ip link add veth1 type veth peer name veth2
ip link set veth1 addr 52:54:00:00:00:01
ip link set veth2 addr 52:54:00:00:00:02
ip link set veth1 netns ns1
ip link set veth2 netns ns2
ip -n ns1 link set lo up
ip -n ns1 link set veth1 up
ip -n ns2 link set lo up
ip -n ns2 link set veth2 up    
ip netns exec ns1 pppd pty '/usr/sbin/pppoe -I veth1 -e 1:52:54:00:00:00:02 -m 1412' noaccomp nopcomp asyncmap 000a0008 noauth nocrtscts xonxoff local maxfail 0
ip netns exec ns2 pppd pty '/usr/sbin/pppoe -I veth2 -e 1:52:54:00:00:00:01 -m 1412' noaccomp nopcomp asyncmap 000a0008 noauth nocrtscts xonxoff local maxfail 0

Now start two xterms in the namespace as user username, so you can look at the configuration, test with ping etc (I like to have colored backgrounds for this, so I know which is which):

ip netns exec ns1 su -c "xterm -bg yellow &" username
ip netns exec ns2 su -c "xterm -bg lime &" username

If that works, something in the way your PPPoE-scripts set up things is in the way. If it doesn't work, something else is wrong.

  • I have added all physical devices into one namespace like ip link set enp5s0f0 netns physical. After this a normal pppd call my-isp does not work. ip netns exec physical pppd call starts. I can see pppd in the process list. But no ppp0 device apears. Not in global or physical namespace. – user1587451 Apr 30 '18 at 11:25

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.