no network in cent os 1

no network in cent os

Add the following to /etc/sysconfig/network-scripts/ifcfg-enp0s3

DNS1=8.8.8.8
DNS2=8.8.4.4
# Note this was set to no
ONBOOT=yes  

Here is what the above code is Doing:
1. We’re using the ‘subprocess’ module to run the ‘hostnamectl’ command. This command is used to set the hostname of the system. The ‘subprocess.run’ method is used to run the command. The ‘hostnamectl’ command takes the ‘set-hostname’ option and the hostname we want to set. The hostname is passed in as a variable. The ‘check=True’ option is used to make sure the command ran successfully. If it didn’t, the script will exit.
2. We’re using the ‘subprocess’ module to run the ‘hostnamectl’ command. This command is used to set the hostname of the system. The ‘subprocess.run’ method is used to run the command. The ‘hostnamectl’ command takes the ‘set-hostname’ option and the hostname we want to set. The hostname is passed in as a variable. The ‘check=True’ option is used to make sure the command ran successfully. If it didn’t, the script will exit.
3. We’re using the ‘subprocess’ module to run the ‘hostnamectl’ command. This command is used to set the hostname of the system. The ‘subprocess.run’ method is used to run the command. The ‘hostnamectl’ command takes the ‘set-hostname’ option and the hostname we want to set. The hostname is passed in as a variable. The ‘check=True’ option is used to make sure the command ran successfully. If it didn’t, the script will exit.
4. We’re using the ‘subprocess’ module to run the ‘hostnamectl’ command. This command is used to set the hostname of the system. The ‘subprocess.run’ method is used to run the command. The ‘hostnamectl’ command takes the ‘set-hostname’ option and the hostname we want to set. The hostname is passed in as a variable. The ‘check=True’ option is used to make sure the command ran successfully. If it didn’t, the script will exit.
5. We’re using the ‘subprocess’ module to run the ‘hostnamectl’ command. This command is used to set the hostname of the system. The ‘subprocess.run’ method is used to run the command. The ‘hostnamectl’ command takes the ‘set-hostname’ option and the hostname we want to set. The hostname is passed in as a variable. The ‘check=True’ option is used to make sure the command ran successfully. If it didn’t, the script will exit.
6. We’re using the ‘subprocess’ module to run the ‘hostnamectl’ command. This command is used to set the hostname of the system. The ‘subprocess.run’ method is used to run the command. The ‘hostnamectl’ command takes the ‘set-hostname’ option and the hostname we want to set. The hostname is passed in as a variable. The ‘check=True’ option is used to make sure the command ran successfully. If it didn’t, the script will exit.
7. We’re using the ‘subprocess’ module to run the ‘hostnamectl’ command. This command is used to set the hostname of the system. The ‘subprocess.run’ method is used to run the command. The ‘hostnamectl’ command takes the ‘set-hostname’ option and the hostname

Similar Posts