Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to configure virtual switch by centos7

2025-01-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

Editor to share with you how to configure the virtual switch centos7, I believe that most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!

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

Create 4 virtual machines using virt-manager

After starting the virtual machine, the logical network port vnet0,vnet1,vnet2,vnet4 produced by the virtual machine is added to different vlan.

Brctl addif br10 vnet0,vnet1

Brctl addif br20 vnet2,vnet3

Enter 4 virtual machines to configure ip

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

The vnet0 and vnet1 ip under br10 are 192.168.10.30 and 192.168.10.99, respectively.

The vnet2 and vnet3 ip scores under br20 are 192.168.10.40 and 192.168.10.101

Vnet0 and vnet1 can communicate with each other through ping

Vnet2 and vnet3 can communicate with each other through ping

Vnet0 and vnet2 cannot communicate with each other through ping.

Vnet1 and vnet3 cannot communicate with each other through ping.

You want the same configuration on another virtual machine with kvm, but you can modify the ip.

The two physical machines are then connected to the interface of the real switch.

The switch is configured 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 ports (COM and LPT) in the device Manager of windows

two。 Start HyperTerminal (nok)

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

File-New connection

The parameters are set as follows

Serial port: COM3

Baud rate: 9600

Data bits: 8bits

Check bit: 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

Configure Port 3

System-view

Int g0/0/3

Port link-type trunk

Port trunk allow-pass vlan all

Configure Port 4

System-view

Int g0/0/4

Port link-type trunk

Port trunk allow-pass vlan all

5. Create as many vlan as you can. Here is to create vlan10 and vlan20.

[Quidway] vlan 10

[Quidway-Vlan10] quit

[Quidway] vlan 20

[Quidway-Vlan20] quit

These are all the contents of the article "how to configure a virtual switch in centos7". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 223

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report