Configure Static IP on SUSE Linux
Configure Static IP on SUSE Linux
IP Configuration can be achieved in 2 ways, firstly is to use the “yast” gui to configure IP settings. additionally you can 3 files on the system using nano, vi, or vim. Both methods will be listed here.
Configuring Using yast
#1 easiest solution is to enter “yast” at that terminal prompt, then use the arrow and tab keys to get to Network Devices -> Network Settings.
# yast
Manual Configuration
To setup Static IP configuration on SUSE Linux we need to we need to edit 3 files.
- /etc/sysconfig/network/ifcfg-eth0
- /etc/sysconfig/network/routes
- /etc/resolv.conf
Determine your network interface
# cd /etc/sysconfig/network/ # ls -la
Determine if you want to edit “ifcfg-eth0” or “ifcfg-eth1”, ect. In this example we will edit “ifcfg-eth0”.
# sudo nano ifcfg-eth0 or # sudo vi ifcfg-eth0
Examples of ifcfg-eth0 configuration
” /etc/sysconfig/network/ifcfg-eth0″
1.
BOOTPROTO='static' IPADDR='192.168.2.77' MTU='1500' NAME='' NETMASK='255.255.255.0' STARTMODE='auto' USERCONTROL='no'
2.
BOOTPROTO='static' BROADCAST='' ETHTOOL_OPTIONS='' IPADDR='10.0.0.150/24' MTU='' NAME='3c940 10/100/1000Base-T [Marvell]' NETWORK='' REMOTE_IPADDR='' STARTMODE='auto' USERCONTROL='no'
See ‘man ifcfg’ and /etc/sysconfig/network/ifcfg.template
Set DNS and default route
/etc/sysconfig/network/routes
default 192.168.2.1 – –
# cd /etc/sysconfig/network/
# sudo nano routes or # sudo vi routes
/etc/resolv.conf
nameserver 192.168.2.1
# cd /etc/
# sudo nano resolv.conf or # sudo vi resolv.conf
See ‘man routes’ for an explanation of this file.