

This is the default mode set on CentOS to get an IP address from the DHCP server. In this mode, the system will get an IP address from the DHCP server.

Now you can see the ip address 192.168.0.10 assigned to the interface enp0s3. Restart the network service using the below command. ONBOOT="yes" # Enable Network Interaface on boot In this mode, we will manually assign an IP address to machines. So, the interface file name will be ifcfg-eth0. In CentOS 6 / RHEL 6, the network interfaces are named eth0, eth1 and so on.

1 root root 376 Nov 24 03:05 ifcfg-enp0s3Īs per the above output, my system has a file ifcfg-enp0s3 since CentOS 7 / RHEL 7 uses consistent network interface naming. cd /etc/sysconfig/network-scripts/ ls -al ifcfg-* To set an IP address to an interface, go to /etc/sysconfig/network-scripts/ directory, there you will find a file ifcfg. Depends on hardware, the name of the interface will change. TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0įrom the above output, you can see my system has two interfaces namely lo and ifcfg-enp0s3. Use the ifconfig command to list interfaces. Let’s check the available interfaces on our system.
#Configure centos 7 static ip how to
Here I will show how to configure Static IP addresses for your machine and also configure the network interface to get an IP address from the DHCP server. This guide helps you to Configure IP Address in CentOS 7 / RHEL 7 & CentOS 6 / RHEL 6. To show a connection editor that supports adding, modifying, viewing and deleting connections.Just after the installation of operating systems, you must configure the network to access your system from outside. It is a curses?based TUI application for interacting with NetworkManager. To restart networking service, enter:įig.03: Testing networking and make sure everything is working How do I configure an eth0 interface with static network settings using Network Manager (method # 2)? You do not need to specify the network or broadcast address as this is calculated automatically by the system. # This is system specific and can be created using 'uuidgen eth0' command # Update/edit as follows for static IP configuration: HWADDR=00:08:A2:0A:BA:B8 # vi /etc/sysconfig/network-scripts/ifcfg-eth0 To configure an eth0 interface with static network settings using ifcfg files, edit or create a file with name ifcfg-eth0 in the /etc/sysconfig/network-scripts/ directory as follows: NAME="eth0" How do I configure an eth0 interface with static network settings (method # 1)?
