How to get pppd to create ppp0 inside namespace?

Clash 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?
iproute namespace pppd
add a comment |Â
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?
iproute namespace pppd
1
Canpppdaccess 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
add a comment |Â
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?
iproute namespace pppd
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?
iproute namespace pppd
asked Apr 29 at 15:20
user1587451
1184
1184
1
Canpppdaccess 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
add a comment |Â
1
Canpppdaccess 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
add a comment |Â
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.
I have added all physical devices into one namespace likeip link set enp5s0f0 netns physical. After this a normalpppd call my-ispdoes not work.ip netns exec physical pppd callstarts. I can seepppdin the process list. But no ppp0 device apears. Not inglobalorphysicalnamespace.
â user1587451
Apr 30 at 11:25
add a comment |Â
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.
I have added all physical devices into one namespace likeip link set enp5s0f0 netns physical. After this a normalpppd call my-ispdoes not work.ip netns exec physical pppd callstarts. I can seepppdin the process list. But no ppp0 device apears. Not inglobalorphysicalnamespace.
â user1587451
Apr 30 at 11:25
add a comment |Â
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.
I have added all physical devices into one namespace likeip link set enp5s0f0 netns physical. After this a normalpppd call my-ispdoes not work.ip netns exec physical pppd callstarts. I can seepppdin the process list. But no ppp0 device apears. Not inglobalorphysicalnamespace.
â user1587451
Apr 30 at 11:25
add a comment |Â
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.
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.
edited May 1 at 14:15
answered Apr 29 at 16:46
dirkt
14k2930
14k2930
I have added all physical devices into one namespace likeip link set enp5s0f0 netns physical. After this a normalpppd call my-ispdoes not work.ip netns exec physical pppd callstarts. I can seepppdin the process list. But no ppp0 device apears. Not inglobalorphysicalnamespace.
â user1587451
Apr 30 at 11:25
add a comment |Â
I have added all physical devices into one namespace likeip link set enp5s0f0 netns physical. After this a normalpppd call my-ispdoes not work.ip netns exec physical pppd callstarts. I can seepppdin the process list. But no ppp0 device apears. Not inglobalorphysicalnamespace.
â 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
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
1
Can
pppdaccess 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