How To Configure Static Ip Address On Centos 7: 9 Radenko Bogdanovic
How To Configure Static Ip Address On Centos 7: 9 Radenko Bogdanovic
vi /etc/sysconfig/network-scripts/ifcfg-enp0s3
HWADDR=08:00:27:6C:FF:91
TYPE=Ethernet
BOOTPROTO=static
DEFROUTE=yes
PEERDNS=yes
PEERROUTES=yes
IPV4_FAILURE_FATAL=no
IPADDR=192.168.0.88
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_PEERDNS=yes
IPV6_PEERROUTES=yes
IPV6_FAILURE_FATAL=no
NAME=enp0s3
UUID=ea68db6e-461e-427d-b9a8-bfcf6e1a4fc6
ONBOOT=yes
vi /etc/sysconfig/network
And add following line:
NETWORKING=yes
HOSTNAME=centos7
GATEWAY=10.1.1.253
vi /etc/resolv.conf
nameserver 8.8.8.8
nameserver 8.8.4.4
/etc/init.d/network restart
ip addr
9 Comments
Saji
27/01/2016 at 18:52
I think you did not mention the subnet mask in the ifcfg file.
Reply
Ali
07/05/2016 at 22:57
Reply
Bilcic
22/12/2016 at 09:16
PREFIX=24
Reply
Steve
06/04/2017 at 03:38
Reply
Z. Rather
19/07/2017 at 14:51
Hi,
I have set the network configuration , All correct , But when i run ifconfig
-a i get wrong Gateway IP address. How can i fix or where can i chagne or
correct these settings. From the interface and /etc/sysconfig/network-
scripts/ifcfg-em1 all seesm to br correctly set.
Reply
Rasho
19/07/2017 at 22:34
Try this
$ nmtui edit your_interface
Reply
Z. Rather
20/07/2017 at 08:16
Thanks nmtui helped me to change the hostname, But i still face issue
with Default Gateway. i cannot ping to ouside network.
Reply
yoyo
07/10/2017 at 23:46
Reply
Fahad
14/05/2018 at 14:11
Reply
This site uses Akismet to reduce spam. Learn how your comment data is processed.