NethServer Documentation, Release 7 Final
config setprop docker bridgeAeria br0
signal-event nethserver-docker-update
The NethServer DHCP module can be used to set IP addresses for the docker containers. By default docker containers
use random MAC addresses so fixed ones need to be set for the containers to make DHCP reservations work.
Here is an example for starting pihole in the Aeria network and set the MAC address
docker run -d --name pihole -e TZ="Europe/Vienna" -e WEBPASSWORD="admin" \
-v "$(pwd)/etc-pihole/:/etc/pihole/" \
-v "$(pwd)/etc-dnsmasq.d/:/etc/dnsmasq.d/" --cap-add NET_ADMIN \
--net=aeria --mac-address=0e:6f:47:f7:26:1a --restart=unless-stopped pihole/
˓→
pihole:latest
Aeria uses a docker plugin. To update the plugin
signal-event nethserver-docker-plugin-update
49.9 Macvlan
A container use TCP/UDP ports to communicate outside of the server, this is the default networking.
How-
ever your container could need to get a real IP on your network. Like this it will be reachable with http:/
/IPofYourContainer
instead of http://IPofYourServer:port. A specific configuration like a DNS
sinkhole (as pihole) must have an IP, because it might break the DNS resolution of your server. Therefore with a
different IP, all hosts of your network will use the services of pihole like if it was on another server.
Note: The difference between macvlan and aeria is that macvlan is not a plugin, it is an official network driver.
NethServer docker provides a docker network named macvlan that must be bound to a bridge. Each container on
the network macvlan must have a relevant IP in the range assigned to macvlan, all containers will communicate like
any servers on your network.
For the bridge creation the server manager could be used, if you have already installed the account provider Samba
AD (nethserver-dc), you have already a bridge called br0.
Warning: A bridge is mandatory to macvlan, you must accomplish this step before to go further: ip a can
valid that the bridge is up and workable. The same bridge cannot be shared among aeria and macvlan, it is a
docker limitation.
Macvlan must be created by filling some important parameters, the goal is to create a container with an IP on your
network, each parameter depends from your network setting.
• macVlanGateway : It is the gateway of your network, generally speaking it is your router (here 192.168.1.1)
• macVlanLocalNetwork : It is the full network of your router (here 192.168.1.0/24 from 192.168.1.1 to
192.168.1.255)
• macVlanNetwork : It is the restricted IP for macVlan0 (here 192.168.1.224/27, you can use 30 IP for your
containers from 192.168.1.225 to 192.168.1.254)
• macVlanNic : It is the network interface where to run macvlan (br0 here)
Create the network
Do'stlaringiz bilan baham: