Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] Docker disables network forwarding
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
jwezel
n00b
n00b


Joined: 29 Jan 2003
Posts: 58
Location: Birr, Switzerland

PostPosted: Sat Feb 04, 2017 1:24 pm    Post subject: [SOLVED] Docker disables network forwarding Reply with quote

Does anyone know why docker disables forwarding for the main network card?

My network card is eno1. Whenever I run docker run or build, the kernel parameter net.ipv4.conf.eno1.forwarding goes from 1 to 0.

I have set

Code:
net.ipv4.conf.eno1.forwarding = 1


into /etc/sysctl.conf, but that doesn't prevent the change.

[Moderator edit: added [SOLVED] to title of the first post since OP responded to himself and marked the second post as [SOLVED]. -Hu]
_________________
Johnny Wezel
Back to top
View user's profile Send private message
jwezel
n00b
n00b


Joined: 29 Jan 2003
Posts: 58
Location: Birr, Switzerland

PostPosted: Sat Feb 04, 2017 4:22 pm    Post subject: [SOLVED]Docker disables network forwarding Reply with quote

Found out the problem. The culprit is systemd

Apparently, as of version 226 systemd disables forwarding if it is not explicitly enabled in the configuration. Thus the interface definition must now contain a

Code:
IPForward=ipv4

entry in the Network stanza.

Running a container causes systemd to reconfigure the interface according to the config files.
_________________
Johnny Wezel
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 13830

PostPosted: Sat Feb 04, 2017 5:39 pm    Post subject: Reply with quote

/etc/sysctl.conf is read by a startup script to apply your choices during early boot. Other programs might autonomously read it and respect it, but I am not aware of any. As you discovered, systemd will autonomously reconfigure the interface and will not respect your choice in /etc/sysctl.conf when it does so.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum