How to get pppd to create ppp0 inside namespace?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
2
down vote

favorite












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?







share|improve this question















  • 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 at 15:45














up vote
2
down vote

favorite












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?







share|improve this question















  • 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 at 15:45












up vote
2
down vote

favorite









up vote
2
down vote

favorite











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?







share|improve this question











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?









share|improve this question










share|improve this question




share|improve this question









asked Apr 29 at 15:20









user1587451

1184




1184







  • 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 at 15:45












  • 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 at 15:45







1




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 at 15:45




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 at 15:45










1 Answer
1






active

oldest

votes

















up vote
0
down vote













Ideas:



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.



Edit



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 192.168.36.1:192.168.36.2
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 192.168.36.2:192.168.36.1


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.






share|improve this answer























  • 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 at 11:25










Your Answer







StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "106"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
convertImagesToLinks: false,
noModals: false,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);








 

draft saved


draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f440747%2fhow-to-get-pppd-to-create-ppp0-inside-namespace%23new-answer', 'question_page');

);

Post as a guest






























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes








up vote
0
down vote













Ideas:



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.



Edit



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 192.168.36.1:192.168.36.2
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 192.168.36.2:192.168.36.1


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.






share|improve this answer























  • 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 at 11:25














up vote
0
down vote













Ideas:



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.



Edit



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 192.168.36.1:192.168.36.2
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 192.168.36.2:192.168.36.1


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.






share|improve this answer























  • 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 at 11:25












up vote
0
down vote










up vote
0
down vote









Ideas:



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.



Edit



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 192.168.36.1:192.168.36.2
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 192.168.36.2:192.168.36.1


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.






share|improve this answer















Ideas:



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.



Edit



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 192.168.36.1:192.168.36.2
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 192.168.36.2:192.168.36.1


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.







share|improve this answer















share|improve this answer



share|improve this answer








edited May 1 at 14:15


























answered Apr 29 at 16:46









dirkt

14k2930




14k2930











  • 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 at 11:25
















  • 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 at 11:25















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 at 11:25




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 at 11:25












 

draft saved


draft discarded


























 


draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f440747%2fhow-to-get-pppd-to-create-ppp0-inside-namespace%23new-answer', 'question_page');

);

Post as a guest













































































Popular posts from this blog

Peggy Mitchell

Palaiologos

The Forum (Inglewood, California)