SLES: Reconfigure a fixed IP address

We recently had a problem with a SLES virtual machine which was copied and where the network connectivity was broken because we ended up being in a different network. So we needed to reconfigure the IP-Address.

It’s easy to solve temporally:

ifconfig eth0 netmask
route add default gw eth0

Replace by the IP address you want to set and by the gateway address.

The IP address configuration will probably get lost on reboot.

A permanent fix with yast:

start yast from the command line.
Then select Network Devices > Network Card
Alt-h (Change…)
Delete the card with the old Mac-Address (probably called Ethernet Network…)
Edit the other one
Alt-t (Static address setup)
Alt-i (IP Address)
Type in the IP address you want the server to have (e.g.
Alt-o (Routing)
Type in the IP address of the gateway (e.g.
Alt-o (OK)
Alt-n (Next)
Alt-f (Finish)
Alt-q (Quit)

Execute the following to check that it’s fine:

ifconfig eth0

Then to check that the default gateway is properly setup, connect with putty.

Reboot the computer and check that everything is still OK.

Linux: Disable Address space layout randomization (ASLR) on SLES and Ubuntu

Address space layout randomization (ASLR) is a method to make hacker’s life more difficult by randomizing the position of the heap, stack, executable and libraries in the address space of the process. ASLR is enabled by default in Linux since kernel version 2.6.12.

It’s a nice security feature. Unfortunately it does break some software. If you run some software having this issue, you can switch off ASLR using the following:

sudo bash -c "echo 0 > /proc/sys/kernel/randomize_va_space"

to check the current value of the ASLR setting you can use the following:

cat /proc/sys/kernel/randomize_va_space

Linux: Determine the version of SLES Linux

If you need to find out your SLES (SuSE Linux Enterprise Server) version and service pack level from command line, you can use one of the following:

This one tells you the version, patch level and CPU architecture:

myserver:~ # cat /etc/SuSE-release
SUSE Linux Enterprise Server 11 (x86_64)

This one will only tell you it is a SLES server and which version:

myserver:~ # cat /etc/SuSE-brand

This one displays a welcome message with the version, service pack and CPU architecture:

myserver:~ # cat /etc/issue

Welcome to SUSE Linux Enterprise Server 11 SP1  (x86_64) - Kernel \r (\l).

This one gives you basically all you need to know:

myserver:~ # cat /etc/products.d/
<?xml version="1.0" encoding="UTF-8"?>
<product id="sle-11-server" schemeversion="0">
  <vendor>SUSE LINUX Products GmbH, Nuernberg, Germany</vendor>
      <repository path="obs://" />
      <repository path="obs://" />
      <repository path="obs://" />
  <upgrades />
  <summary>SUSE Linux Enterprise Server 11 SP1</summary>
  <description>SUSE Linux Enterprise offers a comprehensive
        suite of products built on a single code base.
        The platform addresses business needs from
        the smallest thin-client devices to the worldâs
        most powerful high-performance computing
        and mainframe servers. SUSE Linux Enterprise
        offers common management tools and technology
        certifications across the platform, and
        each product is enterprise-class.</description>
    <url name="releasenotes"></url>
    <url name="smolt"></url>
    <url name="register"></url>
    <releasepackage name="sles-release" flag="EQ" version="11.1" release="1.152" />
  <runtimeconfig />

zypper will also show you the SLES version and service pack:

myserver:~ # zypper sl
# | Alias                                            | Name                                             | Enabled | Refresh | Type
1 | SUSE-Linux-Enterprise-Server-11-SP1 11.1.1-1.152 | SUSE-Linux-Enterprise-Server-11-SP1 11.1.1-1.152 | Yes     | No      | yast2

You can also use sam to get this piece of information. But it actually does much more. By using the following options you can reduce the time it needs to run (by disabling some checks):

myserver:~ # sam --no-rpm-verify --no-header-sig-check
Supportability Analysis Module 0.8.2
*** Report by 'sam --no-rpm-verify --no-header-sig-check'
*** Installed versions:
  suse-sam-data    0.8.2-0.3.1
  satsolver-tools  0.14.17-0.2.18
  suse-sam         0.8.2-0.3.3
  perl-satsolver   0.14.17-0.2.18
*** Installed products: 1 (known vendors: 1)
  System architecture: x86_64
    summary:       SUSE Linux Enterprise Server 11 SP1
    name version:  SUSE_SLES 11.1
    SP, release:   1 1.152
    arch:          x86_64
    repository:    obs://
    repository:    obs://
    repository:    obs://
*** Found package repositories: 1 (reference 12, skipped 12, need refresh 0)
  Repository #1:
    name:          SUSE-Linux-Enterprise-Server-11-SP1 11.1.1-1.152
    label:         SUSE Linux Enterprise Server 11 SP1 (3)
    distribution:  SUSE_SLE
    version:       11
*** Considered packages:
    Packages belonging to defined products:  817
    Signed with accepted key:                not checked
    3rd party packages:                      0
    Skipped gpg-key packages:                9
*** Unsatisfied package dependencies: NOT CHECKED
*** Novell packages depending on 3rd party packages: NONE
*** Package version checks: all up to date
*** Modified filesystem objects: NOT CHECKED
*** Files not owned by any package: NOT CHECKED

*** Summary (see above or log for details):

  Product: SUSE_SLES 11.1 SP:1 release:1.152 x86_64

    Total packages installed:                         826
    Packages signed by Novell:                        817
    Packages matching installed products:             817
    Packages not created by Novell:                   0
    Unsupported Novell packages:                      0
    File modifications:                               (not checked)
    Unsatisfied dependencies:                         (not checked)
    Novell packages depending on 3rd party packages:  0
    Updates needed:                                   0
    Files not belonging to a package:                 (not checked)

Status and recommendations:

    Congratulations, your system has passed the supportability analysis!
      According to the tests performed by SAM, nothing has been detected
      which might exclude your system from receiving support from Novell.
      You may confidently deploy this system with support from Novell.

Note: sam has replaced SPident in SLES 11.

You can get information about the kernel version using:

myserver:~ # rpm -qf /boot/vmlinuz


myserver:~ # cat /proc/version
Linux version (geeko@buildhost) (gcc version 4.3.4 [gcc-4_3-branch revision 152973] (SUSE Linux) ) #1 SMP 2010-05-20 11:14:20 +0200

or simply:

myserver:~ # uname -a
Linux myserver #1 SMP 2010-05-20 11:14:20 +0200 x86_64 x86_64 x86_64 GNU/Linux