From Fedora Project Wiki
No edit summary
Line 107: Line 107:
{{Anchor|configfiles}}
{{Anchor|configfiles}}
==== Editing configuration files ====
==== Editing configuration files ====
'''Anaconda''' is communicating with '''NetworkManager''' mostly with <code>ifcfg</code> files ('''nm-c-e''' stores its configuration there too). It can be handy to edit them directly for debugging or as workaround solution. Files can be edited using shell in virtual terminal <code>tty2</code> ('''[Ctrl][Alt][F2]'''). Their location is <code>/etc/sysconfig/netwrok-scripts/ifcfg-<device name></code>. The configuration will be applied in installer after the device is disconnected and reactivated. The device is disconnected if its <code>ifcfg</code> file is removed. It will be activated if an <code>ifcfg</code> file is copied back to its location with <code>ONBOOT=yes</code> set. So configuration of active device for installer environment can be changed this way:
'''Anaconda''' is communicating with '''NetworkManager''' mostly with <code>ifcfg</code> files ('''nm-c-e''' stores its configuration there too). It can be handy to edit them directly for debugging or as workaround solution. Files can be edited using shell in virtual terminal <code>tty2</code> ('''[Ctrl][Alt][F2]'''). Their location is <code>/etc/sysconfig/netwrok-scripts/ifcfg-<device name></code>. The configuration will be applied in installer after the device is disconnected (its <code>ifcfg</code> file is removed) and reactivated (an <code>ifcfg</code> file is copied back to its location with <code>ONBOOT=yes</code> set). So configuration of active device for installer environment can be changed this way:
<pre>
<pre>
mv /etc/sysconfig/network-scripts/ifcfg-eth0 /tmp
mv /etc/sysconfig/network-scripts/ifcfg-eth0 /tmp
Line 133: Line 133:
== Bugs and issues ==
== Bugs and issues ==


{{Anchor|dvdonboot}}
* DVD install defaults to ONBOOT=no leaving networking down after reboot - [https://bugzilla.redhat.com/show_bug.cgi?id=498207 bug 498207]. This is rather sore issue. Only devices enabled during install will have set ONBOOT=yes by default. For other devices, the setting has to be configured.
* DVD install defaults to ONBOOT=no leaving networking down after reboot - [https://bugzilla.redhat.com/show_bug.cgi?id=498207 bug 498207]. This is rather sore issue. Only devices enabled during install will have set ONBOOT=yes by default. For other devices, the setting has to be configured.
** Before rebooting we could detect having no device to be activated automatically and offer change on the last screen (probably with just ''Configure Network'' button on the screen).
** Before rebooting we could detect having no device to be activated automatically and offer change on the last screen (probably with just ''Configure Network'' button on the screen).
Line 142: Line 143:


{{Anchor|nmapplet}}
{{Anchor|nmapplet}}
* Configuration of successfully activated device in installer environment can't be changed (related bugs: [https://bugzilla.redhat.com/show_bug.cgi?id=592856 bug 592856], [https://bugzilla.redhat.com/show_bug.cgi?id=504983 504983], [https://bugzilla.redhat.com/show_bug.cgi?id=635239 635239]). There is no way to disconnect the device and activate it so that changed configuration could be applied (except for workaround by [[Anaconda/Network#configfiles | editing configuration files]]). In desktop, this is done with '''NetworkManager Applet''' which offers also selection of access points for wireless connection. The use case is static configuration with wrong DNS server IP. In this case a device is considered as being successfully activated and user is not given second chance to configure network. i.e. to change device configuration or to enable another device (for example when adding network repo or iSCSI drive in stage 2 for the latter). It would be nice to have chance to change network configuration of installer environment at any moment, something like '''NM''' systray icon. The question is how to integrate it in anaconda UI, there are UX design concerns and technical concerns (NM Applet's is using freedesktop.org systray interface specification). Other possibility is to add reconfigure option just to places where network can be enabled which is ad hoc solution with issues. I proposed patches for these two approaches (they concern only [[Anaconda/Network#gui | GUI]]) on anaconda-devel-list:
* Configuration of successfully activated device in installer environment can't be changed (related bugs: [https://bugzilla.redhat.com/show_bug.cgi?id=592856 bug 592856], [https://bugzilla.redhat.com/show_bug.cgi?id=504983 504983], [https://bugzilla.redhat.com/show_bug.cgi?id=635239 635239]). There is no way to disconnect the device and activate it so that changed configuration could be applied (except for workaround by [[Anaconda/Network#configfiles | editing configuration files]]). In desktop, this is done with '''NetworkManager Applet''' which offers also selection of access points for wireless connection. The use case is static configuration with wrong DNS server IP. In this case a device is considered as being successfully activated and user is not given second chance to configure network. i.e. to change device configuration or to enable another device (for example when adding network repo or iSCSI drive in stage 2 for the latter). It would be nice to have chance to change network configuration of installer environment at any moment, something like '''NM''' systray icon. The question is how to integrate it in anaconda UI, there are UX design concerns and technical concerns (NM Applet's is using freedesktop.org systray interface specification). Other possibility is to add reconfigure option just to places where we might want it. It would require our own UI implementing the functionality of NM Applet. I proposed patches for these two approaches (they concern only [[Anaconda/Network#gui | GUI]]) on anaconda-devel-list (follow the links for screencasts):
** [http://www.redhat.com/archives/anaconda-devel-list/2010-October/msg00201.html Our own UI], which has some functional limits.
** [http://www.redhat.com/archives/anaconda-devel-list/2010-October/msg00201.html our own UI] - it has some functional limits an was kind of first draft with UI to be polised.
** [http://www.redhat.com/archives/anaconda-devel-list/2010-November/msg00144.html Integration of '''NetworkManager Applet'''] requiring use of panel (systray) which changes UI significantly.
** [http://www.redhat.com/archives/anaconda-devel-list/2010-November/msg00144.html Integration of '''NetworkManager Applet'''] requiring use of panel (systray) which changes UI significantly.


Places in stage 2 where network (re-)configuration would be useful (independently of network enablement, that is no matter if we already have a connection):
* Places in stage 2 where option of network (re-)configuration would be useful (regardless of network enablement).
* Standard step to configure network optionally (the ''hostname'' screen). It is in anaconda.
** Standard step (the ''hostname'' screen) with optional network configuration. It is actually there.
* Advanced storage screen.
** Advanced storage screen.
* Repository UI screen. Note that this wouldn't help in case of failing base repository editing which happens in dialog before repository UI screen step (tasksel step) so successful enablement of network with wrong static values (e.g. dns) is fatal here. I attempted to reorganize repository UI to overcome this https://www.redhat.com/archives/anaconda-devel-list/2010-September/msg00181.html.
** Repository UI screen. Note that this wouldn't help in case of edit of failing base repository which happens in dialog before repository UI screen step (tasksel step) so successful enablement of network with wrong static values (e.g. dns) is fatal here. I attempted to reorganize repository UI to deal with it <ref>https://www.redhat.com/archives/anaconda-devel-list/2010-September/msg00181.html</ref>.  
** Before reboot to give chance to automatically activate a device after reboot, see this [[Anaconda/Network#dvdonboot | issue]].


* IPV6
* IPV6

Revision as of 13:39, 3 March 2011

Network enablement and network configuration

Two tasks:

Network enablement in installer

Configure and activate a network device to be used during installation, e.g. to get kickstart, packages, or for network-backed storage. The configuration can be supplied with boot parameters, or kickstart, or if needed user will be prompted to configure a device in UI. Network enablement can happen in loader or in stage 2:

  • In loader:
    • for kickstart network command
    • if network is needed in loader, e.g. to fetch kickstart or updates over network, or in case of vnc install (TODO: in case of using sshd)
    • in rhel5 also in case of network installations (i.e. using remote stage 2 or repositories)
  • In stage 2, using text mode UI or GUI:
    • when setting up network attached storage (iscsi, fcoe)
    • when using network repository

Additional devices can be activated in GUI, using NetworkManager Connection Editor (nm-c-e) by checking Connect Automatically. Since RHEL 6 and Fedora 15/16?, additional devices can be activated (in loader) using kickstart network option --activate (this can be needed e.g. when downloading packages from one NIC/subnet and having iSCSI target on separate NIC/subnet).

Once the device is activated, it can't be reactivated with changed configuration (e.g. static configuration with fixed nameserver, see bug 504983). I want to offer this possibility in GUI which requires option to activate/disconnect a device on demand (see device activation). It can be worked around by editing configuration files.

Network configuration of target system

Can be done with kickstart or in GUI using nm-c-e. Undesirably, checking Connect Automatically in nm-c-e will activate the device after the configuration is saved (see ONBOOT side-effect). I am not aware of any problems caused by this side effect which is invisible to the user (Anaconda doesn't wait for NetworkManager activating the device), but I can imagine there might be some lurking.

As you can see, configuration of installer environment and target system is not well separated. It is because using nm-c-e for enablement we have to use the same configuration files for installer and target system configuration.

On Live CD, network is configured in Live CD environment using NetworkManager Applet on panel.

Modes of configuration

Boot options

These anaconda boot options can be used to enable network in loader (e.g. for getting kickstart, updates image, or for vnc): asknetwork, dhcpclass, dhcptimeout, dns, essid, ethtool, gateway, ip, ipv6, ksdevice, linksleep, mtu, netmask, nicdelay, noipv4, noipv6, wepkey

Kickstart

Kickstart network command can be used both to enable and configure devices. The behaviour has been changing in the course of adoption of NM.

  • RHEL 5 - in case of network installation the first network command from kickstart activates or reactivates (if the device has already been enabled e.g. to get kickstart using default DHCP or configuration given in boot parameters) relevant device with configuration set by the command. For non-network installs (e.g. for media or hd install) the device of the first network command is only configured for target system. Other network commands only set configuration for target system, the devices are not activated in installer.
  • RHEL 6.0, Fedora 14 - the same as in RHEL 5, but already activated device is not reactivated with configuration set in network command [1], it is only configured for the target system. Another difference from RHEL 5 is that the first network command device is activated also for non-network installs [2].
  • RHEL 6.1, Fedora 15/16? - expected behaviour is the same as in RHEL 5 (bug 668395) with option to activate additional devices using new network --activate option (bug 638131). Note that the device from first network command is (re)activated regardless of the option (to keep the behaviour of RHEL 5).

For RHEL 6.0, Fedora 14, and later, devices that are supposed not to be activated in installer and have onboot option set will be activated just before downloading packages due to ONBOOT side-effect. We have no reports of problems caused by this, but in some cases activation of the device could cause change of routing table making packages inaccessible.

Loader text UI

Serves for selection and/or configuration of a network device that should be enabled in loader. It is skipped if the information is provided via boot options or kickstart unless required by boot option asknetwork. Configuration options of this UI are a subset of nm-c-e which is used in GUI.

Once the device is successfully activated, there is no possibility to change its configuration in loader UI (see bug 504983).

Device selection:

Configuration of selected device:

The IPv6 options correspond to following options of nm-c-e:

  • Automatic
  • Automatic, DHCP only
  • Manual

Static (Manual) configuration:

  • Gateway: entry is used both for IPv4 and IPv6, only one gateway is allowed. Bad, but same as with boot options and kickstart.
  • Name Server: entry can contain more name servers separated by comma.
  • IPv4 Address: and IPv6 Address: is present only if manual configuration of respective protocol is selected in previous dialog.


Anaconda GUI

When enabling network in stage 2, this device selection / network enablement confirmation dialog appears:

Selected device will then be configured using NetworkManager Connection Editor (nm-c-e):

nm-c-e is run as separate process. Anaconda should ensure that the selected device will be actually activated in installer.

More of target system network configuration (beyond the devices that has been enabled in installer and the configuration they used) can be done from hostname screen by clicking on Configure Network button:

The saved (target system) configuration will not be applied to device that have been already activated in installer environment. To achieve this, the device must be deactivated and reconnected which can be done only from shell in tty2, for example by editing of configuration files. See this issue for details.

On the other hand, the device which had not been activated yet will be activated by checking Connect Automatically.


Text mode UI

Rather limited compared to nm-c-e.


Editing configuration files

Anaconda is communicating with NetworkManager mostly with ifcfg files (nm-c-e stores its configuration there too). It can be handy to edit them directly for debugging or as workaround solution. Files can be edited using shell in virtual terminal tty2 ([Ctrl][Alt][F2]). Their location is /etc/sysconfig/netwrok-scripts/ifcfg-<device name>. The configuration will be applied in installer after the device is disconnected (its ifcfg file is removed) and reactivated (an ifcfg file is copied back to its location with ONBOOT=yes set). So configuration of active device for installer environment can be changed this way:

mv /etc/sysconfig/network-scripts/ifcfg-eth0 /tmp
vi /tmp/ifcfg-eth0
mv /tmp/ifcfg-eth0 /etc/sysconfig/network-scripts

At the end of the installation, ifcfg files are copied to target system tree to directory /mnt/sysimage/etc/sysconfig/network-scripts.

Selection of device to be enabled in installer

This is behaviour in rhel6-branch which should go into rawhide soon (but probably not into F15):

  • ksdevice boot option.
  • Automatic use of device on which iBFT with active link was detected.
  • Kickstart network --device option. For the first network command defaults to ksdevice boot option, device used to fetch kickstart, or prompt in loder UI (how about detected iBFT device with link?). For next network commands --device option is mandatory (will be enabled only with --activate option set).
  • Dialog in loader UI if none of above applies.

Wireless

Passing SSID and WEP key with boot parameters or kickstart is supported in Fedora 14. Other methods of authentication can be set in GUI using nm-c-e, although there are some issues with AP selection which should be solved with integration of NetworkManager Applet.

Status updates can be found in comments of bug 473803 or on feature page Support wireless networking during installation.

Bugs and issues

  • DVD install defaults to ONBOOT=no leaving networking down after reboot - bug 498207. This is rather sore issue. Only devices enabled during install will have set ONBOOT=yes by default. For other devices, the setting has to be configured.
    • Before rebooting we could detect having no device to be activated automatically and offer change on the last screen (probably with just Configure Network button on the screen).

  • No more than one device can be activated in installer with kickstart (e.g.: one NIC for repositories, another for iSCSI). Bug 638181. Done in rhel 6.1 - in testing.
  • Reading configuration from iBFT in anaconda instead of passing the task to NetworkManager and dracut. Bug 634016. Done in rhel 6.1 - in testing.

  • Configuration of successfully activated device in installer environment can't be changed (related bugs: bug 592856, 504983, 635239). There is no way to disconnect the device and activate it so that changed configuration could be applied (except for workaround by editing configuration files). In desktop, this is done with NetworkManager Applet which offers also selection of access points for wireless connection. The use case is static configuration with wrong DNS server IP. In this case a device is considered as being successfully activated and user is not given second chance to configure network. i.e. to change device configuration or to enable another device (for example when adding network repo or iSCSI drive in stage 2 for the latter). It would be nice to have chance to change network configuration of installer environment at any moment, something like NM systray icon. The question is how to integrate it in anaconda UI, there are UX design concerns and technical concerns (NM Applet's is using freedesktop.org systray interface specification). Other possibility is to add reconfigure option just to places where we might want it. It would require our own UI implementing the functionality of NM Applet. I proposed patches for these two approaches (they concern only GUI) on anaconda-devel-list (follow the links for screencasts):
  • Places in stage 2 where option of network (re-)configuration would be useful (regardless of network enablement).
    • Standard step (the hostname screen) with optional network configuration. It is actually there.
    • Advanced storage screen.
    • Repository UI screen. Note that this wouldn't help in case of edit of failing base repository which happens in dialog before repository UI screen step (tasksel step) so successful enablement of network with wrong static values (e.g. dns) is fatal here. I attempted to reorganize repository UI to deal with it [1].
    • Before reboot to give chance to automatically activate a device after reboot, see this issue.
  • Support for stateless dhcp6 in loader UI - should happen in nm-c-e first as we provide only subset of it bug 656335
  • [Back] in loader UI, Manual TCP/IP Configuration screen, doesn't work in F15. It does on rhel6-branch so I guess it got screwed up in master by some other patch since I had fixed it (commit ec146852176e2b41ace7725ed8eda337842d3160).