I use KVM in bridged network mode so I can have a VM that has an IP from the host LAN network. My host (Ubuntu 18.04 server) networking is configured as below :
network:
ethernets:
enp0s31f6:
dhcp4: true
enp5s0:
dhcp4: true
bridges:
br0:
interfaces: [enp0s31f6]
macaddress: EX:DX:5X:X0:X0:XO
dhcp4: yes
version: 2
I have created a bridged connection using virtsh for my VM.
<network>
<name>host-bridge</name>
<uuid>0fe3b67b-5155-4581-92f2-2510d864ed65</uuid>
<forward mode='bridge'/>
<bridge name='br0'/>
</network>
However, when i do an ifconfig on the VM, I only see an ipv6 address assigned.
enp1s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet6 2a01:cb00:c3c:e500:9949:de93:1df3:c13c prefixlen 64 scopeid 0x0<global>
inet6 2a01:cb00:c3c:e500:ae16:cee:c3a6:c493 prefixlen 64 scopeid 0x0<global>
inet6 fe80::ff22:79d5:c7fe:884f prefixlen 64 scopeid 0x20<link>
ether XX:XX:XX:XX:XX:XX txqueuelen 1000 (Ethernet)
RX packets 5990 bytes 560495 (560.4 KB)
RX errors 0 dropped 2778 overruns 0 frame 0
TX packets 702 bytes 89008 (89.0 KB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
How can i force KVM or change the host/guest network to only assign IPV4?
I thought about turning ipV6 on the guest grub, but this seems to cause issues on VMs. My server is a remote one,and I don't want to lose ssh connectivity.