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.

Leave a Reply

Your email address will not be published.