I somehow managed to break all wired network connections (but not wireless)

Hello, Im hoping someone here knows a thing or two about networking.
So after getting getting ASCO working which you guy’s helped me out with in this thread.
I started messing with my shiny new vfio enabled vm.

I wanted to get network bridging working but because i’m using a manual qemu script to run the VM i need to do everything manually. So i started researching how to create a network bridge on linux. I tried a bunch of different things but i couldn’t get anything to work. As far as i know i put everything back the way it all was before i started messing with things but it seems i missed something. Or something i did broke something.

I did make one rather serious mistake. One of the things i tried was using the “network manager” application to setup a bridge. From what i read thats supposed to be included with Ubuntu 18.04 (which it is) but i could not find it in the app list so i just installed it and network-manager-gnome. After messing with taht for a bit i still couldn’t get the gui to open so i gave up and… purged network-manager… Yea oops. I was able to recover from that using an Ubuntu live USB The exact recovery method i used can be found here

After that little indecent everything still worked fine.
The last thing i tried was this I followed those vague instructions and added those lines to my /etc/netplan/01-network-manager-all.yaml, rebooted and… No Ethernet. reverted the change, rebooted and… still no Ethernet. And thats pretty much where i’m at now. Of course i hit google hard trying to figure out what i broke but no luck.

two interesting things i have noticed about this issue. This effects my built in nic and a cheap usb Ethernet adaptor i have but not my usb wireless adaptor.
Another thing that concerns me is twice now the Ubuntu settings app has vanished. As far as i can tell this only happened when i was screwing with things trying to fix this issue but i cant see how messing with network settings would do something like that. Both times this happened i fixed it with apt install ubuntu-desktop

ifconfig
lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 1465  bytes 1721994 (1.7 MB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 1465  bytes 1721994 (1.7 MB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

virbr0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        inet 192.168.122.1  netmask 255.255.255.0  broadcast 192.168.122.255
        ether 52:54:00:ae:a6:91  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

vmnet1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.56.1  netmask 255.255.255.0  broadcast 192.168.56.255
        inet6 fe80::250:56ff:fec0:1  prefixlen 64  scopeid 0x20<link>
        ether 00:50:56:c0:00:01  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 338  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

vmnet8: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 172.16.99.1  netmask 255.255.255.0  broadcast 172.16.99.255
        inet6 fe80::250:56ff:fec0:8  prefixlen 64  scopeid 0x20<link>
        ether 00:50:56:c0:00:08  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 337  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

wlx0013ef1f0112: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.9.101  netmask 255.255.255.0  broadcast 192.168.9.255
        inet6 fe80::c5d9:c6d3:3c52:4a0e  prefixlen 64  scopeid 0x20<link>
        ether 00:13:ef:1f:01:12  txqueuelen 1000  (Ethernet)
        RX packets 81461  bytes 116353156 (116.3 MB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 72883  bytes 10424153 (10.4 MB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
iwconfig
wlx0013ef1f0112  IEEE 802.11  ESSID:"Optus-4G"  
          Mode:Managed  Frequency:2.447 GHz  Access Point: 7C:11:CB:AF:F1:9C   
          Bit Rate=72.2 Mb/s   Tx-Power=20 dBm   
          Retry short limit:7   RTS thr=2347 B   Fragment thr:off
          Power Management:off
          Link Quality=56/70  Signal level=-54 dBm  
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:0  Invalid misc:87   Missed beacon:0

vmnet8    no wireless extensions.

enp3s0    no wireless extensions.

virbr0-nic  no wireless extensions.

lo        no wireless extensions.

virbr0    no wireless extensions.

vmnet1    no wireless extensions.
ip link
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: enp3s0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000
    link/ether 1c:1b:0d:06:bd:18 brd ff:ff:ff:ff:ff:ff
3: wlx0013ef1f0112: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DORMANT group default qlen 1000
    link/ether 00:13:ef:1f:01:12 brd ff:ff:ff:ff:ff:ff
4: virbr0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN mode DEFAULT group default qlen 1000
    link/ether 52:54:00:ae:a6:91 brd ff:ff:ff:ff:ff:ff
5: virbr0-nic: <BROADCAST,MULTICAST> mtu 1500 qdisc fq_codel master virbr0 state DOWN mode DEFAULT group default qlen 1000
    link/ether 52:54:00:ae:a6:91 brd ff:ff:ff:ff:ff:ff
6: vmnet1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UNKNOWN mode DEFAULT group default qlen 1000
    link/ether 00:50:56:c0:00:01 brd ff:ff:ff:ff:ff:ff
7: vmnet8: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UNKNOWN mode DEFAULT group default qlen 1000

Is it me or is networking on linux just pain in the ass?

If all else fails i do have one way i may be able to fix this. Before i started screwing with my kernel i tried to create complete backup of my system using this method I did get a few errors when creating that so i dont want to trust it but im pretty sure it was just a few non critical files that changed while they were being compressed. Issue is that 90+GB compressed file is sitting on my nas and the only connection i have is wifi. So i am currently decompressing in in place using unraid’s remote terminal. Once thats done i may be able to use something like git diff to compare it file by file to my system and look for any changes that may break networking.

Wish me luck!

There’s always been many ways to manage the state of network in Linux.

Typically, you’d create a bridge interface, you’d add your physical nic to that bridge, and your machine would be talking in/out via the bridge interface. You’d have DHCP or static IP enabled on the bridge. You would make sure the physical interface is brought up without IP configuration as a member of the bridge.

I’m assuming you want to keep networkmanager?

At this point I just want my network back xD

I would really like to figure out what i broke and how so i can at least learn from this experience but really i just want to get this fixed.

I have no attachment to network manager. Its just what came with Ubuntu and until now it just worked. I would like to figure out how i broke it but if there is something better / easier to use i’m open to alternatives.

So… Ahh… yea i dont want to talk about it…

So funny thing. My discord mute key is numpad period… Which is fine because i dont use discord voice that often. But when i do i have a habit of leaving random periods in random places. Usually non critical places like say the discord message text box… Yea this is not one of those “non critical” places

Can you spot the dot? xD

But hay! at least my git diff worked! only took me most of the day to find a single .

So while on the topic of networking…
Does anyone want to help me figure out how to get my qemu vm connected to the local network? @risk you gave me some good general advice but so far i have not been able to figure out how to actually do what you suggested.

For reference if needed here is my current VM launch script.
#!/bin/bash

vmname="windows10vm"

if ps -ef | grep qemu-system-x86_64 | grep -q multifunction=on; then
echo "A passthrough VM is already running." &
exit 1

else

# use pulseaudio
export QEMU_AUDIO_DRV=pa
export QEMU_PA_SAMPLES=8192
export QEMU_AUDIO_TIMER_PERIOD=99
export QEMU_PA_SERVER=/run/user/1000/pulse/native

cp /usr/share/OVMF/OVMF_VARS.fd /tmp/my_vars.fd

qemu-system-x86_64 \
-name $vmname,process=$vmname \
-machine type=q35,accel=kvm \
-cpu host,kvm=off \
-smp 4,sockets=1,cores=2,threads=2 \
-m 8G \
-balloon none \
-rtc clock=host,base=localtime \
-vga none \
-nographic \
-serial none \
-parallel none \
-soundhw hda \
-usb \
-device usb-host,vendorid=0x1a40,productid=0x0101 \
-device usb-host,vendorid=0x046d,productid=0xc52b \
-device usb-host,vendorid=0x05dc,productid=0xa817 \
-device usb-host,vendorid=0x0fe6,productid=0x9700 \
-device ioh3420,bus=pcie.0,addr=1c.0,multifunction=on,port=1,chassis=1,id=root.1 \
-device vfio-pci,host=02:00.0,bus=root.1,addr=00.0,multifunction=on \
-device vfio-pci,host=02:00.1,bus=root.1,addr=00.1 \
-drive if=pflash,format=raw,readonly,file=/usr/share/OVMF/OVMF_CODE.fd \
-drive if=pflash,format=raw,file=/tmp/my_vars.fd \
-boot order=dc \
-drive file=/mnt/share/ColdStorage/OS\ Installs/Windows/Windows_10_May_14_2018.iso,index=1,media=cdrom \
-drive id=disk0,if=virtio,cache=none,format=raw,file=/home/brandon3055/kvm-vms/win10-vfio.img \
-drive file=/home/brandon3055/Desktop/tmp/virtio-win-0.1.160.iso,index=2,media=cdrom \


# -netdev tap,fd=25,id=hostnet0 \
# -device rtl8139,netdev=hostnet0,id=net0,mac=52:54:00:3f:1c:de,bus=pcie.0,addr=0x3 \

exit 0
fi

Edit:
I guess all i really need to do is figure out how VM manager handles this because when i was using that i had no problem with network bridging.
This if im not mistaken is vm manager’s network config.

    <interface type='direct'>
      <mac address='52:54:00:3f:1c:de'/>
      <source dev='enp3s0' mode='bridge'/>
      <model type='rtl8139'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
    </interface>

I think i figured out how to convert that to qemu arguments

-netdev tap,fd=25,id=hostnet0 \
-device rtl8139,netdev=hostnet0,id=net0,mac=52:54:00:3f:1c:de,bus=pci.0,addr=0x3 \

The issue is if im not mistaken thats setup to work with a network bridge thats created by VM manager. Thats the part i’m having trouble with. I was able to create a bridge using bridge-utils but as soon as i created it my system started trying to use it which obviously isn’t what i want.
I also think i configured it wrong because when my system was trying to use it i lost my internet connection.

auto lo
iface lo inet loopback

auto br0
iface br0 inet dhcp1
    bridge_port    enp3s0
    address 192.168.1.126
    netmask 255.255.255.0
    gateway 192.168.1.8

To create a bridge , i used this guide

after for the tap interface

#Next up, create a TAP interface:
sudo ip tuntap add dev tap0 mode tap user $(whoami)

#Add the TAP interface to the bridge:
sudo ip link set tap0 master br0

#Make sure everything is up:
sudo ip link set dev br0 up
sudo ip link set dev tap0 up

Thank you @coxaya Finally a guide that shows how to open the illusive network manager GUI!

Though i am running into issues with that guide.
I followed the guide and did everything exactly as described. According to the guide after the bridge is added and i remove my original wired connection the bridge should be assigned an ip and my system should switch over to the bridge.

Nether of those things happen. The bridge does not get an IP and my system starts trying to use the bridge’s slave connection “bridge0 slave 1” which for some reason shows up in the Ethernet list which based on the images in the guide isnt supposed to happen.

I tried rebooting to make sure everything applied properly and i also tried adjusting priority settings but i could not get it to work.

ifconfig
bridge0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet6 fe80::1e1b:dff:fe06:bd18  prefixlen 64  scopeid 0x20<link>
        ether 1c:1b:0d:06:bd:18  txqueuelen 1000  (Ethernet)
        RX packets 15  bytes 1894 (1.8 KB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 29  bytes 4722 (4.7 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

enp4s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        ether 1c:1b:0d:06:bd:18  txqueuelen 1000  (Ethernet)
        RX packets 2669  bytes 789523 (789.5 KB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 1945  bytes 239509 (239.5 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
        device interrupt 18  

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 5403  bytes 16284316 (16.2 MB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 5403  bytes 16284316 (16.2 MB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

virbr0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        inet 192.168.122.1  netmask 255.255.255.0  broadcast 192.168.122.255
        ether 52:54:00:ae:a6:91  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

vmnet1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.56.1  netmask 255.255.255.0  broadcast 192.168.56.255
        inet6 fe80::250:56ff:fec0:1  prefixlen 64  scopeid 0x20<link>
        ether 00:50:56:c0:00:01  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 514  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

vmnet8: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 172.16.99.1  netmask 255.255.255.0  broadcast 172.16.99.255
        inet6 fe80::250:56ff:fec0:8  prefixlen 64  scopeid 0x20<link>
        ether 00:50:56:c0:00:08  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 514  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0