[yast-devel] sle12 network config in linuxrc
As the latest linuxrc with the new network code mostly active accidentally slipped into rc1, I better describe the changes now. :-) == network config before sle12 == ** These options are still available in sle12. ** If the repo location is a network url you either get a dhcp config or can supply a static config, e.g. hostip=10.0.1.1/24 gateway=10.0.1.254 nameserver=10.0.1.2 domain=suse.de This config is tried on every network interface in turn until it works. If you don't have a network repo you can still get a network config by netsetup=1 Also, if you do an ssh or vnc installation, linuxrc knows you'll need a network config. The major drawback here is that you can only configure a single interface. == network config in sle12 == That's why there is now the new 'ifcfg' option. The example above would look like static: ifcfg=*=10.0.1.1/24,10.0.1.254,10.0.1.2,suse.de dhcp: ifcfg=*=dhcp The general syntax is ifcfg=interface_name_or_pattern[.vlanid]=ip_addr_list,gateway,namserver_list,ns_search_list[,any_ifcfg_option=foo,...] ifcfg=interface_name_or_pattern[.vlanid]=dhcp[46] It will create ifcfg/ifroute files for all matching interfaces (dhcp) resp. the first matching interface (static setup), then run 'wicked ifup all' and if wicked managed to bring up at least one interface, assume that tings worked. ip_addr_list and namserver_list are space-separated lists, so don't forget to quote the 'ifcfg' option value. If you use a wildcard pattern, it is matched against all existing interfaces and mac addresses; if you use just an interface name, a config is created regardless whether the interface exists. A wildcard pattern will never match 'lo'. You can have several 'ifcfg' options, of course. Advantages: - more than one interface can be configured - supports vlan setup (e.g. ifcfg=eth0.55=dhcp) - can set arbitray ifcfg options (ifcfg=eth3=dhcp,STARTMODE=nfsroot) - no trial-and-error on all interfaces Note: the transition to the new code is WIP. You may find occasionally that linuxrc thinks the network is not configured even though it really is. Steffen -- To unsubscribe, e-mail: yast-devel+unsubscribe@opensuse.org To contact the owner, e-mail: yast-devel+owner@opensuse.org
On Mon, 14 Jul 2014 11:31:37 +0200 (CEST) Steffen Winterfeldt <snwint@suse.de> wrote:
As the latest linuxrc with the new network code mostly active accidentally slipped into rc1, I better describe the changes now. :-)
== network config before sle12 ==
** These options are still available in sle12. **
If the repo location is a network url you either get a dhcp config or can supply a static config, e.g.
hostip=10.0.1.1/24 gateway=10.0.1.254 nameserver=10.0.1.2 domain=suse.de
This config is tried on every network interface in turn until it works.
If you don't have a network repo you can still get a network config by
netsetup=1
Also, if you do an ssh or vnc installation, linuxrc knows you'll need a network config.
The major drawback here is that you can only configure a single interface.
== network config in sle12 ==
That's why there is now the new 'ifcfg' option. The example above would look like
static: ifcfg=*=10.0.1.1/24,10.0.1.254,10.0.1.2,suse.de dhcp: ifcfg=*=dhcp
The general syntax is
ifcfg=interface_name_or_pattern[.vlanid]=ip_addr_list,gateway,namserver_list,ns_search_list[,any_ifcfg_option=foo,...] ifcfg=interface_name_or_pattern[.vlanid]=dhcp[46]
It will create ifcfg/ifroute files for all matching interfaces (dhcp) resp. the first matching interface (static setup), then run 'wicked ifup all' and if wicked managed to bring up at least one interface, assume that tings worked.
ip_addr_list and namserver_list are space-separated lists, so don't forget to quote the 'ifcfg' option value.
If you use a wildcard pattern, it is matched against all existing interfaces and mac addresses; if you use just an interface name, a config is created regardless whether the interface exists.
A wildcard pattern will never match 'lo'.
You can have several 'ifcfg' options, of course.
Advantages:
- more than one interface can be configured - supports vlan setup (e.g. ifcfg=eth0.55=dhcp) - can set arbitray ifcfg options (ifcfg=eth3=dhcp,STARTMODE=nfsroot) - no trial-and-error on all interfaces
Note: the transition to the new code is WIP. You may find occasionally that linuxrc thinks the network is not configured even though it really is.
Steffen
Can you please update also http://en.opensuse.org/SDB:Linuxrc as it is I think the most used source for linuxrc documentation. Josef -- To unsubscribe, e-mail: yast-devel+unsubscribe@opensuse.org To contact the owner, e-mail: yast-devel+owner@opensuse.org
On 25.7.2014 10:54, Josef Reidinger wrote:
On Mon, 14 Jul 2014 11:31:37 +0200 (CEST) Steffen Winterfeldt <snwint@suse.de> wrote:
== network config in sle12 ==
That's why there is now the new 'ifcfg' option. The example above would look like
static: ifcfg=*=10.0.1.1/24,10.0.1.254,10.0.1.2,suse.de dhcp: ifcfg=*=dhcp
I'm afraid that this could possibly break some code handling the Linuxrc cmdline ("=" sign not used only as a separator, but also as a value)
Note: the transition to the new code is WIP. You may find occasionally that linuxrc thinks the network is not configured even though it really is.
Steffen
Can you please update also http://en.opensuse.org/SDB:Linuxrc as it is I think the most used source for linuxrc documentation.
And I believe it should be also in release notes. Is there a bug or FATE entry where we could add the docu team and tell them all that is needed to know? Thanks Lukas -- Lukas Ocilka, Systems Management (Yast) Team Leader Cloud & Systems Management Department, SUSE Linux -- To unsubscribe, e-mail: yast-devel+unsubscribe@opensuse.org To contact the owner, e-mail: yast-devel+owner@opensuse.org
On Mon, Jul 14, 2014 at 11:31:37AM +0200, Steffen Winterfeldt wrote:
== network config in sle12 ==
Steffen, thanks for documenting this! But posts on a mailing list get out of date, and need a search engine to be reached. Please copy this to https://en.opensuse.org/SDB:Linuxrc (or maybe create https://github.com/openSUSE/linuxrc/tree/master/doc ?)
That's why there is now the new 'ifcfg' option. The example above would look like
static: ifcfg=*=10.0.1.1/24,10.0.1.254,10.0.1.2,suse.de dhcp: ifcfg=*=dhcp
The general syntax is
ifcfg=interface_name_or_pattern[.vlanid]=ip_addr_list,gateway,namserver_list,ns_search_list[,any_ifcfg_option=foo,...] ifcfg=interface_name_or_pattern[.vlanid]=dhcp[46]
It will create ifcfg/ifroute files for all matching interfaces (dhcp) resp. the first matching interface (static setup), then run 'wicked ifup all' and if wicked managed to bring up at least one interface, assume that tings worked.
Will these options appear in install.inf too? The old style options do. I don't know how much yast2-network still depends on them.
ip_addr_list and namserver_list are space-separated lists, so don't forget to quote the 'ifcfg' option value.
Single quotes, double quotes? What if someone decides this is a great place to use unusual characters, like this? ifcfg=eth0=dhcp,WIRELESS_ESSID="Joe's\twifi" If they are allowed we should make sure the install.inf parser a) understands them, b) at least ignores them. -- Martin Vidner, Cloud & Systems Management Team http://en.opensuse.org/User:Mvidner Kuracke oddeleni v restauraci je jako fekalni oddeleni v bazenu
On Fri, 25 Jul 2014, Lukas Ocilka wrote:
On 25.7.2014 10:54, Josef Reidinger wrote:
On Mon, 14 Jul 2014 11:31:37 +0200 (CEST) Steffen Winterfeldt <snwint@suse.de> wrote:
== network config in sle12 ==
That's why there is now the new 'ifcfg' option. The example above would look like
static: ifcfg=*=10.0.1.1/24,10.0.1.254,10.0.1.2,suse.de dhcp: ifcfg=*=dhcp
I'm afraid that this could possibly break some code handling the Linuxrc cmdline ("=" sign not used only as a separator, but also as a value)
I don't think so. We've used a similar syntax for 'ethtool' for quite some time. I'm open for other suggestions, though. (',' instead of '=' won't work, btw, because (atm) I want to have ifcfg=dhcp resp. ifcfg=10.0.1.1/24,10.0.1.254,10.0.1.2,suse.de be a replacement for the old config using netsetup, hostip, gateway, etc. options). Steffen -- To unsubscribe, e-mail: yast-devel+unsubscribe@opensuse.org To contact the owner, e-mail: yast-devel+owner@opensuse.org
On Mon, 28 Jul 2014, Martin Vidner wrote:
On Mon, Jul 14, 2014 at 11:31:37AM +0200, Steffen Winterfeldt wrote:
== network config in sle12 ==
Steffen, thanks for documenting this!
But posts on a mailing list get out of date, and need a search engine to be reached. Please copy this to https://en.opensuse.org/SDB:Linuxrc
Certainly; I just wanted to give an oppotunity for discussion here.
ip_addr_list and namserver_list are space-separated lists, so don't forget to quote the 'ifcfg' option value.
Single quotes, double quotes?
For linuxrc, either; but the kernel command line parser uses double quotes, iirc and the network config files use double quotes, too. So better stick to that.
What if someone decides this is a great place to use unusual characters, like this?
He might regret it. :-)
ifcfg=eth0=dhcp,WIRELESS_ESSID="Joe's\twifi"
If they are allowed we should make sure the install.inf parser a) understands them, b) at least ignores them.
That doesn't matter because linuxrc does no longer put _any_ network config data into install.inf. With the only exception of 'Hostname', which _seems_ to be used by yast. (Simply because linuxrc doesn't have the config data anymore.) So, seriously, strange quoting should be ok. Steffen -- To unsubscribe, e-mail: yast-devel+unsubscribe@opensuse.org To contact the owner, e-mail: yast-devel+owner@opensuse.org
participants (4)
-
Josef Reidinger
-
Lukas Ocilka
-
Martin Vidner
-
Steffen Winterfeldt