Software >> OS >> Unix >> Linux >> OpenSUSE >> 15 >> How to configure dynamic or static IP on network interfaces


## interface config files are in /etc/sysconfig/network
## file named as ifcfg-[interface_name]
## e.g. ifcfg-eth0

## For help, check /etc/sysconfig/network/ifcfg.template
## VALUES can be enclosed with ' or without

## EXAMPLE for DYNAMIC IP (DHCP)

NAME='eth0'
BOOTPROTO='dhcp'
STARTMODE='auto'
ZONE=''


## EXAMPLE FOR STATIC IP

NAME='eth2'
BOOTPROTO='static'
STARTMODE='auto'
IPADDR='192.168.0.108/24'
ZONE=''


## ALTERNATIVES to setting the subnet mask

NETMASK='255.255.255.0'

or

PREFIXLEN='24'


## Restart NetworkManager service to activate the changes or reboot

systemctl restart NetworkManager