I have been trying to get interconnection between host and guest for a while [ubuntu18.04 - kvm qemu] because I am preconfiguring a webserver and I want to use the guest as a test bed. Overall, I can't go much further because the guest does have access to the host but not the other way around.
Searching I have read that I must create a bridge, and to do so modify /etc/networ/interfaces as follows (This is how I left it):
# interfaces(5) file used by ifup(8) and ifdown(8)
auto lo
iface lo inet loopback
#a partir de aqui esta lo nuevo
auto br0
iface br0 inet static
address 192.168.1.37
network 192.168.1.0
netmask 255.255.255.0
broadcast 192.168.1.255
gateway 192.168.1.1
bridge_ports enp4s0
bridge_stp off
bridge_fd 0
bridge_maxwait 0
of course in all the tutorials they mention eth0, however in ubuntu it does not exist and instead it is enp4s0.
Interestingly, after restarting the network service
/etc/init.d/network-manager restart
when checking the changes with ifconfig -a... no change appears and it looks like this.
enp4s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.1.37 netmask 255.255.255.0 broadcast 192.168.1.255
inet6 fe80::dd0b:4362:2668:e119 prefixlen 64 scopeid 0x20<link>
ether da:01:3a:03:c0:67 txqueuelen 1000 (Ethernet)
RX packets 365643 bytes 484283142 (484.2 MB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 177556 bytes 16509811 (16.5 MB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
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 (Bucle local)
RX packets 2566 bytes 247445 (247.4 KB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 2566 bytes 247445 (247.4 KB)
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:7f:cc:c1 txqueuelen 1000 (Ethernet)
RX packets 83 bytes 5750 (5.7 KB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 57 bytes 5832 (5.8 KB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
virbr0-nic: flags=4098<BROADCAST,MULTICAST> mtu 1500
ether 52:54:00:7f:cc:c1 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
enp4s0 was supposed to lose its IP and br0 shows up with my host's IP, but br0 doesn't show up. If I open virt-manager, in the network section of each machine it recognizes a new br0 bridge mode over enp4s0, however when the machine starts it tells me that the br0 device does not exist.
It's been a week and I'm getting too frustrated, I can't find any tutorial on the subject (mentioning ubuntu 18.04) even if I know that eth0 doesn't exist in ubuntu. And the few who perhaps mention it, following in its footsteps, doesn't matter, because br0 never gets created. I will be very grateful if you can tell me where I am missing.
PS: I have the bridge-utils package installed and updated