Introduction: A static IP address ensures that your server maintains a consistent address, which is important for various server functions and network configurations. This section outlines the steps to assign a static IP address to your server running Ubuntu.
Steps:
-
Determine Network Configuration:
- First, identify the network interface name that you want to assign a static IP address to. You can find this information by running the following command:
ip a - Note the interface name (e.g., "eth0" or "ens33") for the subsequent steps.
- First, identify the network interface name that you want to assign a static IP address to. You can find this information by running the following command:
-
Edit Network Configuration File:
- Open the network configuration file for editing using a text editor. For example:
sudo nano /etc/netplan/01-netcfg.yaml - Find the network configuration for the chosen interface and update it to specify the static IP settings. Replace the placeholders with your own values:
network:version: 2renderer: networkdethernets:eth0: # Replace with your interface nameaddresses: [YOUR_STATIC_IP/24]gateway4: YOUR_GATEWAY_IPnameservers:addresses: [DNS_SERVER_1, DNS_SERVER_2]
- Open the network configuration file for editing using a text editor. For example:
-
Apply Network Changes:
- After editing the configuration, save the file and apply the changes by running:
sudo netplan apply
- After editing the configuration, save the file and apply the changes by running:
-
Verify IP Configuration:
- Confirm that the static IP address is set correctly by running:
ip a show eth0 # Replace with your interface name
- Confirm that the static IP address is set correctly by running:
-
Restart Networking:
- To ensure that the static IP is properly configured, restart the networking service:
sudo systemctl restart systemd-networkd
- To ensure that the static IP is properly configured, restart the networking service:
Conclusion: By following these steps, you have successfully assigned a static IP address to your Ubuntu server. A static IP address provides stability and predictability to your server's network configuration, making it easier to manage and access services consistently.
Search
Popular Posts
Installing Kasm Workspaces and Setting Up SSL with Let’s Encrypt
16/12/2023
How to install applications (WordPress, Joomla, Drupal, Magento, and many more) automatically with cPanel?
26/01/2023
How to change the timezone in cPanel Webmail
22/08/2023
Troubleshooting Server Connection Issues After Running a MikroTik Conversion Script
16/12/2023