CentOS 7 Network-Scripts




Centos network-scripts directory is located at:
/etc/sysconfig/network-scripts/

To Configure an interface with DHCP:

[root@ConfigNotes ~]# cat ifcfg-eth0

TYPE=Ethernet
BOOTPROTO=dhcp
NAME=eth0
DEVICE=eth0
ONBOOT=yes

 

To Configure an interface with static IP with Jumbo Frame:

[root@ConfigNotes ~]# cat ifcfg-eth0

TYPE=Ethernet
BOOTPROTO=none
NAME=eth0
DEVICE=eth0
ONBOOT=yes
IPADDR=10.0.1.20
PREFIX=16
GATEWAY=10.0.1.1
MTU=9000

 

Example of Bonding two interfaces:

[root@ConfigNotes ~]# cd /etc/sysconfig/network-scripts/

[root@ConfigNotes network-scripts]# cat ifcfg-bond0
DEVICE=bond0
NAME=bond0
TYPE=Bond
BOOTPROTO=none
BONDING_OPTS="mode=1 miimon=100"
ZONE=public
BONDING_MASTER=yes
IPADDR=10.0.1.20
PREFIX=16
GATEWAY=10.0.1.1

[root@ConfigNotes network-scripts]# cat ifcfg-eth0
TYPE=Ethernet
BOOTPROTO=none
NAME=eth0
DEVICE=eth0
ONBOOT=yes
MASTER=bond0
SLAVE=yes
ZONE=public

[root@ConfigNotes network-scripts]# cat ifcfg-eth1
TYPE=Ethernet
BOOTPROTO=none
NAME=eth1
DEVICE=eth1
ONBOOT=yes
MASTER=bond0
SLAVE=yes
ZONE=public



Published by

Ferdy Mañago

Portland, Oregon