To add a new IP address to your Ubuntu server, follow these steps:
- Identify Your Network Interface:
- Replace
eth1witheth0if necessary and note the result.
- Replace
- Edit the Netplan Configuration File:
- Locate or create the section for your interface, typically under
[eth0].
- Locate or create the section for your interface, typically under
- Add Your IP Address:
- Apply Changes:
- Troubleshooting:
- If the ping fails, wait up to 30 seconds for netplan to revert changes if necessary.
- Ensure correct syntax and permissions in the netplan file.
Open a new terminal and test the IP by pinging it:
ping 192.168.1.1
Apply the updated configuration with:
sudo netplan apply
Copy the provided IP address in the format AA.BB.CC.DD/XX (e.g., 192.168.1.1/24) and include it under the appropriate configuration:network: eth0: set physical set address XX.XX.XX.XX/YY
Once you know your interface (e.g., eth0), open the corresponding netplan file using a text editor:
sudo nano /etc/netplan/50-netplan.conf
Determine if your main network interface is eth0 or eth1 by running:
grep eth1 /etc/netplan/* -H
