Static Route with NM

Hello,
I try to setup a static route for my KVM network. My home network is 10.0.0.0/24 and I use NetworkManager on my desktop.
The /etc/sysconfig/network/route has the following entries:

cat /etc/sysconfig/network/routes
192.168.122.0   10.0.0.222   255.255.255.0   -
default 10.0.0.254 - -

However, the routing table does not contain the KVM static route:

route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         10.0.0.254      0.0.0.0         UG    1024   0        0 enp2s0
10.0.0.0        0.0.0.0         255.255.255.0   U     0      0        0 enp2s0

What do I miss?

Am Thu, 24 Nov 2016 18:16:01 GMT
schrieb tpe <tpe@no-mx.forums.microfocus.com>:

>
> What do I miss?
>
>

NWM does not use the configuration files in /etc/sysconfig/network but its own
configuration files.

You will have to configure your static routes with one of the NWM frontends
(nm-applet or nmtui for example, the latter is well suited if there is no X
running).

You can also configure this manually by
creating/editing the respective
/etc/NetworkManager/system-connections/$YOUR_INTERFACE/PROFILE file.

See “man NetworkManager”, “man nm-settings” and “man nmtui” for more
information.

AK

AK


Never attribute to malice that which can be adequately explained by stupidity.
(R.J. Hanlon)

We may assume that you restarted the network (or even rebooted) after you added that route into the file. But because you do not say so, we also may assume you did not.

Edit: Oh yes, of course, you use NM and configure wicked. That does not fit.
I think that using YaST you could not have done that.

Am Thu, 24 Nov 2016 18:28:38 GMT
schrieb AK <Akoellh@no-mx.forums.microfocus.com>:
>
> You will have to configure your static routes with one of the NWM frontends
> (nm-applet or nmtui for example, the latter is well suited if there is no X
> running).
>

Addendum:

nm-connection-editor instead of nm-applet and nmtui-edit instead of nmtui would
be the direct way to get a (G)UI for editing settings.

AK


Never attribute to malice that which can be adequately explained by stupidity.
(R.J. Hanlon)

Hi,

There is always

nmcli

If you’re not running an X server but still want to use NetworkManager. the files are inside the directory

/etc/NetworkManager

and

/etc//NetworkManager/system-connections

which you can edit by hand.

The solution was easier than I thought:

nmcli connection modify MyLan ipv4.routes "192.168.122.0/24 10.0.0.222 10"

Of course someone needs to follow an nmcli con down/up cycle to activate it.

You need to first describe in detail your physical networking and then whether KVM is running on the same machine or on another machine.

If you are running KVM on the same machine, then it’s not advisable to create networking configurations to virtual networks directly on physical networking interfaces, the general procedure is to create a Linux Bridge Device which is bound to a physical interface. The LBD itself is then configured to provide virtual networking support including routing, possibly network address spaces, DHCP and more.

Also, if you install libvirt which is generally the case when you install KVM using YAST, vm manager pretty much does a lot of this for you easily.

You can search the Virtualization Forum for my many posts on this subject.

As for Network Manager running on a HostOS, that’s OK as long as you configure only for the HostOS and don’t do a thing for any virtual networking.

TSU