Howto configure Static IP Address on Centos 7

Howto configure Static IP Address on Centos 7

Interface MTU

Step 1: Check your network interface name and status

[root@IThelpblog ~]# ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eno16777736: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
link/ether 00:0c:29:6a:64:ed brd ff:ff:ff:ff:ff:ff
inet 10.236.10.18/24 brd 10.236.10.255 scope global dynamic eno16777736
valid_lft 5112sec preferred_lft 5112sec
inet6 fe80::20c:29ff:fe6a:64ed/64 scope link
valid_lft forever preferred_lft forever
[root@IThelpblog ~]#

Step 2:

[root@IThelpblog~]# vi /etc/sysconfig/network-scripts/ifcfg-eno16777736

TYPE=Ethernet
BOOTPROTO=static
DEFROUTE=yes
PEERDNS=yes
PEERROUTES=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_PEERDNS=yes
IPV6_PEERROUTES=yes
IPV6_FAILURE_FATAL=no
NAME=eno16777736
UUID=6da4496e-b785-4446-a970-0fd419164d02
DEVICE=eno16777736
ONBOOT=yes
IPADDR=10.3.4.5
NETMASK=255.255.255.0
GATEWAY=10.3.4.1
DNS1=8.8.8.8

Step 3: Restart network

[root@IThelpblog ~]# systemctl restart network

DONE. Thanks for using IThelpblog.com.

Tags:  

Leave a reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>