QEMU - Setting Up Network Bridge (Linux)

Поделиться
HTML-код
  • Опубликовано: 20 окт 2024

Комментарии • 40

  • @ArandomNutter
    @ArandomNutter 2 года назад

    My good sir thank you very much for this video, I had the bridge setup however I didn't know the correct syntax for the VM's network options

  • @artyomgevorgyan7167
    @artyomgevorgyan7167 4 года назад +1

    You are very helpful! But what if I only have one Ethernet interface and it is used for connection to the outside world, and I want to enslave it to be controlled by the bridge? In this case I think the bridge will also need to be assigned IP address, right?

  • @RockRider2k
    @RockRider2k 2 года назад

    Is it possible to have VM right in the network without having root permissions? It seems both "bridged" and "tap" approach requires rooting. What about "socket"?

  • @alexwagner2250
    @alexwagner2250 Год назад

    I followed your tutorial and set up a FreeBSD guest. At startup of my VM the tap0 device is correctly created. But I do not get a valid ip-address within the guest. Maybe dhcp is not working? Do you have a idea what could be the problem? Thanks!

  • @apurvanandan6334
    @apurvanandan6334 4 года назад

    Very informative video! Thanks

  • @cod06
    @cod06 8 месяцев назад

    Good job, bro.

  • @srdjanmarjanovic
    @srdjanmarjanovic 3 года назад

    Thanks for the great video, lots of usefull info! Could you please elaborate why you only suggested using kvm if we have Intel CPU? Wouldn't AMD Ryzen series be any good for the kvm virtualization?

  • @SpeedoJoe
    @SpeedoJoe 7 лет назад +2

    hey. Which terminal are you using, that allows visual tabbing like that?

    • @KeithHendersonJr
      @KeithHendersonJr  7 лет назад

      I use urxvt, but the "visual tabs" are from tmux

    • @Mr_NeRF
      @Mr_NeRF 7 лет назад

      Are you using a tmux plugin or how do you setup the "visual tab completion"?

    • @KeithHendersonJr
      @KeithHendersonJr  7 лет назад

      Here's my .tmux.conf file: gist.github.com/GhostSquad57/b706d0c21a2623f9f4a9adf03ac18506
      The relevant lines for the "visual tabs" (you may want to adjust it to fit your color scheme)
      # status options
      set -g status "on"
      set -g set-titles on # enable wm window titles
      set -g set-titles-string "tmux:#I [ #W ]" # wm window title string (uses statusbar variables)
      set-window-option -g automatic-rename "on" # auto window rename
      set -g status-interval 5 # interval for status to refresh
      set -g status-justify centre # center align window list
      set -g status-left-length 40 # character limit on left status line
      set -g status-right-length 140 # character limit on right status line
      set -g status-left "#[fg=cyan]$USER@#[fg=yellow]#H"
      set -g status-right '%Y-%m-%d %I:%M:%S %p'
      set -g status-position bottom # put statuls line on bottom
      set -g window-status-format '#[fg=green,dim]#I: #W'
      set -g window-status-current-format '#[fg=white,bold] [#I: #W] '
      set-window-option -g window-status-current-fg white
      set-window-option -g window-status-separator " "

    • @SpeedoJoe
      @SpeedoJoe 7 лет назад

      I'm curious, should they be called something other than " "visual tabs" " ?

    • @KeithHendersonJr
      @KeithHendersonJr  7 лет назад

      Tmux refers to them as "window titles"

  • @themistoclesnelson2163
    @themistoclesnelson2163 Год назад

    Thanks!

  • @BadCodePT
    @BadCodePT 6 лет назад

    Thanks for the video really informative enough to play around with.... I have a question, is it possible to define a static IP/Gateway before installing the Operating System? thanks for the response.

  • @henninb
    @henninb 5 лет назад

    This video is helpful. I am running archlinix and it works great. I get a new iPhone address for the bridge interface and all looks fine, I am however having one issue. I cannot ssh to the newly bridge up address as I would expect to. Do I need to do any iptables changes? Thx

  • @Woutermans
    @Woutermans 6 лет назад

    When I try to launch the VM I get this error, do you know how to fix this?
    failed to parse default acl file `/etc/qemu/bridge.conf'
    qemu-system-i386: -net bridge,br=br0: bridge helper failed

  • @chmoduk
    @chmoduk 3 года назад

    For qemu I attach the emulated net device to a vlan so I can decide which virtual lan I want to be in. I would set up a bridge and put the created vlan into that bridge. This created bridge is unmanaged and I get my ip from my main dhcp server that is setup with multiple networks.

  • @ahmad53135
    @ahmad53135 5 лет назад

    Hey, I tried it several times but I got 169.254.62.131 address. I am trying to simulate a Raspberry Pi on Linux using qemu-system-arm. Do you have any idea what the problem is?

    • @debasissahoo2411
      @debasissahoo2411 4 года назад

      can you please say how to communicate between my host linux and guest raspberry-pi & vice-versa

  • @Archangel10123
    @Archangel10123 7 лет назад

    Could you please explain further why the updated @20:34 failed? It looks like your bridged VM is unable to connect to the internet--which happens to be the problem i'm experiencing now.

    • @KeithHendersonJr
      @KeithHendersonJr  7 лет назад

      I forgot to mention firewall rules needed to be added to allow traffic from the VM to go through the host.
      The gentoo wiki has a good guide on this: wiki.gentoo.org/wiki/QEMU#Host_configuration
      I also recommend creating the tun/tap interface manually instead of using the QEMU bridge helper which can be unreliable

    • @Archangel10123
      @Archangel10123 7 лет назад

      Is it also necessary to assign an IP address to the bridge (e.g. 192.168.66.66/24 to br0, as seen @9:01)?

    • @KeithHendersonJr
      @KeithHendersonJr  7 лет назад

      Yep

    • @charetjc
      @charetjc 7 лет назад

      I stumbled across this video trying to debug why my qemu VM couldn't access the rest of my LAN, let alone the internet. The gentoo wiki was informative, but not relevant to my situation.
      My host has eth0 attached to bridge br0. 192.168.1.2/24 is assigned to br0 and my host communicates with LAN and internet just fine.
      Bring up the qemu VM with a TAP interface for the nic on bridge br0, and DHCP fails to assign an IP on the same subnet as the host. I manually assign 192.168.1.3/24 instead. I can ping my host at 192.168.1.2, but no other machine on my LAN.
      It made no sense why this was the case, but I figured iptables was the culprit, though how can a layer-3 firewall block traffic on a layer-2 bridge?
      Tinkering with my iptables, I find `iptables -A FORWARD -i br0 -o br0 -j ACCEPT` allows my qemu VM to ping computers on the LAN, and after a reboot to configure the IP via DHCP, the qemu VM reaches the internet.
      Eventually, I found that the sysctl for net.bridge.bridge-nf-call-iptables = 1, which routes the bridge traffic through iptables. wiki.libvirt.org/page/Net.bridge.bridge-nf-call_and_sysctl.conf
      So the fix is either add the FORWARD rule above, or disable net.bridge.bridge-nf-call-iptables. I don't know how insecure the FOWARD rule is; I find iptable rules unintuitive when trying to discern their repercussions.
      Thanks for the video. I doubt I'd figure this out without that link.

    • @Archangel10123
      @Archangel10123 7 лет назад +1

      +boxofrox Question: When you attach the bridge to your host's eth0, do you then lose internet on eth0?

  • @thorstengonschior5603
    @thorstengonschior5603 4 года назад

    worked just fine

  • @Vido89
    @Vido89 5 лет назад

    When I run my vm qemu-system-mips I get qemu-system-mips: -net bridge,br=bridge0: bridge helper failed

  • @rogernevez5187
    @rogernevez5187 5 лет назад

    Keith, excellent video !! It works flawlessly with my ethernet card.
    However, do you know how to make such bridge with a wireless card?

    • @anwarghammam8380
      @anwarghammam8380 3 года назад

      did you find some solution for the wireless card please?

    • @rogernevez5187
      @rogernevez5187 3 года назад

      @@anwarghammam8380 After some digging, looks like most wireless cards doesn't support bridging. I don't remember how to check that, but there is a way. I remember to have checked that and confirmed that my wireless card indeed did not support bridging.

  • @71GA
    @71GA 4 года назад

    4:34 Oh man! I am nooooot afraid! HOLD MY HAND!!!

  • @davelowe1977
    @davelowe1977 5 лет назад

    When I type ip link set dev {ifacename} master br1 I get operation not supported :-(

  • @magnotaclip
    @magnotaclip 5 лет назад

    "sudo ip link set dev wlp4s0 master br1"
    Error: Device does not allow enslaving to a bridge. :(

    • @rogernevez5187
      @rogernevez5187 5 лет назад

      There are some gimmicks you need to do in order to make his method work with wireless cards.

    • @CodeAsm
      @CodeAsm 4 года назад

      @@rogernevez5187 wireless cards are dificult and also depending on your router in some cases. I dislike this part now