KVM网络配置

红米2年前技术文章866

一、创建桥接网络

1、创建桥接网卡br0(相当于vmnet1桥接器)

cd /etc/sysconfig/network-scripts/
cp ifcfg-ens33 ifcfg-br0

2、修改br0参数

image.png

 3、修改ens33参数

image.png

 4、重启宿主机网络服务,查看ip

image.png

 5、查看当前桥接情况

brctl show
image.png

 6、将虚拟机接口桥接到桥接器

image.png

  • 或者编辑配置文件

image.png
image.png
image.png

 7、查看验证

image.png

二、创建自定义NET网络 

 1、创建自定义define网络

image.png

 2、编辑define网络配置文件

image.png

 3、加载自定义网络配置文件

image.png

 4、启动自定义网络配置

image.png

 5、设置自定义网络配置文件自启动

image.png

  6、查看当前连接情况

image.png

 7、在kvm虚拟机上配置

image.png

 8、虚拟机查看验证

image.png

三、使用linux bridge配置vlan隔离

1、epel源安装vconfig

image.png

2、加载802.1q模块来支持vlan

image.png

3、创建两个vlan

image.png

4、创建两个网桥

image.png

5、指定网桥ip地址

image.png

6、连接网桥和vlan

image.png

8、添加虚拟机到vlan

image.png

  • 或者使用命令

brctl delif virbr0 vnet0
brctl addif br100 vnet0

8、设置虚拟机ip(10.10,10.20属于vlan100、10.110,10.120属于vlan200)

image.png

9、访问测试

image.png


相关文章

理解YAML文件

YAML 基础它的基本语法规则如下:大小写敏感使用缩进表示层级关系缩进时不允许使用Tab键,只允许使用空格。缩进的空格数目不重要,只要相同层级的元素左侧对齐即可# 表示注释,从这个字符一直到行尾,都会...

在K8S上使用Clickhouse

介绍clickhouse是一款开源的分析型数据库,性能强大。本文介绍如何在K8S环境中部署和使用clickhouse。我们使用开源的clickhouse operator: https://githu...

trino容器设置nodeselector(七)

trino容器设置nodeselector(七)

查看node labelkubectl get nodes --show-labels2、在容器中设置nodeselector属性  nodeSelector:     dps: "1"查看k8s...

Trino部署

安装前准备1.1. 创建用户和用户组groupadd trinouseradd -g hadoop trino1.2. 配置环境变量1.2.1. 配置系统环境变量/etc/profileexport...

Prometheus结合VictoriaMetrics:更高效、稳定的多集群监控方案

在Prometheus的架构中,其核心组件包括Prometheus Server、Exporters、Alertmanager等,它采用基于拉的模型收集指标数据,并存储在本地TSDB中,支持通过Pro...

发表评论    

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。