Rate This Document
Findability
Accuracy
Completeness
Readability

(Optional) Creating an IPVLAN

IPVLAN is a Linux networking driver that enables multiple logical interfaces to share a single physical network interface with minimal overhead. Unlike MACVLAN implementations, IPVLAN shares the physical interface MAC address across all sub-interfaces rather than assigning unique MAC addresses to each virtual interface. This architecture reduces MAC address conflicts in large deployments and optimizes switch performance by minimizing MAC table entries on switches.

Common Commands

  • Check the Docker version.
    1
    docker --version
    
  • Load an image.
    1
    docker load -i openEuler-docker.aarch64.tar.xz
    
  • View loaded images.
    1
    docker images
    

  • View running Docker containers.
    1
    docker ps
    
  • View all containers, including stopped ones.
    1
    docker ps -a
    
  • Stop a container.
    1
    docker stop <container ID>
    
  • Remove a container.
    1
    docker rm (-f) <container ID>
    
  • View container networks.
    1
    docker network ls
    

Creating a Docker IPVLAN

  1. Check whether the loaded kernel modules contain the IPVLAN module.
    1
    lsmod | grep ipvlan
    
    If no command output is displayed, load the IPVLAN kernel module.
    1
    sudo modprobe ipvlan
    
  2. If the Docker service is not started after the environment is restarted, restart the Docker service. Otherwise, skip this step.
    1
    sudo systemctl restart docker
    
  3. Create a Docker IPVLAN. Each time the environment is restarted, you need to reconfigure the Docker IPVLAN. The configuration command is as follows:
    1
    2
    3
    4
    5
    6
    docker network create -d ipvlan \
     --subnet=192.168.220.0/24 \
     --ip-range=192.168.220.128/25 \
     --gateway=192.168.220.1 \
     -o ipvlan_mode=l2 \
     -o parent=bond4 ipvlan_network
    

    Modify the following parameters as required:

    • Change the values of subnet and gateway to the subnet of the environment.
    • ip-range indicates the range of IP addresses allocated by Docker to containers. In the preceding example, the start IP address of Docker containers is 220.128. If this line is deleted, the start IP address of Docker containers is 220.2 by default.
    • Set ipvlan_mode to l2.
    • The network name is ipvlan_network.

Troubleshooting

Symptom

After the Docker IPVLAN is created, message "Error response from daemon: plugin 'ipvlan' not found" is displayed.

Solution

  1. Open the daemon.json file.
    1
    vi /etc/docker/daemon.json
    
  2. Modify the fields (if the file already contains content, add the following fields to the top).
    { 
       "experimental": true 
    }
  3. Restart the Docker service.
    1
    sudo systemctl restart docker