Coder Social home page Coder Social logo

bridged-networking-kvm's Introduction

Setting up network bridge in Fedora 40 for VMs without modifying your system's network configuration.

Use case: Make VM accessible on the network. I wanted to achieve this to use Windows VM as Sunshine host to stream games on local network.

Create a network bridge interface

sudo nmcli connection add type bridge ifname br0

Bring it online

sudo nmcli connection modify bridge-br0 ipv4.method auto

sudo nmcli connection up bridge-br0

Attach network card to that bridge

sudo nmcli connection modify "Wired connection 1" master bridge-br0

sudo nmcli connection up "Wired connection 1"

(change Wired connection 1 with name of yours, use 'nmcli connection show' to check your network card name)

Run DHCP client on Bridge

dhclient br0

Now guest VM can be attached to the br0 interface and VM's MAC address will have a real layer2 presence on the local network. The router will give it a real rechable IP address and the desktop will act as a switch for packet delivery.

Now to mannually set up networking for KVM VM using QEMU using TAP (network tap) interface and adding it to a bridge which allows VM to communicate with the host network. The following commands set up this environment without using automatic scrips.

Manually create TAP interface

sudo ip tuntap add dev tap0 mode tap

Add TAP interface to the bridge

sudo ip link set tap0 master br0

Bring up the TAP interface

sudo ip link set tap0 up

Configure networking in Virt-Manager

Add NIC

Set 'Source device' to bridge

Type in the name of the bridge device as 'br0'

Set device model to virtio for better performance

Apply changes and boot to the VM

Thanks to this reddit user!. I modified his steps for Fedora.

bridged-networking-kvm's People

Contributors

hit360d avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.