管理不同的网络配置文件

Draknetprofile

简介

Mageia 会用默认参数自动配置系统中的每个网络接口。这对于大多数台式机用户来说已经足够,但可能不适用于需要频繁变换网络环境的机器。如果您需要在不同网络环境中使用电脑,则需要为网络设备保存多个配置,否则每当网络环境变更时您都得重新手动配置。

配置文件

Linux 默认为网络设备提供多配置支持。术语“网络配置”指一系列用于在特定网络环境中使用网络设备的配置。每个网络配置都包括一个名称(由系统生成的初始名称一般为“默认”);当您创建新的配置时,必须为它指定一个与其他配置不同的名称。

Draknetprofile

Draknetprofile 是Mageia 控制中心(MCC)中用于管理网络配置的简易模块。它可以:

  • 切换网络配置:您可以启用某个配置并将其应用到对应的设备;

  • 创建新的配置;

  • 删除现有配置。

运行 Draknetprofile

添加与切换配置

添加/切换配置的操作会影响到Linux系统中的所有用户。因此,您需要root权限来运行Draknetprofile。一般情况下,只需从Mageia控制中心(本身拥有root权限)中启动它即可。

图1:Mageia 控制中心 - 网络与互联网 选项卡

  1. 点击桌面的Mageia控制中心图标,启动Mageia控制中心;

  2. 点击“网络与互联网”选项卡

  3. 在“自定义和网络安全”一栏中,点击“管理不同的网络配置”(图1中用红色线条标出的图标)。

Draknetprofile can also be launched by a command-line instruction from a terminal emulator with root privileges (this may be helpful when standard-output or error-output from draknetprofile needs to be consulted - for instance for debugging). Simply type:

 draknetprofile 

After the launch, the main page of Draknetprofile will be displayed:

Figure 2: Management actions of Draknetprofile

The upper zone of the window contains the list of the names of all presently defined profiles. The bottom zone presents a series of buttons:

  • "Activate" ... establish the selected profile (top zone of the window) as the current profile (and save the properties of the old profile);

  • "New" ... create a new profile;

  • "Delete" ... delete the selected profile from the list of defined profiles;

  • "Quit" ... exit from Draknetprofile.

Before hitting the "Activate" or the "Delete" button, you have to select a profile from the list: select it by a left-button click on the name of the target profile.

Hitting the "New" button will launch an auxiliary window where you can type the name of the profile you want to create; this name must be different from any already existing profile. This profile will be created as a precise copy of the currently active profile and immediately activated as the current profile. You will probably then need to specify its properties (modify the automatically created configuration) in a second, independent action:

  • exit from Draknetprofile (hit the "Quit" button),

  • back in the "Network & Internet" tab, you select the tab "Set up a new network interface (...)" (marked with dashed red contour in Figure 1),

  • you then go through the steps for configuring the interface; they are similar to those you did for configuring the original interface during system generation - as documented in the Drakconnect manual.

The middle zone of the window is normally hidden, hit the "Advanced" button to make it visible. It should display the list of names of Draknetprofile "modules" (such as "network", "firewall", "urpmi"), each with a check-button next to the name; these check-buttons determine whether the properties controlled by that module are included into the profile or not.

Using a system that has more than one profile

In a system where several profiles are defined, an additional user interaction is required when the system boots: at the very end of the bootstrapping activities - just before the Desktop Environment starts - you will get a message like

 Select network profile: (1) default (2) roaming* 

Type 1 or 2 to select the "default", respectively the "roaming" profile, or carriage-return to select the profile that is marked with an asterisk (the profile that was active when the system had been shut down).

Presently (Mageia-5) there appears to be an intermittent problem: it happens that the system becomes unresponsive after soliciting the user to select a profile. The only way out of this situation is to launch another boot. This problem is under investigation.

Appendix: Files relevant to Draknetprofile

The configuration data of network interfaces are stored in the directory /etc/sysconfig/network-scripts/, in files with names like ifcfg-xxx.

The name of the currently active profile is maintained in the file /etc/netprofile/current .


CC BY-SA 3.0
loading table of contents...