KVM network vlan

本文详细探讨了KVM虚拟化环境中如何配置网络,并重点介绍了VLAN的使用,包括设置VLAN接口、隔离不同VLAN间的流量以及优化网络性能等方面,旨在帮助读者更好地理解和管理KVM虚拟机的网络环境。
摘要由CSDN通过智能技术生成




[root@localhost ~]# 
[root@localhost ~]# ifconfig 
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 10.2.5.181  netmask 255.255.255.0  broadcast 10.2.5.255
        inet6 fe80::5054:ff:fe98:e17e  prefixlen 64  scopeid 0x20<link>
        ether 52:54:00:98:e1:7e  txqueuelen 1000  (Ethernet)
        RX packets 86967904  bytes 61065855943 (56.8 GiB)
        RX errors 0  dropped 46  overruns 0  frame 0
        TX packets 5052886  bytes 2188249614 (2.0 GiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 196161  bytes 51961541 (49.5 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 196161  bytes 51961541 (49.5 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

virbr0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        inet 192.168.122.1  netmask 255.255.255.0  broadcast 192.168.122.255
        ether 52:54:00:0b:1b:7b  txqueuelen 1000  (Ethernet)
        RX packets 4277155  bytes 12869552776 (11.9 GiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 3461117  bytes 13566708939 (12.6 GiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

virbr2: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.100.1  netmask 255.255.255.0  broadcast 192.168.100.255
        inet6 fe80::d094:14ff:fe46:fb4f  prefixlen 64  scopeid 0x20<link>
        ether d2:94:14:46:fb:4f  txqueuelen 1000  (Ethernet)
        RX packets 224  bytes 26192 (25.5 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 141  bytes 15433 (15.0 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

[root@localhost ~]# 
[root@localhost ~]# ovs-vsctl show
90a0e0df-7785-4ba0-9042-b971b76dd96e
    Bridge "virbr2"
        Port "virbr2"
            Interface "virbr2"
                type: internal
    ovs_version: "2.12.0"
[root@localhost ~]# 
[root@localhost ~]# 
[root@localhost ~]# 
[root@localhost ~]# ip link add link virbr0 name virbr0.10 type vlan id 10
[root@localhost ~]# ifconfig -a
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 10.2.5.181  netmask 255.255.255.0  broadcast 10.2.5.255
        inet6 fe80::5054:ff:fe98:e17e  prefixlen 64  scopeid 0x20<link>
        ether 52:54:00:98:e1:7e  txqueuelen 1000  (Ethernet)
        RX packets 86968178  bytes 61065879085 (56.8 GiB)
        RX errors 0  dropped 46  overruns 0  frame 0
        TX packets 5052931  bytes 2188256592 (2.0 GiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 196161  bytes 51961541 (49.5 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 196161  bytes 51961541 (49.5 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

ovs-system: flags=4098<BROADCAST,MULTICAST>  mtu 1500
        ether 56:a8:e8:e4:76:33  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

virbr0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        inet 192.168.122.1  netmask 255.255.255.0  broadcast 192.168.122.255
        ether 52:54:00:0b:1b:7b  txqueuelen 1000  (Ethernet)
        RX packets 4277155  bytes 12869552776 (11.9 GiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 3461117  bytes 13566708939 (12.6 GiB)
      
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值