User Tools

Site Tools


databaseandnetworkmanagement:static_ip_on_redhat

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
databaseandnetworkmanagement:static_ip_on_redhat [2017/08/22 12:13] 1carew1databaseandnetworkmanagement:static_ip_on_redhat [2021/06/25 10:09] (current) – external edit 127.0.0.1
Line 1: Line 1:
 +====== Set Static IP on RedHat ======
 +  * # check the connected interface - usually eth0 but could be eth1, this affects what file we want to edit
 +  * ifconfig
 +  * # backup the config file of that interface 
 +  * sudo cp /etc/sysconfig/network-scripts/ifcfg-eth0 /home/scotty/backup/ifcfg-eth0.backup
 +  * # A Config File without a static IP will look like :
  
 +<code>
 +DEVICE=eth0
 +HWADDR=F4:CE:46:89:DD:D0
 +TYPE=Ethernet
 +UUID=1c4472a7-41a3-43bf-8b16-c0643976b2f8
 +ONBOOT=yes
 +NM_CONTROLLED=yes
 +BOOTPROTO=dhcp
 +</code>
 +
 +  * # A config file with a static IP will look like :
 +
 +
 +<code>
 +DEVICE=eth0
 +TYPE=Ethernet
 +UUID=1c4472a7-41a3-43bf-8b16-c0643976b2f8
 +ONBOOT=yes
 +NM_CONTROLLED=no
 +BOOTPROTO=none
 +HWADDR=F4:CE:46:89:DD:D0
 +IPADDR=10.91.100.71
 +PREFIX=24
 +GATEWAY=10.91.100.1
 +DNS1=10.91.100.71
 +DNS2=10.5.5.15
 +DEFROUTE=yes
 +IPV4_FAILURE_FATAL=yes
 +IPV6INIT=no
 +NAME="System eth0"
 +</code>
 +
 +  * # make change as appropriate to the appropriate config file 
 +  * # save and exit
 +  * # Be 100% confident with your changes - if you are not do not do this
 +  * sudo service network restart
 +  * # The server should now have the static ip you assigned it