KVM: openSUSE 12.3: virtio_net without DHCP

Hi,

KVM-Host is openSUSE 12.3; Guest is openSUSE 12.3

Link is MacVTap and passthrough

The Guest gets an IP-Addr. from the LAN-wide DHCP-Srv. at boot time.
With this connection the guest works without problems.

But in the guest I have configured (with YaST) static IP and another
Network.

cat /etc/sysconfig/network/ifcfg-eth0

BOOTPROTO=‘static’
BROADCAST=’’
ETHTOOL_OPTIONS=’’
IPADDR=‘192.168.52.144/24’
MTU=’’
NAME=‘Ethernet Card 0’
NETWORK=’’
REMOTE_IPADDR=’’
STARTMODE=‘auto’
USERCONTROL=‘no’

But this configuration is ignored. And this configuration is used:

ip a s eth0

2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast
state UP qlen 1000
link/ether 52:54:00:00:3b:cc brd ff:ff:ff:ff:ff:ff
inet 192.168.50.231/24 brd 192.168.250.255 scope global eth0

It is possible to add the IP-ADDR. manual:

ip a s eth0

2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
link/ether 52:54:00:00:3b:cc brd ff:ff:ff:ff:ff:ff
inet 192.168.52.144/24 scope global eth0

After this I can work without problems.

Why are my setting from /etc/sysconfig/network/ifcfg-eth0 are ignored?
What can I do to get the static IP on Boot time?

Add.Info: udev-rule (70-persistent-net.rules) is empty. I think this is
correct because there is the virtio module which does not emulate
hardware.

Bye

Bernd

PS:

modinfo virtio_net

filename: /lib/modules/3.7.6-1.2-desktop/kernel/drivers/net/virtio_net.ko
license: GPL
description: Virtio network driver
srcversion: 38E7A1CD39EECEA8940DDE0
alias: virtio:d00000001v*
depends: virtio,virtio_ring
intree: Y
vermagic: 3.7.6-1.2-desktop SMP preempt mod_unload modversions
parm: napi_weight:int
parm: csum:bool
parm: gso:bool

I guess my initial Q is why you choose to connect your networking using pass-through (unusual but may be possible) instead of setting up virtual networking. Unless you need direct hardware support (eg pen testing) this is a less documented, rarely used method so you can expect to run into unusual issues.

More commonly documented is to set up virtual networking using Linux Bridge devices which provide a pre-configured network environment which can be Host-only, NAT or Shared (conventional definition of bridging). Once setup, you only need to change networking by configuring your VM with a different Bridge device. And, you’ll be able to use the virtio driver. Also, pass-through ordinarily suggests dedicating a physical device whereas virtual networking fully assumes sharing hardware resources.

As for MacVtap, I understand that today it’s built into the Linux kernel and is automatically invoked as needed, you ordinarily shouldn’t have to explicitly reference it (but might be related to your using pass-through).

Am curious what you’re using for your guide.
If you are willing to start over, I recommend

  • Installation of KVM and libvirt components

After the libvirt packages are installed, you’ll find two useful apps installed and accessible as applauncher menu items and from within YAST

Vm Manager. As its name suggests, a graphical app that enables full management of your VMs, the creation and management of Linux Bridge devices, some overall performance monitoring.

Vm install. Actually, libvirt installs 2 versions with some differences, but both will easily create new VMs, clone and delete.

Lastly, I’m purely speculating but I’m guessing you have your KVM Guest set to automaticall start on system boot but you could be setting up your Host networking to start on login (with your Desktop login) which won’t work because your HostOS networking must start before your GuestOS networking can work.

HTH,
TSU

Am Sun, 01 Sep 2013 16:26:02 GMT
schrieb tsu2 <tsu2@no-mx.forums.opensuse.org>:

>
> I guess my initial Q is why you choose to connect your networking
> using pass-through (unusual but may be possible) instead of setting
> up virtual networking. Unless you need direct hardware support (eg
> pen testing) this is a less documented, rarely used method so you can
> expect to run into unusual issues.
>
(…)
>
> HTH,
> TSU
>
>
Thank you for your detailed answer. Meanwhile I have more experience in
this and got it up and running :slight_smile:

I want to test some new parts in KVM like virtual functions in network
and so on. My problem was my understanding of some connections in
net configuring of my distribution.

Best regards

Bernd