After the last-year msec rewrite for Mandriva 2009.1, my goal was to do something similar with netprofile, yet another Mandriva-specific tool, with lots of unique functionalities, but.. abandoned for about 4 years.

What is netprofile? The idea of this application is quite simple. For different network environments one requires different network settings. For example, you may use a fixed IP at home, with firewall disabled, and no proxy. At work, you must use a corporate proxy and a DHCP address for your ethernet connection. And while at a LAN house or Internet cafe, a full-featured firewall must be used, your ethernet connection disabled and a tor proxy (for example) to be in effect.

How to achieve this in a working system? Usually you must manually reconfigure the network settings, edit configuration files for network, firewall and proxy, and so on. And this is where netprofile comes into action.

The netprofile uses the concept of network profiles to represent different network environments. You start with the ‘default’ profile, and you may use your system normally. If you want to setup a different network environment, you may ’switch’ to a different profile (a new profile will be created if necessary). Your current settings will be saved to your previous profile, and all changes to system configuration will now apply to your new profile.

To illustrate:

  • You configure your system to use fixed IP address and a specific firewall configuration.
  • You go to work, where different network environment takes place. You switch to the work profile (‘netprofile switch work’, or using net_applet gui), and if it is the first time you use this profile, it is created with base on your current settings.
  • You configure your network card to use DHCP, configure your corporate-specific proxy and firewall settings, and continue using your machine normally.
  • When you come back home, you switch the profile back to default, and your previous settings are restored.

You may also specify what network profile to use on boot, by passing the ‘PROFILE=‘ option to the boot loader. If you have multiple profiles, and no boot parameter was specified, a menu dialog will appear on boot asking you to select the profile to use.

The new netprofile is based on modular architecture. While we have a core application (netprofile), all functionality is performed by modules. Right now we have the following modules:

  • network – to store/restore network settings: ethernet, ppp, isdn, wireless and other connection settings.
  • firewall – to manage firewall (iptables and shorewall) settings
  • firewall6 – to manage firewall settings for IPv6 networks
  • proxy – to manage system-wide proxies.

Also, I am thinking on the following modules:

  • netfs – to manage remote shares and network file systems. For example, at work you may access a centralized NFS server, and at home a SMBFS/CIFS connection to your home server.
  • authentication – you may use local users at home, and ldap/yp authentication at work. Transparently. With one mouse click/command to switch between them :) .

The inevitable question: why do we need it if we have NetworkManager and similar apps? Well, I have a few arguments:

  • NetworkManager is great, has a modular design, and also supports network profiles. However, it is focused on network settings only, and not on proxy, firewall, authentication, and so on.
  • NetworkManager is also based on a pluggable architecture. However, it is not that easy to write plugins for it.
  • Not all distributions support NetworkManager. Netprofile, on its turn, will work on any unix system (or, even better, on anything that support running shell scripts. Yes, you can use it on windows too, with a few hacks :) ). Of course, it works better on Mandriva because it has drakxtools – Mandriva-specific scripts and applications. And we have draknetprofile as part of drakxtools, which works as shown on the following screenshot:
draknetprofile application to control netprofile profiles in Mandriva Linux

draknetprofile application to control netprofile profiles in Mandriva Linux

That’s it for now. If you want to experiment with netprofile, feel free to download it and play with it. It should be available on next Mandriva Linux 2010.0 release together with many other exciting new features :) !