Estos contenidos se han traducido de forma automática para su comodidad, pero Huawei Cloud no garantiza la exactitud de estos. Para consultar los contenidos originales, acceda a la versión en inglés.
Cómputo
Elastic Cloud Server
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Redes
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Gestión y gobernanza
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
Cloud Operations Center
Resource Governance Center
Migración
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Análisis
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
IoT
IoT Device Access
Otros
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Seguridad y cumplimiento
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Blockchain
Blockchain Service
Servicios multimedia
Media Processing Center
Video On Demand
Live
SparkRTC
Almacenamiento
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Contenedores
Cloud Container Engine
SoftWare Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Bases de datos
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Aplicaciones empresariales
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Data Lake Factory
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Distribución de contenido y cómputo de borde
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Soluciones
SAP Cloud
High Performance Computing
Servicios para desarrolladores
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
Cloud Application Engine
aPaaS MacroVerse
KooPhone
KooDrive
En esta página

Mostrar todo

Centro de ayuda/ Bare Metal Server/ Guía del usuario/ Red/ VLAN definida por el usuario/ Configuración de una VLAN definida por el usuario (SUSE Linux Enterprise Server 12)

Configuración de una VLAN definida por el usuario (SUSE Linux Enterprise Server 12)

Actualización más reciente 2025-02-18 GMT+08:00
NOTA:

El segmento de red de la VLAN definida por el usuario no puede superponer la información de red configurada en el BMS.

En esta sección se utiliza SUSE Linux Enterprise Server 12 SP1 (x86_64) como ejemplo para describir cómo configurar una VLAN definida por el usuario para BMS.

  1. Utilice una clave o contraseña para iniciar sesión en el BMS como usuario root.
  2. En CLI de BMS, ejecute el siguiente comando para comprobar la información de la NIC:

    ip link

    Se muestra la información similar a la siguiente.

    1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default 
        link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    2: eth0: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 8888 qdisc mq master bond0 state UP mode DEFAULT group default qlen 1000
        link/ether fa:16:3e:3d:1c:e0 brd ff:ff:ff:ff:ff:ff
    3: eth1: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 8888 qdisc mq master bond0 state UP mode DEFAULT group default qlen 1000
        link/ether fa:16:3e:3d:1c:e0 brd ff:ff:ff:ff:ff:ff
    4: eth2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state DOWN mode DEFAULT group default qlen 1000
        link/ether 38:4c:4f:89:55:8d brd ff:ff:ff:ff:ff:ff
    5: eth3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state DOWN mode DEFAULT group default qlen 1000
        link/ether 38:4c:4f:89:55:8e brd ff:ff:ff:ff:ff:ff
    6: bond0: <BROADCAST,MULTICAST,MASTER,UP,LOWER_UP> mtu 8888 qdisc noqueue state UP mode DEFAULT group default 
        link/ether fa:16:3e:3d:1c:e0 brd ff:ff:ff:ff:ff:ff
    7: bond0.3133@bond0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 8888 qdisc noqueue state UP mode DEFAULT group default 
        link/ether fa:16:3e:57:87:6e brd ff:ff:ff:ff:ff:ff
    NOTA:

    Entre los dispositivos, eth0 y eth1 llevan la VPC, y eth2 y eth3 llevan la VLAN definida por el usuario.

  3. Configure las reglas udev:

    Ejecute el siguiente comando para crear el archivo 80-persistent-net.rules:

    cp /etc/udev/rules.d/70-persistent-net.rules /etc/udev/rules.d/80-persistent-net.rules

    Escriba en el archivo la dirección y el nombre MAC de NIC que se consultan en el 2 y que no se muestran en el 80-persistent-net.rules. De esta manera, después de reiniciar el BMS, el nombre y la secuencia de la NIC no cambiarán.

    NOTA:

    Asegúrese de que la dirección MAC y el nombre de la NIC sean letras minúsculas.

    vim /etc/udev/rules.d/80-persistent-net.rules

    El resultado de la modificación es el siguiente:

    SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="38:4c:4f:29:0b:e0", NAME="eth0"
    SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="38:4c:4f:29:0b:e1", NAME="eth1"
    SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="38:4c:4f:89:55:8d", NAME="eth2"
    SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="38:4c:4f:89:55:8e", NAME="eth3"

    Después de la modificación, guarde el cambio y salga.

  4. Ejecute el siguiente comando para comprobar la dirección IP de la NIC:

    ifconfig

    Se muestra la información similar a la siguiente, donde bond0 y bond0.313 muestran las direcciones IP de la NIC asignadas automáticamente por el sistema al solicitar el BMS:

    bond0     Link encap:Ethernet  HWaddr FA:16:3E:3D:1C:E0  
              inet addr:10.0.1.2  Bcast:10.0.1.255  Mask:255.255.255.0
              inet6 addr: fe80::f816:3eff:fe3d:1ce0/64 Scope:Link
              UP BROADCAST RUNNING MASTER MULTICAST  MTU:8888  Metric:1
              RX packets:852 errors:0 dropped:160 overruns:0 frame:0
              TX packets:1121 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:0 
              RX bytes:125429 (122.4 Kb)  TX bytes:107221 (104.7 Kb)
    
    bond0.313 Link encap:Ethernet  HWaddr FA:16:3E:57:87:6E  
              inet addr:10.0.3.2  Bcast:10.0.3.255  Mask:255.255.255.0
              inet6 addr: fe80::f816:3eff:fe57:876e/64 Scope:Link
              UP BROADCAST RUNNING MULTICAST  MTU:8888  Metric:1
              RX packets:169 errors:0 dropped:0 overruns:0 frame:0
              TX packets:13 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:0 
              RX bytes:8684 (8.4 Kb)  TX bytes:1696 (1.6 Kb)
    
    eth0      Link encap:Ethernet  HWaddr FA:16:3E:3D:1C:E0  
              UP BROADCAST RUNNING SLAVE MULTICAST  MTU:8888  Metric:1
              RX packets:428 errors:0 dropped:10 overruns:0 frame:0
              TX packets:547 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:1000 
              RX bytes:64670 (63.1 Kb)  TX bytes:50132 (48.9 Kb)
    
    eth1      Link encap:Ethernet  HWaddr FA:16:3E:3D:1C:E0  
              UP BROADCAST RUNNING SLAVE MULTICAST  MTU:8888  Metric:1
              RX packets:424 errors:0 dropped:7 overruns:0 frame:0
              TX packets:574 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:1000 
              RX bytes:60759 (59.3 Kb)  TX bytes:57089 (55.7 Kb)
    
    lo        Link encap:Local Loopback  
              inet addr:127.0.0.1  Mask:255.0.0.0
              inet6 addr: ::1/128 Scope:Host
              UP LOOPBACK RUNNING  MTU:65536  Metric:1
              RX packets:8 errors:0 dropped:0 overruns:0 frame:0
              TX packets:8 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:0 
              RX bytes:520 (520.0 b)  TX bytes:520 (520.0 b)

  5. Ejecute los siguientes comandos para comprobar los nombres de las NIC enlazadas:

    Las NIC enlazadas en servicio no se pueden utilizar en el plano de comunicación interno. Por lo tanto, debe obtenerlos por su nombre.

    cd /etc/sysconfig/network

    vi ifcfg-bond0

    Se muestra la información similar a la siguiente, donde bond0 está compuesto por las NIC eth0 y eth1:

    BONDING_MASTER=yes
    TYPE=Bond
    STARTMODE=auto
    BONDING_MODULE_OPTS="mode=4 xmit_hash_policy=layer3+4 miimon=100"
    NM_CONTROLLED=no
    BOOTPROTO=dhcp
    DEVICE=bond0
    USERCONTRL=no
    LLADDR=fa:16:3e:3d:1c:e0
    BONDING_SLAVE1=eth1
    BONDING_SLAVE0=eth0

    Después de la consulta, salga.

  6. Ejecute los siguientes comandos para comprobar los estados de todas las NIC:

    ip link

    Se muestra la información similar a la siguiente.

    1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default 
        link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    2: eth0: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 8888 qdisc mq master bond0 state UP mode DEFAULT group default qlen 1000
        link/ether fa:16:3e:3d:1c:e0 brd ff:ff:ff:ff:ff:ff
    3: eth1: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 8888 qdisc mq master bond0 state UP mode DEFAULT group default qlen 1000
        link/ether fa:16:3e:3d:1c:e0 brd ff:ff:ff:ff:ff:ff
    4: eth2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state DOWN mode DEFAULT group default qlen 1000
        link/ether 38:4c:4f:89:55:8d brd ff:ff:ff:ff:ff:ff
    5: eth3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state DOWN mode DEFAULT group default qlen 1000
        link/ether 38:4c:4f:89:55:8e brd ff:ff:ff:ff:ff:ff
    6: bond0: <BROADCAST,MULTICAST,MASTER,UP,LOWER_UP> mtu 8888 qdisc noqueue state UP mode DEFAULT group default 
        link/ether fa:16:3e:3d:1c:e0 brd ff:ff:ff:ff:ff:ff
    7: bond0.3133@bond0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 8888 qdisc noqueue state UP mode DEFAULT group default 
        link/ether fa:16:3e:57:87:6e brd ff:ff:ff:ff:ff:ff

  7. Ejecute los siguientes comandos para cambiar el estado de la NIC qdisc mq state DOWN a qdisc mq state UP. Los siguientes comandos usan las NIC eth2 y eth3 como ejemplos.

    ip link set eth2 up

    ip link set eth3 up

  8. Run the following commands to check the statuses of all NICs:

    ip link

    Information similar to the following is displayed.

    1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default 
        link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    2: eth0: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 8888 qdisc mq master bond0 state UP mode DEFAULT group default qlen 1000
        link/ether fa:16:3e:3d:1c:e0 brd ff:ff:ff:ff:ff:ff
    3: eth1: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 8888 qdisc mq master bond0 state UP mode DEFAULT group default qlen 1000
        link/ether fa:16:3e:3d:1c:e0 brd ff:ff:ff:ff:ff:ff
    4: eth2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DEFAULT group default qlen 1000
        link/ether 38:4c:4f:89:55:8d brd ff:ff:ff:ff:ff:ff
    5: eth3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DEFAULT group default qlen 1000
        link/ether 38:4c:4f:89:55:8e brd ff:ff:ff:ff:ff:ff
    6: bond0: <BROADCAST,MULTICAST,MASTER,UP,LOWER_UP> mtu 8888 qdisc noqueue state UP mode DEFAULT group default 
        link/ether fa:16:3e:3d:1c:e0 brd ff:ff:ff:ff:ff:ff
    7: bond0.3133@bond0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 8888 qdisc noqueue state UP mode DEFAULT group default 
        link/ether fa:16:3e:57:87:6e brd ff:ff:ff:ff:ff:ff

  9. Compruebe los estados de las NIC de 8 y obtenga los nombres de las NIC en estado de qdisc mq state UP.

    Solo se pueden vincular las NIC que están en estado qdisc mq state UP y no se han utilizado. En este ejemplo, tales NIC son eth2 y eth3.

    Los valores LLADR de las NIC eth2 y eth3 son 38:4c:4f:89:55:8d y 38:4c:4f:89:55:8e respectivamente.

  10. Ejecute los siguientes comandos para crear los archivos de configuración de las NIC eth2 y eth3:

    Puede copiar un archivo de configuración de NIC existente y modificarlo para mejorar la eficiencia de la creación.

    cp ifcfg-eth0 ifcfg-eth2

    cp ifcfg-eth1 ifcfg-eth3

  11. Ejecute los siguientes comandos para modificar los archivos de configuración de las NIC eth2 y eth3:

    vi ifcfg-eth2

    vi ifcfg-eth3

    El archivo de configuración modificado de la NIC eth2 es el siguiente.

    En este archivo de configuración, establezca MTU en 8888, BOOTPROTO en STATIC y configure DEVICE y LLADDR según sea necesario.

    STARTMODE=auto
    MTU=8888
    NM_CONTROLLED=no
    BOOTPROTO=STATIC
    DEVICE=eth2
    USERCONTRL=no
    LLADDR=38:4c:4f:89:55:8d
    TYPE=Ethernet

    El archivo de configuración modificado de la NIC eth3 es el siguiente:

    STARTMODE=auto
    MTU=8888
    NM_CONTROLLED=no
    BOOTPROTO=STATIC
    DEVICE=eth3
    USERCONTRL=no
    LLADDR=38:4c:4f:89:55:8e
    TYPE=Ethernet

    Después de la modificación, guarde el cambio y salga.

  12. Ejecute el siguiente comando para vincular las NIC eth2 y eth3 a una NIC, por ejemplo, bond1:

    Ejecute los siguientes comandos para crear el archivo ifcfg-bond1 y modificar el archivo de configuración:

    cp ifcfg-bond0 ifcfg-bond1

    vi ifcfg-bond1

    El archivo de configuración modificado de la NIC bond1 es el siguiente.

    En este archivo de configuración, MTU se establece en 8888, BONDING_MODULE_OPTS se establece en mode=1 miimon=100, BOOTPROTO se establece en STATIC. DEVICE, BONDING_SLAVE1, BONDING_SLAVE0, IPADDR, NETMASK y NETWORK se configuran según sea necesario. LLADDR se establece en el valor LLADDR de la NIC BONDING_SLAVE1.

    BONDING_MASTER=yes
    TYPE=Bond
    MTU=8888
    STARTMODE=auto
    BONDING_MODULE_OPTS="mode=1 miimon=100"
    NM_CONTROLLED=no
    BOOTPROTO=STATIC
    DEVICE=bond1
    USERCONTRL=no
    LLADDR=38:4c:4f:89:55:8d
    BONDING_SLAVE1=eth2
    BONDING_SLAVE0=eth3
    IPADDR=10.0.2.2
    NETMASK=255.255.255.0
    NETWORK=10.0.2.0

    Después de la modificación, guarde el cambio y salga.

  13. Haga que el archivo de configuración tenga efecto.

    1. Ejecute los siguientes comandos para crear un directorio temporal y copiar el archivo de configuración de NIC en este directorio:

      mkdir /opt/tmp/

      mkdir /opt/tmp/xml

      cp /etc/sysconfig/network/ifcfg* /opt/tmp/

      cp /etc/sysconfig/network/config /opt/tmp/

      cp /etc/sysconfig/network/dhcp /opt/tmp/

    2. Ejecute los siguientes comandos para detener las NIC para formar bond1:

      ip link set eth2 down

      ip link set eth3 down

    3. Ejecute el siguiente comando para convertir el archivo de configuración de NIC en un archivo de configuración que pueda ser reconocido por el SO:

      /usr/sbin/wicked --log-target=stderr --log-level=debug3 --debug all convert --output /opt/tmp/xml /opt/tmp/

    4. Ejecute los siguientes comandos para reiniciar las NIC para formar bond1:

      ip link set eth2 up

      /usr/sbin/wicked --log-target=stderr --log-level=debug3 --debug all ifup --ifconfig /opt/tmp/xml/eth2.xml eth2

      ip link set eth3 up

      /usr/sbin/wicked --log-target=stderr --log-level=debug3 --debug all ifup --ifconfig /opt/tmp/xml/eth3.xml eth3

      /usr/sbin/wicked --log-target=stderr --log-level=debug3 --debug all ifup --ifconfig /opt/tmp/xml/bond1.xml bond1

  14. Ejecute el siguiente comando para consultar las direcciones IP:

    ip addr show

    Un ejemplo es el siguiente:

    1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default 
        link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
        inet 127.0.0.1/8 scope host lo
           valid_lft forever preferred_lft forever
        inet6 ::1/128 scope host 
           valid_lft forever preferred_lft forever
    2: eth0: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 8888 qdisc mq master bond0 state UP group default qlen 1000
        link/ether fa:16:3e:3d:1c:e0 brd ff:ff:ff:ff:ff:ff
    3: eth1: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 8888 qdisc mq master bond0 state UP group default qlen 1000
        link/ether fa:16:3e:3d:1c:e0 brd ff:ff:ff:ff:ff:ff
    4: eth2: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 8888 qdisc mq master bond1 state UP group default qlen 1000
        link/ether 38:4c:4f:89:55:8d brd ff:ff:ff:ff:ff:ff
    5: eth3: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 8888 qdisc mq master bond1 state UP group default qlen 1000
        link/ether 38:4c:4f:89:55:8d brd ff:ff:ff:ff:ff:ff
    6: bond0: <BROADCAST,MULTICAST,MASTER,UP,LOWER_UP> mtu 8888 qdisc noqueue state UP group default 
        link/ether fa:16:3e:3d:1c:e0 brd ff:ff:ff:ff:ff:ff
        inet 10.0.1.2/24 brd 10.0.1.255 scope global bond0
           valid_lft forever preferred_lft forever
        inet6 fe80::f816:3eff:fe3d:1ce0/64 scope link 
           valid_lft forever preferred_lft forever
    7: bond0.3133@bond0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 8888 qdisc noqueue state UP group default 
        link/ether fa:16:3e:57:87:6e brd ff:ff:ff:ff:ff:ff
        inet 10.0.3.2/24 brd 10.0.2.255 scope global bond0.3133
           valid_lft forever preferred_lft forever
        inet6 fe80::f816:3eff:fe57:876e/64 scope link 
           valid_lft forever preferred_lft forever
    8: bond1: <BROADCAST,MULTICAST,MASTER,UP,LOWER_UP> mtu 8888 qdisc noqueue state UP group default 
        link/ether 38:4c:4f:89:55:8d brd ff:ff:ff:ff:ff:ff
        inet 10.0.2.2/24 brd 10.0.2.255 scope global bond1
           valid_lft forever preferred_lft forever
        inet6 fe80::3a4c:4fff:fe29:b36/64 scope link 
           valid_lft forever preferred_lft forever

  15. Ejecute los siguientes comandos para eliminar el directorio temporal:

    cd /opt

    rm -rf tmp/

  16. Repita las operaciones anteriores para configurar otros BMS.

Utilizamos cookies para mejorar nuestro sitio y tu experiencia. Al continuar navegando en nuestro sitio, tú aceptas nuestra política de cookies. Descubre más

Comentarios

Comentarios

Comentarios

0/500

Seleccionar contenido

Enviar el contenido seleccionado con los comentarios