Amarisoft

How to configure a static IP address ?

 

To configure a network interface with a static ip address, create a file called

ifcfg-

under the folder

/etc/sysconfig/network-scripts

where is the interface name as reported by the "ifconfig" command.

Example: ifcfg-en01

Edit the file and add the following:

TYPE=Ethernet PROXY_METHOD=none BROWSER_ONLY=no BOOTPROTO=static IPADDR=192.168.1.22 NETMASK=255.255.255.0 BROADCAST=192.168.1.255 NETWORK=192.168.1.0 GATEWAY=192.168.1.1 DEFROUTE=yes IPV4_FAILURE_FATAL=no IPV6INIT=yes IPV6_AUTOCONF=yes IPV6_DEFROUTE=yes IPV6_FAILURE_FATAL=no IPV6_ADDR_GEN_MODE=stable-privacy NAME=en01 #UUID=ec72a8b6-4113-3c91-bbe8-cd87f515637c HWADDR=f0:2f:74:80:dc:48 ONBOOT=yes AUTOCONNECT_PRIORITY=-999 DEVICE=en01 DNS1=8.8.8.8
  1. Modify IPADDR to match your desired static ip address.
  2. Modify HWADDR to match the MAC address, as reported by ifconfig command (ether)
  3. DEVICE must match the interface name reported by ifconfig command
  4. BROADCAST, NETWORK and GATEWAY have to be modified according to your local network.

After a reboot, the Ethernet port will take the fixed address if physically connected.