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 @Heinicke (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 9f6a4a2
Showing
2 changed files
with
88 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,71 @@ | ||
# This docker-compose file was provided by @Heinicke in the official Discord | ||
# channel (Shinykey#4602), so all credit goes to them. | ||
# This is not a functional example since your VLAN environment and interface | ||
# names will probably be unique to you. Perform an `ip addr show` to see your | ||
# options, and then just modify this config like this: | ||
# | ||
# driver_opts: | ||
# parent: <interface name>.<vlan number> | ||
# | ||
# In the current setup the parent network interface (enp5s0) has a single | ||
# connection to the switch which is a trunk with VLAN 10, 20, 30 and 40, all of | ||
# which will be correctly forwarded to the DHCP service. | ||
# The upstream switch will then only need to be set up to properly forward | ||
# the correct VLANs on this trunk. | ||
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> |