Rate This Document
Findability
Accuracy
Completeness
Readability

(Optional) Creating an IPVLAN

If you need to set up a Docker-based environment with bond4 and IPVLAN configurations, create an IPVLAN as instructed in this section. Otherwise, skip this section.

IPVLAN is a Linux networking driver that enables multiple logical interfaces to share a single physical network interface with minimal overhead. This architecture reduces MAC address conflicts in large deployments and optimizes switch performance by minimizing MAC table entries.

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>
    
  • Check the container network.
    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 network. The following are examples of the configuration commands. Change the parameters based on the site requirements. For details, see Table 1.
    1
    2
    3
    4
    5
    6
    docker network create -d ipvlan \
     --subnet=192.168.***.0/24 \
     --ip-range=192.168.***.128/25 \
     --gateway=192.168.***.1 \
     -o ipvlan_mode=l2 \
     -o parent=bond4 ipvlan_network
    

    This operation needs to be performed each time the environment is restarted.

    Table 1 Parameter description

    Parameter

    Description

    Value

    subnet

    Indicates the subnet.

    Change the value of this parameter to the network segment of the environment. The network segment must be the same as that of the NIC IP address.

    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 192.168.***.128. If this line is deleted, the start IP address of Docker containers is 192.168.***.2 by default.

    gateway

    Indicates the gateway.

    Change the value of this parameter to the network segment of the environment. The network segment must be the same as that of the NIC IP address.

    ipvlan_mode

    Indicates the IPVLAN mode.

    l2

    parent

    Indicates the name of the network device that functions as the parent interface, which is usually a logical interface that aggregates multiple physical NICs.

    Set parent as the name of the network device, which can be a bond4 NIC or a single NIC, for example, enp24s0f0np0 ipvlan_network.

    The network name is ipvlan_network.