These are Google Public DNS, and we will use them as our DNS resolver.
![centos 7 static ip ping not working centos 7 static ip ping not working](https://support.nagios.com/kb/assets/Screenshots/Configuring_Your_Server_With_A_Static_IP_Address/33_confirm_changes.png)
If you wish to know more about vi, Ryan Chadwick made a simple explanation of how it works, see his work hereįrom here, add these links below: nameserver 8.8.8.8 This should let us edit our file using vi. For starters, vi is a Command Line Editor. You can view these changes by: ls -lah | grep resĪt this point, we should be able to add lines on our resolv. To go about this, run: cd /etc/įrom here, make a backup copy of your nf file first, by: cp nf nf_backup You should have these output below:Īll set? Let us work with our name servers in nf file found in etc directory. In my case, I was using my Wireless Adapter. Look for Default Gateway under your network adapter. If you have challenges where to get your Default Gateway, you may open your cmd on your Windows host machine, then type: ipconfig Make sure to press ctr + c, the type :wq to save your changes. Let us add these lines below: NETWORKING=yes Let us now add lines to network work file by: vi network If you wish to see your backup file, run: ls -lah | grep net Then, let us make a backup copy of our network file, by: cp network network_backup Now, let us setup our gateway by going to sysconfig directory. Press ctr + c, the type :wq to save these changes. IPADDR represents your desired IP for your Virtual Machine.
#CENTOS 7 STATIC IP PING NOT WORKING UPDATE#
Then update the these lines below: BOOTPROTO=static Now, we have our back up file, let us edit ifcfg-enp0s3 by: vi ifcfg-enp0s3 This should list files on our current directory as shown below:
![centos 7 static ip ping not working centos 7 static ip ping not working](https://i.stack.imgur.com/GAPS4.png)
If you wish to see your back up file, run: ls -lah | less
![centos 7 static ip ping not working centos 7 static ip ping not working](https://www.tecmint.com/wp-content/uploads/2014/07/Start-Newtork-in-Linux-620x304.jpg)
Let us backup our ifcfg-enp0s3 file first, by running: cp ifcfg-enp0s3 ifcfg-enp0s3_backup From here, go to the directory as shown below: