You are not logged in.

#1 2022-08-12 04:34:10

Ahpt
Member
Registered: 2022-03-24
Posts: 30
Website

[SOLVED] virt-manager bridged networking issue

Hello,

For the past few months I have been attempting to troubleshoot using a bridged network to connect my virtual machines to the internal network. However, I've had little success.

I have read through various wikis and forums regarding the network bridge, but I can't get the connection to initiate. At one point, my virtual machine had an internal connection, but my host machine did not.

Here are the articles I have read through. Thankful for anyone with any insight!

ARTICLES REFERENCED:
https://wiki.archlinux.org/title/Network_bridge
https://wiki.archlinux.org/title/Libvirt
https://bbs.archlinux.org/viewtopic.php?id=272246

Last edited by Ahpt (2022-08-24 04:56:36)


Linux is like a child. You give your heart and soul to it, and watch it flourish.

Offline

#2 2022-08-12 06:49:08

Grigorios
Member
Registered: 2021-01-10
Posts: 23

Re: [SOLVED] virt-manager bridged networking issue

Hate to be the guy but you need to provide us with a lot more info.
Like what interface management tool you have used, respectively the config files and so on.

Generally speaking:
Create a bridge interface, bind a the physical interface to it and assign the bridge interface your LAN IP-Address.
Also make sure that your physical interface has no IP-Address anymore, since it will be enslaved to the bridge interface and pass through all traffic to it.

Offline

#3 2022-08-12 08:48:24

Ahpt
Member
Registered: 2022-03-24
Posts: 30
Website

Re: [SOLVED] virt-manager bridged networking issue

Hello! Apologies in advance, I'm still quite new to this whole forum thing. I am currently using iproute2 to create my bridge. Though, I have used the GUI inside virt-manager (I'm unsure what exactly is used there).

I followed the arch wiki closer and entered the following:

sudo ip link add name br0 type bridge

~
sudo ip link set br0 up

~
sudo ip link set enp6s0 master br0

~
sudo ip address add dev br0 192.168.0.2/24

~

And voila! It works perfectly haha. Thanks for knocking some intelligence into me @Grigorios! Now, I just need to make the bridge persistent across reboot... wink


Linux is like a child. You give your heart and soul to it, and watch it flourish.

Offline

#4 2022-08-12 16:31:40

Ahpt
Member
Registered: 2022-03-24
Posts: 30
Website

Re: [SOLVED] virt-manager bridged networking issue

...until it doesn't lol.

After I entered these commands, I entered this to ensure that there was no issue with my main machine and the the bridge

sudo ip address delete dev enp6s0 192.168.1.2/24

~

After this point, I had network connection through my virtual machine which had it's own IP of 192.168.1.3/24, but my master machine did not. This is the IP address output when I removed the enp6s0 ip and made it's master the bridge.

ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: enp6s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel master br0 state UP group default qlen 1000
    link/ether 7c:10:c9:45:1d:33 brd ff:ff:ff:ff:ff:ff
    inet6 fe80::e8f9:d104:9901:7c5b/64 scope link noprefixroute
       valid_lft forever preferred_lft forever
3: wlp5s0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
    link/ether 96:4f:72:29:9b:9b brd ff:ff:ff:ff:ff:ff permaddr 94:e7:0b:d6:61:68
6: br0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
    link/ether 5a:41:45:85:a9:35 brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.3/24 scope global br0
       valid_lft forever preferred_lft forever
    inet6 fe80::5841:45ff:fe85:a935/64 scope link
       valid_lft forever preferred_lft forever

~

and once this was setup, I tried to gather information outside the network

curl https://ipinfo.io/ip
curl: (7) Failed to connect to ipinfo.io port 443 after 8994 ms: No route to host

~ took 9s

I am needing to have a few local servers on my network, and I was hoping to set up static IP address for them through this bridged network. For the bridge network, does my master machine always have the bridge's IP, and any other virtual machines can be different? If so, wouldn't the static IP work for both the bridge and VM'S?

I am more than happy to provide any other config files or terminal outputs as needed.

Thanks again!


Linux is like a child. You give your heart and soul to it, and watch it flourish.

Offline

#5 2022-08-14 20:30:30

Grigorios
Member
Registered: 2021-01-10
Posts: 23

Re: [SOLVED] virt-manager bridged networking issue

Hello!

Maybe you forgot to update your routes?

Type in $ip route and check if there is a default route via your bridge interface.

Greetings

Grigorios

Last edited by Grigorios (2022-08-14 20:31:03)

Offline

#6 2022-08-21 03:30:12

Ahpt
Member
Registered: 2022-03-24
Posts: 30
Website

Re: [SOLVED] virt-manager bridged networking issue

accidental pre-post lol

Last edited by Ahpt (2022-08-21 03:38:47)


Linux is like a child. You give your heart and soul to it, and watch it flourish.

Offline

#7 2022-08-21 03:38:25

Ahpt
Member
Registered: 2022-03-24
Posts: 30
Website

Re: [SOLVED] virt-manager bridged networking issue

Hallo!

I believe I have solved this now. I did check my ip routes and I still had the default set to go through enp6s0 instead of my bridge (br0).

I have corrected this with the following commands:

❯ sudo ip route del default

❯ sudo ip r add 192.168.1.1 dev br0 proto kernel scope link src 192.168.1.2

and then I verified that my new entry was all that was listed using "ip r". Success! I then decided that I want to make this persistent across reboot for obvious convenience reasons. I followed the Arch Wiki to this article:
https://wiki.archlinux.org/title/System … _interface

.. and I entered the following commands:

❯ cd /etc/systemd/network/

❯ sudo touch br0.netdev

Inside br0.netdev, I added the arguments to define the name of the bridge (br0) and the fact that it's a bridge. I also optionally added the MAC address where I am setting this up as a static ip address in my network.

Then I created the files bind.netdev and mybridge.network.. I won't add more for the sake of duplicating info. Please refer to the above link for the full syntax.

I will consider this solved. Hallelujah! smile


Linux is like a child. You give your heart and soul to it, and watch it flourish.

Offline

Board footer

Powered by FluxBB