El contenido no se encuentra disponible en el idioma seleccionado. Estamos trabajando continuamente para agregar más idiomas. Gracias por su apoyo.

Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
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
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
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
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Situation Awareness
Managed Threat Detection
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
SoftWare Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
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
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive
On this page

Show all

Help Center/ Bare Metal Server/ User Guide/ Network/ User-defined VLAN/ Configuring a User-defined VLAN (Red Hat, CentOS, Oracle Linux, and EulerOS)

Configuring a User-defined VLAN (Red Hat, CentOS, Oracle Linux, and EulerOS)

Updated on 2022-09-16 GMT+08:00

This section uses CentOS 6.8 (x86_64) as an example to describe how to configure a user-defined VLAN for BMSs.

NOTE:

The configuration methods of Red Hat, Oracle Linux, EulerOS, and CentOS are similar.

  1. Use a key or password to log in to the BMS as user root.
  2. On the BMS CLI, run the following command to check the NIC information:

    ip link

    Information similar to the following is displayed.

    NOTE:

    Among the devices, eth0 and eth1 bear the VPC, and eth3 and eth5 bear the user-defined VLAN.

  3. Run the following command to check whether the /etc/udev/rules.d/ directory contains the 80-persistent-net.rules file:

    ll /etc/udev/rules.d/ | grep 80-persistent-net.rules

    • If yes, and the file contains all NICs except bond0 and lo obtained in step 2 and their MAC addresses, go to step 6.
    • If no, go to step 4.

  4. Run the following command to copy the /etc/udev/rules.d/70-persistent-net.rules file and name the copy as /etc/udev/rules.d/80-persistent-net.rules.

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

  5. Configure the udev rules:

    Write the MAC addresses and names of NICs except eth0 and eth1 obtained in step 2 (those not contained in the /etc/udev/rules.d/70-persistent-net.rules file) to the /etc/udev/rules.d/80-persistent-net.rules file so that the names and sequence of NICs do not change after the BMS is restarted.

    NOTE:

    Ensure that the NIC MAC address and name are lowercase letters.

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

    The modification result is as follows:

    After the modification, press Esc, enter :wq, save the configuration, and exit.

  6. Run the following commands to copy the network configuration file /etc/sysconfig/network-scripts/ifcfg-bond0 to generate the /etc/sysconfig/network-scripts/ifcfg-bond1 file, and copy the /etc/sysconfig/network-scripts/ifcfg-eth0 file to generate the /etc/sysconfig/network-scripts/ifcfg-eth3 and /etc/sysconfig/network/ ifcfg-eth5 files:

    cp -p /etc/sysconfig/network-scripts/ifcfg-bond0 /etc/sysconfig/network-scripts/ifcfg-bond1

    cp -p /etc/sysconfig/network-scripts/ifcfg-eth0 /etc/sysconfig/network-scripts/ifcfg-eth3

    cp -p /etc/sysconfig/network-scripts/ifcfg-eth0 /etc/sysconfig/network-scripts/ifcfg-eth5

  7. Run the following commands to edit the /etc/sysconfig/network-scripts/ifcfg-eth3 and /etc/sysconfig/network-scripts/ifcfg-eth5 files:

    • vim /etc/sysconfig/network-scripts/ifcfg-eth3

      Edit the eth3 network configuration file as follows:

      USERCTL=no
      MTU=8888
      NM_CONTROLLED=no
      BOOTPROTO=static
      DEVICE=eth3
      TYPE=Ethernet
      ONBOOT=yes
      MASTER=bond1
      SLAVE=yes

      Change the value of BOOTPROTO to static, that of DEVICE to the network device name eth3, and that of MASTER to the port name of the user-defined VLAN (bond1). Retain values of other parameters.

    • vim /etc/sysconfig/network-scripts/ifcfg-eth5

      Edit the eth5 network configuration file as follows (similar to eth3):

      USERCTL=no
      MTU=8888
      NM_CONTROLLED=no
      BOOTPROTO=static
      DEVICE=eth5
      TYPE=Ethernet
      ONBOOT=yes
      MASTER=bond1
      SLAVE=yes

  8. Run the following command to edit the /etc/sysconfig/network-scripts/ifcfg-bond1 file:

    vim /etc/sysconfig/network-scripts/ifcfg-bond1

    Edit the file as follows:

    MACADDR=f4:4c:7f:3f:da:07
    BONDING_MASTER=yes
    USERCTL=no
    ONBOOT=yes
    NM_CONTROLLED=no
    BOOTPROTO=static
    BONDING_OPTS="mode=1 miimon=100"
    DEVICE=bond1
    TYPE=Bond
    IPADDR=10.10.10.3
    NETMASK=255.255.255.0
    MTU=8888

    Where,

    • Change the value of MACADDR to the MAC address of eth3 or eth5.
    • Change the value of BOOTPROTO to static.
    • Change the value of DEVICE to bond1.
    • Change the value of IPADDR to the IP address to be allocated to bond1. If the IP address planned for the user-defined VLAN does not conflict with the VPC network segment, you can plan the IP address as needed, only to ensure that BMSs communicating through the user-defined VLAN are in the same network segment as the user-defined VLAN. An example value is 10.10.10.3.
    • Set the value of NETMASK to the subnet mask of the IP address configured for bond1.

    Retain values of other parameters.

    After the modification, press Esc, enter :wq, save the configuration, and exit.

  9. Run the following command to enable port group bond1 of the user-defined VLAN:

    ifup bond1

    Determining if ip address 10.10.10.3 is already in use for device bond1...

  10. Perform the preceding operations to configure other BMSs.
  11. After all BMSs are configured, ping the IP addresses of other BMSs from each 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

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback