Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Giving full access to eth1 to docker container

Can I run docker container that will have access to eth1. DSL provider is connected to eth1. I have default internet on eth0. I wish to docker container to dial pppoe on eth1 and apps in docker to use that internet with full access to internet without port mapping.

like image 931
Max Avatar asked Dec 06 '25 09:12

Max


2 Answers

I don't see any reason why you cannot do what you are attempting. Add the flag

--cap-add=NET_ADMIN

to the docker run command. This will give the container sufficient privileges to create and configure interfaces.

like image 119
user2105103 Avatar answered Dec 08 '25 00:12

user2105103


The easiest option is to run with the host's network stack. You won't have any network isolation between containers, but eth1 will be there as if you were running a regular process.

To do this, use docker run --net=host [rest of run command]

It may also be possible to build your own bridge and link a veth from the container to the bridge to eth1. I haven't tried that, nor have I ever tried to control pppoe.

like image 36
Bryan Avatar answered Dec 08 '25 00:12

Bryan



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!