Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update section about host networking with ipvlan info
After being asked about how a single container could serve multiple VLANs by Shinykey#4602 (on Discord) I said I had no clue, so the same person then experimented some and came up with a solution involving the ipvlan network driver. To help other people in the future we should probably try to add this example, even though it does requre a lot of adaptions by other users to reflect their setup.
- Loading branch information
1 parent
7a898e7
commit aa474af
Showing
2 changed files
with
83 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
# This docker-compose file was provided by Shinykey#4602 in the official | ||
# Discord channel, so all credit goes to them. | ||
# This is not a functional example since this actually the host machine to be | ||
# properly configured beforehand. | ||
# | ||
# This setup will assign multiple network interfaces to the Kea DHCP container, | ||
# all of which reside on separate separate VLANs. | ||
# In this setup the parent network interface (enp5s0) has a single connection to | ||
# the switch which is a trunk with VLAN 10, 20, 30 and 40. | ||
services: | ||
dhcp4: | ||
image: jonasal/kea-dhcp4:2 | ||
restart: unless-stopped | ||
command: -c /kea/config/dhcp4.json | ||
volumes: | ||
- ./json-config:/kea/config | ||
- sockets:/kea/sockets | ||
- leases:/kea/leases | ||
- ./logs:/kea/logs | ||
networks: | ||
vlan10: | ||
ipv4_address: <ip> | ||
vlan20: | ||
ipv4_address: <ip> | ||
vlan30: | ||
ipv4_address: <ip> | ||
vlan40: | ||
ipv4_address: <ip> | ||
|
||
volumes: | ||
sockets: | ||
leases: | ||
|
||
networks: | ||
vlan10: | ||
driver: ipvlan | ||
driver_opts: | ||
parent: enp5s0.10 | ||
ipam: | ||
config: | ||
- subnet: <subnet> | ||
gateway: <gateway> | ||
vlan20: | ||
driver: ipvlan | ||
driver_opts: | ||
parent: enp5s0.20 | ||
ipam: | ||
config: | ||
- subnet: <subnet> | ||
gateway: <gateway> | ||
vlan30: | ||
driver: ipvlan | ||
driver_opts: | ||
parent: enp5s0.30 | ||
ipam: | ||
config: | ||
- subnet: <subnet> | ||
gateway: <gateway> | ||
vlan40: | ||
driver: ipvlan | ||
driver_opts: | ||
parent: enp5s0.40 | ||
ipam: | ||
config: | ||
- subnet: <subnet> | ||
gateway: <gateway> |