KVM网络配置(一)—— qemu命令行网络相关参数详解

本文详细介绍了QEMU中虚拟网卡的配置,包括支持的网卡类型,如通过`-net nic,model=?`查询的各类网卡模型。重点讲解了QEMU的`-netdev`和`-device`参数,特别是在bridge模式下配置网络环境的使用,如`-device virtio-net-pci,netdev=vnet0 -netdev tap,id=vnet0,script=no`。此外,文章强调了virtio-net-pci设备的优势,它是通过virtio半虚拟化提供高性能I/O,并且列举了与之相比,e1000设备配置参数的不足。" 86621699,8314136,Ceph源码调试与开发环境配置指南,"['Ceph开发', '开源存储', '软件调试', '系统工具', '分布式系统']
摘要由CSDN通过智能技术生成

 

QEMU 支持的网卡类型

QEMU 提供了对一系列主流和兼容性良好的网卡的模型,通过 “-net nic,model=?” 参数可以查询到当前的 QEMU 工具实现了哪些网卡的模拟。

如下:

[root@localhost ~]# /usr/libexec/qemu-kvm --version
QEMU emulator version 2.12.0 (qemu-kvm-ev-2.12.0-44.1.el7_8.1)
Copyright (c) 2003-2017 Fabrice Bellard and the QEMU Project developers
[root@localhost ~]# 
[root@localhost ~]# /usr/libexec/qemu-kvm -net nic,model=?
qemu: Supported NIC models: e1000,e1000-82540em,e1000e,rtl8139,virtio-net-pci
[root@localhost ~]# 

 

QEMU “-netdev” 参数

在 qemu 命令行中,关于配置 bridge 模式的网络环境参数如下:

-netdev tap,id=str[,fd=h][,fds=x:y:...:z][,ifname=name][,script=file][,downscript=dfile]
         [,br=bridge][,helper=helper][,sndbuf=nbytes][,vnet_hdr=on|off][,vhost=on|off]
         [,vhostfd=h][,vhostfds=x:y:...:z][,vhostforce=on|off][,queues=n]
         [,poll-us=n]
                configure a host TAP network backend with ID 'str'
                connected to a bridge (default=br0)
                use network scripts 'file' (default=/etc/qemu-ifup)
                to configure it and 'dfile' (default=/etc/qemu-ifdown)
                to deconfigure it
                use '[down]script=no' to disable script execution
                use network helper 'helper' (default=/usr/libexec/qemu-bridge-helper) to
                configure it
                use 'fd=h' to connect to an already 
  • 1
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值