2

I hava lots of pppoe accounts and want to build a small spider-network with them.

So, I want to use docker to virtualize multiple centos methine and do pppoe dialup within.

My methine has two adapter, em1 for pppoe dialup and em2 has a static ip address. when I run a container with bridge, It use em2 and can access to the Internet.

I have tried macvlan:

docker network create -d macvlan --subnet 10.0.0.0/24 --gateway 10.0.0.1 -o parent=em1 -o macvlan_mode=bridge pppoe

and host mode:

docker run --net=host --cap-add=NET_ADMIN -it --rm pppoe

Nothing seems to work...

How can I dialup in containers and assign it with em1?

Micr
  • 161
  • 2
  • 10

2 Answers2

2

The pppoe failed due to can't access to /dev/ppp device, You can fix this by using:

--privileged --cap-add=NET_ADMIN
Micr
  • 161
  • 2
  • 10
0

I just solved this problem yesterday, created OpenWRT 18.06.2 as container to serve my homelan as prime router, using macvlan to create the WAN network.

The main problem is pppoe module is not loaded at host side, so at container(OpenWRT) side you will see error messages like "/dev/ppp doesn't exist, create it by mknod /dev/ppp ...". After you created /dev/ppp as instructed, the problem will be solved, but temporarily. After you reboot the system, you have to create /dev/ppp again.

To solve this problem completely, just load pppoe module at boot time @ host side,

echo pppoe >> /etc/modules

then /dev/ppp will be automatically created @ container(OpenWRT) side.

Tested in the following environment:

  • hardware: Phicomm N1
  • host os: armbian_5.60_aml-s9xxx_debian_stretch_default_4.18.7
  • contaner: openwrt-18.06.2-armvirt-64-default-rootfs.tar.gz
zhoux
  • 1
  • 1