/etc/sysconfig/network/routes is absent by default?

Hi!

From https://www.suse.com/documentation/sles11/book_sle_admin/data/sec_basicnet_manconf.html#dat_netz_networks

/etc/sysconfig/network/routes and /etc/sysconfig/network/ifroute-*

The static routing of TCP/IP packets is determined here. All the static routes required by the various system tasks can be entered in the /etc/sysconfig/network/routes file: routes to a host, routes to a host via a gateway and routes to a network. For each interface that needs individual routing, define an additional configuration file: /etc/sysconfig/network/ifroute-*. Replace * with the name of the interface. The entries in the routing configuration files look like this: ... 

Ok, ls /etc/sysconfig/network. Result: No routes and\or ifroute-* files by default. Does user need to create them manually by ‘touch’ command? Where /sbin/route -n command reads the info from?

System: OpenSUSE 13.2

Thanks!

Well, that’s a bit outdated I suppose.
13.2 uses Wicked instead of the traditional ifup, although it should still respect the old config files AFAIK.

Ok, ls /etc/sysconfig/network. Result: No routes and\or ifroute-* files by default.

I don’t have any ifroute-* files here either, and routes is empty. (13.2, upgraded since years)

And unless you have specific needs, you shouldn’t need them anyway.

Does user need to create them manually by ‘touch’ command?

No. That doesn’t make sense anyway. “touch” only creates an empty file.
If you want to manually configure routes, you can create them as you wish though.
Or you can use YaST to configure the routes e.g., it will create those files accordingly.

Where /sbin/route -n command reads the info from?

From the kernel I think.

Do you have a specific problem/need? IMHO you should better explain what you want to achieve, then somebody could tell you what you have to do, e.g. what files you have to create in which way.

I’ve turned it off, because it’s heavy-weght framework (due to systemd-analyze blame or systemd-analyze critical-chain commands). I am worshiper of light-weight (traditional) methods. :slight_smile:

No, I have no specific needs. I’m reading some Linux literature now, where config-files placement is described, and in each book /etc/sysconfig/network/routes is defined for OpenSUSE. So, I decided to check the route-file format to have an expirience.

No problem, I can fill the just created empty file in nano editor, e.g.

YaST is the Windows-way. :slight_smile: Let’s forget about YaST just for a experiment. But ok, show me the route settings, plz: it’s /etc/sysconfig editor . :slight_smile:

/proc/…/net/ I suppose.

No specific needs or problem. Just for understanding the difference between books and practice and how to live with that.

Resolved experimentally by returning back to Wicked framework. But systemd-analyze blame shows 7.563 s wicked.service instead of 2.828 s NetworkManager.service for example. :frowning:

Hm?
So you’re running without any network service? How are you setting up your interfaces then?

Or are you using NetworkManager?
I don’t think that’s more light-weight than Wicked, and it’s not really “traditional” either…

Anyway, if you do use NetworkManager, the ifup documentation you mentioned doesn’t apply at all I think.
You have to make your configuration in NetworkManager then.

No, I have no specific needs. I’m reading some Linux literature now, where config-files placement is described, and in each book /etc/sysconfig/network/routes is defined for OpenSUSE. So, I decided to check the route-file format to have an expirience.

Hm, I’m not sure about the format. I never had a need to create or modify them in the 12 years I use (open)SUSE.

But it’s the network.service (traditional ifup in 13.1 and earlier, Wicked nowadays) that reads and applies those settings.
The documentation is in “man ifroute”, that explains exactly the syntax of those files.

No problem, I can fill the just created empty file in nano editor, e.g.

Yes, but there’s no reason to create it with “touch” first. Any decent editor will create the file itself when it doesn’t exist…

YaST is the Windows-way. Let’s forget about YaST just for a experiment. But ok, show me the route settings, plz: it’s /etc/sysconfig editor .

No, it’s Network Settings->Routing…
http://wstaw.org/m/2015/06/19/yast.png
But that’s disabled if you use NetworkManager.

/proc/…/net/ I suppose.

Yes, probably. I haven’t looked at the source code… :wink:
But the man page would indicate that.


DESCRIPTION
Route manipulates the kernel’s IP routing tables.

FILES
/proc/net/ipv6_route
/proc/net/route
/proc/net/rt_cache

No specific needs or problem. Just for understanding the difference between books and practice and how to live with that.

Well, as I said, Wicked should still respect the files AFAIK.

The book you mention is for SLE 11 though (the current one is SLE 12, and has Wicked as well), not openSUSE 13.2. Things do change…
And some of the things in that book are already marked as obsolete too, like route and ifconfig. (ifconfig is actually obsolete since Kernel 2.0!, it, and route too I think, have been removed from the default openSUSE installation recently in Tumbleweed)

Wow, that’s really heavy-weight… :sarcastic:
And you are sure that your system actually takes a whole 5 seconds longer to boot?

Btw, the reason is probably that NetworkManager just signals it has started, although it hasn’t done anything yet (unless you set NM_WAIT_ONLINE).

And for comparison, from my system:

         44.077s NetworkManager.service

(no idea why it took so long on this boot though, I remember shorter times…)

A hint though:
If you want to optimize your boot time, you should rather look at the output of “systemd-analyze critical-chain” instead of “blame”.

PS: NetworkManager seems to store the routing configuration in /etc/NetworkManager/system-connections/, in the corresponding interface config file (there is one file per connection).

These settings:
http://wstaw.org/m/2015/06/19/nm.png
result in this line in the config file (“/etc/NetworkManager/system-connections/Auto eth0” in my case):

[ipv4]
method=auto
route1=10.0.0.0/8,10.0.0.1

(that route is nonsense of course, I just entered anything…)

But you should probably rather use your NetworkManager frontend to configure the routes instead of editing the files yourself (although the latter should work too). In KDE you would click on “Routing” on the IPv4 or IPv6 tab in the connection editor, in the GNOME applet it’s similar.
The text mode interface (“nmtui”) would look like this:http://wstaw.org/m/2015/06/19/nmtui.png
:wink:

Although, in openSUSE there a NetworkManager plugin named “ifcfg-suse” is enabled by default, I think that reads and applies the (at least some) settings from the files in /etc/sysconfig/network too. But I don’t know details.

PPS: You can probably forget about this completely.
From a quick look at the source code, it only seems to read/write the hostname from/to /etc/HOSTNAME, and the
“DHCLIENT_SET_HOSTNAME=” setting from /etc/sysconfig/network/dhcp.
Nothing about routes AFAICS…

Yes, I’ve tried it too.

Yes, seems to be so.

Yes, but as additional way.

Yes, and YaST honestly alarms about it. Although it’s a bug as for me - on Global Options tab user can define NetworkManager and YaST should be able to parse NM configs…

OK.

Not sure.

o_O

I agree.

Ok, will have my experiments further. Thanks again for advices and help!

What do you mean with that?

There’s absolutely no point to create an empty file with touch first before editing it.

And there’s also no point at all to create an empty routes file either.
An empty one has the same effect as none at all.

Yes, and YaST honestly alarms about it. Although it’s a bug as for me - on Global Options tab user can define NetworkManager and YaST should be able to parse NM configs…

But YaST only writes ifup/wicked config files, so what’s the point if NM will not read them anyway as it has its own config?
And there are plenty of NM frontends anyway.

Also, NM allows users to setup connections, while YaST runs as root.