
The important items in the output should be that the interface is in an UP state AND the inet address is correct (and inet6 if defined).

Ping -c 4 The output will be something like: Now you will need to take the interface "down" and then back "up" again using the following commands: ifdown eno16777728Įxecute these commands to check your changes have been applied and that they are working: ip addr

Press Tab until the Quit button is highlighted and then press Enter You will be returned to the "Select A Device" screen. Press Tab until the OK button is selected press Enter to save the changes The following screenshot is an example configuration: If you want to define a static IPv6 address, follow the same steps above for the IPv6 CONFIGURATION section. Repeat these steps for the Gateway IP and DNS Servers fields Type a valid address with using CIDR notation, for example 10.25.40.70/16 Press Tab until you are on selector next to Addresses Press Tab until you are on (for IPv4) and press Enter Press Enter, select Manual from the list and press Enter Press Tab on your keyboard until you are on selector next to IPv4 CONFIGURATION You will now be presented with the "Edit Connection" screen. In this example eno16777728 is the default interface selected, press Enter You will presented with a list of devices: When you execute nmtui you will be prompted with a text based GUI:
#Centos 7 static ip address how to#
Please follow the steps in the "Manual IP Configuration" section that explains how to do this. Manually configure address in config file. Once installed execute the command again and proceed with the next step.
#Centos 7 static ip address install#
Install the package using yum (which assumes your server has internet access via it's DHCP address): yum install -y net-tools If you receive the following error: -bash: nmtui: command not found In your console session execute the command: nmtui

There's an easy way to perform these changes using nmtui (a text based GUI). If you have version 6 please go to the RHEL 6 | CentOS 6 | Oracle Linux 6 section. Version 7 will output something like: CentOS Linux release (Core) If you are unsure what version of RHEL / CentOS your VM is running on you can execute the following command: cat /etc/centos-release These steps are for RHEL 7 | CentOS 7 | Oracle Linux 7. After the DNS Server address is set above, the system will automatically modify this configuration file.Īfter a few simple steps, the IP of the virtual machine is always 192. to the nature of these changes it is recommended that you perform the actions while logged onto the console of the server, performing the changes from an SSH session may disconnect you from the server. Note: DNS1 must be set here, otherwise () cannot be performed.įinally, configure /etc/nf: nameserver 192.168.129.2 Then modify /etc/sysconfig/network-scripts/ifcfg-eth0: DEVICE="eth0" etc/sysconfig/network-scripts/ifcfg-eth0įirst modify /etc/sysconfig/network as follows: NETWORKING=yes Three configuration files are involved, namely: /etc/sysconfig/network Click NAT Settings to check the GATEWAY address: Select VMnet8 and remove the Use local DHCP service to distribute IP address to VMs option. Because the previously built MongoDB shard did not use a replica set, the current network has been under pressure recently, so I am going to study it, so I set up the environment in my computer's virtual machine, but I found that VMware set up DHCP before, so The IP in the virtual machine changes every time after restarting, causing the mongodb environment that has been built before to always have problems and it is troublesome to rebuild, so the steps to set a static static IP are very simple:
