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 192.168.190.200 netmask 255.255.255.0
route add default gw 192.168.190.1 eth0

Replace 192.168.190.200 by the IP address you want to set and 192.168.190.1 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. 192.168.190.200).
Alt-o (Routing)
Type in the IP address of the gateway (e.g. 192.168.190.1)
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. Required fields are marked *