Configure Netconfig for Modem Use

By: cprause

March 24, 2009 11:30 am





In SLE 11 we have a new (better) way to set up automatic network configuration.

It’s called netconfig (man 8 netconfig). Its a “modular tool to modify network configuration”.

Well on my SLED 11 RC1 Box it pretty much worked out of the box. Except:

Netconfig uses a bunch of scripts in /etc/netconfig.d to do the actual work. Its configuration resides in /etc/sysconfig/network/config

The following tries to fully explains what is happening. If you’re just interested in the Solution skip down to Summary.

The modem device Problem

I use a Nokia E51 for UMTS/3G Internet connection when on the road. The setup is fairly easy using a USB Cable. Just plug in the Phone and configure it as if it was a USB Modem. (for Bluetooth setup see Accessing the Internet via Bluetooth and Mobile Phone )

Unfortunately when I do that I never got DNS servers put into /etc/resolv.conf.

What is happening

netconfig uses a bunch of script (modules) to decide what to do in certain situations. The Modules are configured using the NETCONFIG* Variables in /etc/sysconfig/network/config.

The variable NETCONFIG_DNS_POLICY is used to control how netconfig should set up Name Servers in /etc/resolv.conf

Excerpt from /etc/sysconfig/network/config (default):

## Type:        string
## Default:     "auto"
# Defines the DNS merge policy as documented in netconfig(8) manual page.
# Set to "" to disable DNS configuration.

Unfortunately man 8 netconfig only has this to say about NETCONFIG_DNS_POLICY:

NETCONFIG_DNS_POLICY -Defines the DNS merge policy.

Nothing about what the actual Values could be.

The /etc/netconfig.d/dns-resolver script is responsible for setting resolv.conf so we find our possible values here:

Excerpt from /etc/netconfig.d/dns-resolver (SLED 11 Rc1 Version):

# just for the case we need the original value...
if [ "$_NETCONFIG_DNS_POLICY" = "auto" ]; then
    if [ "x$NETWORKMANAGER" = "xyes" ] ; then
        # Use NetworkManager policy merged data
        # We use static settings and extend them
        # with interface specific if available
elif [ "x$_NETCONFIG_DNS_POLICY" = "x" ]; then
    # empty policy means do not touch anything.
    # successful exit.
    exit 0;
# A * or ? is evaluated in the "for loop", so we need to replace it
        sed 's/\*/__ALL__/g' | sed 's/\?/__ONE__/g'`

    case "$POL" in
        if [ "x$NETWORKMANAGER" = "xyes" ] ; then
            debug "Use NetworkManager policy merged settings"
            if [ -r "$CFG" ] ; then
                get_dns_settings "$CFG"
        debug "Keep Static"
        debug "Static Fallback"
        # revert the replacement; now we want the evaluation
        POL=`echo "$POL" | sed 's/__ALL__/*/g' | sed 's/__ONE__/?/g'`
        debug "Other: $POL"
        for IFDIR in $STATEDIR/$POL; do
            test -d "$IFDIR" -a \
                 -d "/sys/class/net/${IFDIR##*/}" || continue
            # proceed every interface we find with this match
            manage_interfaceconfig  "$IFDIR"

This tells us that we can use the values auto, STATIC, STATIC_FALLBACK, NetworkManager and /sys/class/net/ Interfaces ( with * and ? wildcards ).

The Cause

What it also tells us is that the default auto only is translated to STATIC_FALLBACK NetworkManager and no devices.

This is why any ppp or modem device connections will not be used for Name Server setup in the default configuration.

There is a good reason for that. /etc/resolv.conf only supports up to 3 nameserver Entries.

This means if you have for instance 2 DNS Servers in ppp and 2 more coming from NetworkManager one is going to fall off the grid.

So for the sake of a stable NetworkManager setup the default was chosen to not include ppp* or modem* devices. See bnc#429772)

The Solution

Configure NETCONFIG_DNS_POLICY to include all Network Devices we need. In my case I need modem0. Of cource preserve STATIC and NetworkManager as well. Put NetworkManager last. Its a bit of a Bully and wants to be the last one to do things.

Excerpt from /etc/sysconfig/network/config


Et voila! Working DNS resolving when dialing in via Modem.


To be able to have DNS resolution when dialed in via modem configure netconfig to look for your (ppp or modem) devices:

Excerpt from /etc/sysconfig/network/config


Please be aware that all sources might provide Name Servers. This could mean that there will be more that the max of 3 for /etc/ressolv.conf.

0 votes, average: 0.00 out of 50 votes, average: 0.00 out of 50 votes, average: 0.00 out of 50 votes, average: 0.00 out of 50 votes, average: 0.00 out of 5 (0 votes, average: 0.00 out of 5)
You need to be a registered member to rate this post.

Tags: ,
Categories: SUSE Linux Enterprise Desktop, Technical Solutions

Disclaimer: As with everything else in the SUSE Blog, this content is definitely not supported by SUSE (so don't even think of calling Support if you try something and it blows up).  It was contributed by a community member and is published "as is." It seems to have worked for at least one person, and might work for you. But please be sure to test, test, test before you do anything drastic with it.

1 Comment

  1. By:tsurmacz

    More convenient is to use UMTSMon application which handles the GSM modem connections.

    For SLED 11 you can try the build: