Home >System Tutorial >LINUX >CentOS 7 Virtual Switch Configuration Guide

CentOS 7 Virtual Switch Configuration Guide

WBOY
WBOYforward
2024-01-05 19:37:491097browse

Virtual switch configuration

inux VLAN configuration (vconfig)

Install vlan (vconfig) and load 8021q module

[root@test0001~]#yum install vconfig

[root@test0001~]#modprobe 8021q

[root@test0001~]#lsmod |grep -i 8021q

Use the linux vconfig command to configure vlan

[root@test0001~]#vconfig add eth0 10

Added VLAN with VID == 10 to IF -:eth0:-

[root@test0001~]#vconfig add eth0 20

Added VLAN with VID == 20 to IF -:eth0:-

Create two bridges

brctl addbr br10

brctl addbr br20

ifconfig br10 up

ifconfig br20 up

Link Bridge and VLAN

brctl addif br10 eth0.10

brctl addif br10 eth0.20

Use virt-manager to create 4 virtual machines

After starting the virtual machine, add the logical network ports vnet0, vnet1, vnet2, and vnet4 produced by the virtual machine to different vlans.

brctl addif br10 vnet0,vnet1

brctl addif br20 vnet2, vnet3

Enter 4 virtual machines respectively and configure ip

There are two hosts under the two network segments br10 and br20 respectively

br10 The following vnet0 and vnet1 ips are 192.168.10.30 and 192.168.10.99 respectively

br20 The following vnet2 and vnet3 IPs are 192.168.10.40 and 192.168.10.101

vnet0 and vnet1 can ping each other

Vnet2 and vnet3 can ping each other

vnet0 and vnet2 cannot ping each other

vnet1 and vnet3 cannot ping each other

If you want to configure the same configuration on another virtual machine with kvm installed, just change the IP address

Then the two physical machines are connected to the interfaces of the real switch.

The switch configuration is as follows:

1. Install the driver first

D:\DIBIT\Company\Huawei S5700S-28P-LI-AC\Driver\Huawei S5700 Series Switch Switch-MiniUSB-driver.002 Console Software\TI_WDF_USBUART_SINGLE_DRIVER_V6.7.2.0_WHQL. If the installation is successful, you can see a TUSB3410 Device (COM3)

under the port (COM and LPT) in the Windows Device Manager.

2. Start HyperTerminal(nok)

D:\Software\Windows\xpzhongduan\HyperTerminal(ok)

File-New Connection

The parameter settings are as follows

Serial port: COM3

Baud rate: 9600

Data bits: 8bits

Check digit: None

Stop bit: 1 bit

Flow control: None

                                                                                                                                                                                                                                                                            Transmit Delay(char): 0

Transmit Delay(line): 0

3. Press Enter and enter the password cisco123

4. Configure switch port

Configuring port 3

system-view

int g0/0/3

           port link-type trunk

          port trunk allow-pass vlan all

                  Configuring port 4

system-view

int g0/0/4

            port link-type trunk

            port trunk allow-pass vlan all

5. Create as many vlans as there are. Here are vlan10 and vlan20

[Quidway] vlan 10

[Quidway-Vlan10] quit

[Quidway] vlan 20

[Quidway-Vlan20] quit

The above is the detailed content of CentOS 7 Virtual Switch Configuration Guide. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:jb51.net. If there is any infringement, please contact admin@php.cn delete