STATIC Network Configuration not loaded on Guest VM startup

Hello all,

I recently started working with openSUSE.
Currently I’m having troubles configuring Leap 42.3 VM with static IP on a second network card.

The setup I need is: 1 card with NAT and 1 card with static IP.
Therefore I have two network configuration files ( for eth0 and eth1 ).
The eth0 configuration file was created automatically when I created the VM,
but the second I did manually, following the instructions described in /etc/sysconfig/network/ifcfg.template :

template-VM:~ # cat /etc/sysconfig/network/ifcfg-eth1
BOOTPROTO=‘static’
BROADCAST=‘192.168.0.255’
ETHTOOL_OPTIONS=’’
IPADDR=‘192.168.0.112’
MTU=’’
NAME=’’
NETMASK=‘255.255.255.0’
NETWORK=’’
REMOTE_IPADDR=’’
STARTMODE=‘auto’
DHCLIENT_SET_DEFAULT_ROUTE=‘yes’

After creating the above file, I restarted the VM but the configuration wasn’t read at all:

template:~ # ifconfig eth1
eth1 Link encap:Ethernet HWaddr 08:00:27:D6:CE:C9
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)

What I’m doing wrong ?

Are you using wicked or NetworkManager?

Assume you’re using Wicked (not Network Manager)

Better and easier is to at least start your configuration using YaST > System > Network Settings, then Edit the desired network interface.
Then, if you want to further modify your interface, perhaps with settings not obvious in YaST, then modify the ifcfg file directly.

I’m also assuming that your NAT is your primary network interface, so only that should be a full network configuration with DG and DNS.
Secondary network interfaces <may> have those settings as well, but typically don’t.

Depending on what you are trying to configure, you may also have to add a “network device” in your Guest’s virtualization properties(your network devices are connected to different virtual networks).
How you might do this depends on what virtualization you are running.

If the above isn’t enough to get you working, you need to post
Virtualization technology
ip addr
Guest network devices (connected to type of network (NAT/HostOnly/Bridging),
Virtual networks configured(Typically found in HostOS virtualization management tool)

TSU

Hi,

I’m using Network Manager.
What I’m trying is, to receive configuration, without having to touch the GUI ( not a big fan of the mouse ). :slight_smile:

And what makes you think NetworkManager is using configuration file you created?

receive configuration, without having to touch the GUI

You can use nmcli or nmtui or edit /etc/NetworkManager/system-connections directly.

Still that’s in no help at all.
Ok it looks like I’ll have to invest more time on that OS then on any other.
Thanks a lot . :slight_smile:

https://developer.gnome.org/NetworkManager/stable/nm-settings-keyfile.html

Its the same as arvidjaar said.

/etc/sysconfig/network is for use with Yast/wicked, not Networkmanager…

If you are not moving between networks, then you should be using Wicked instead of Network Manager. Network Manager is generally recommended whenever you need to move between wireless networks, so you may need to set up(and remember) connections to each network you connect to.

Otherwise,
As described, you do have CLI options to create, and manage network connections using Network Manager, and nmtui is likely the easiest path to success.

But otherwise,
You didn’t say anything about the other important requirement i mentioned, that you also have to set up externally in your Guest’s virtualization properties a “network device” that connects your secondary network device to a defined virtual network. Alternatively but I’d consider unlikely, it’s probably possible to add a static address to your existing network interface, but I’d want to see evidence you’re trying to do that before going down that path.

If you are unable to figure out what you’re not doing correctly, you have to post the information I asked for at the end of my last post.

TSU

It answers your exact question - what you are doing wrong. If this is of no help, may be you intended to ask something different, not what you have actually asked :slight_smile:

Ok it looks like I’ll have to invest more time on that OS then on any other.

Previous posts give impression that you are familiar with configuring NetworkManager under other OS without GUI. In this case there should be no difference in openSUSE. If my assumption is wrong, may be you could elaborate on what your actual question is :slight_smile:

While my contribution here might be of no value at all because I have no VM experience (you could have avoided me posting here when you had started this in the Virtualization sub-forum ;)), my two cents.

I am with tsu2 in that this seems to me a case for wicked (ifconfig). And I am also with him that using YaST to start with (which then first and for all will see that your system is switch from NM to wicked, so that configuring ifconfig while still using NM is avoided) and then may be fine tune by editing the ifconfig files might be a good way to go.

You protest because you do not want to use a GUI. That is no argument, because nobody here suggested that you use YaST in a GUI. Just (as root) call

yast