π Docker MacvlanΒΆ
This script interactively creates a Docker macvlan network, supporting both IPv4 and IPv6 configurations. It prompts the user for network details and executes the appropriate docker network create
command.
π οΈ Service ConfigurationΒΆ
- Interactive prompts for network name and IPv4 prefix
- Automatically constructs IPv4 subnet and gateway
- Supports both IPv4-only and dual-stack (IPv4 + IPv6) networks
- Uses
eth0
as the default parent interface and bridge mode
ProcessΒΆ
- Prompts for the Docker network name.
- Prompts for the first three octets of the IPv4 address (e.g. 10.100.0).
- Constructs the IPv4 subnet in CIDR notation (e.g. 10.100.0.0/24).
- Sets the IPv4 gateway to the .254 address in the subnet.
- Prompts for network type: dual-stack (IPv4+IPv6) or IPv4 only.
- Uses a generic IPv6 prefix for dual-stack networks.
- Constructs the IPv6 subnet in CIDR notation.
- Creates a dual-stack macvlan network with both IPv4 and IPv6.
- Creates an IPv4-only macvlan network.
π Important NotesΒΆ
- Requires Docker to be installed and running
- Must be run with sufficient privileges to create Docker networks
- Only
eth0
is supported as the parent interface (edit the script to change) - The script uses bridge mode for macvlan
π UsageΒΆ
- Run the script and follow the interactive prompts
π Maintenance & UpdatesΒΆ
- To list macvlan networks:
- To remove a macvlan network: