Posts

Showing posts from October, 2024

How to assign Static IP address to CentOS virtual machine through command prompt

 Step 1: Identify the Network Interface Run the following command to list all network interfaces and their current configurations: Command- ip a Identify the name of the interface for which you want to assign a static IP address (e.g., eth0, ens33, etc.). Step 2: Edit the Network Configuration File Network interfaces are configured in files located under /etc/sysconfig/network-scripts/. You need to edit the configuration file of the specific network interface. For example, if the interface is eth0, open its configuration file with: Command- sudo vi /etc/sysconfig/network-scripts/ifcfg-eth0 Step 3: Modify the Configuration In the configuration file, you need to ensure that the settings reflect the manual IP address assignment. Update or add the following lines: TYPE=Ethernet BOOTPROTO=static NAME=eth0 DEVICE=eth0 ONBOOT=yes IPADDR=192.168.1.100    # Replace with your desired IP address NETMASK=255.255.255.0    # Replace with your appropriate netmask GATEWAY=192.168.1.1      # Replace w