How to set a static IP using netplan? (running Ubuntu Bionic server)
I've followed/looked at several guides (like this one) on how to do the above.
My problem is that no static IP is getting assigned to the built-in ethernet port. I have run Code:
netplan apply I am sure the ethernet port works as I was previously using it on Ubuntu 16.04 just before I decided to fresh install 18.04.2. Any ideas what I could be doing wrong? I am going to use the ethernet port to connect my main PC to the Ubuntu server via a crossover cable. If I set the ethernet port to use Code:
dchp4:true Thanks --------------------------- This is the output of Code:
netplan --debug apply screenshot of netplan --debug: https://i.imgur.com/lBIFoa1.jpg |
Static IP address using netplan
To configure Static IP address on your Ubuntu Bionic Server, you have to follow these steps:
1. Go to /etc/netplan/ directory in your server. 2. Now, you have to open a file called “01-netcfg.yaml” or “50-cloud-init.taml”. In this you have to Configure the following things: • addresses: Here, you have to enter static IP address here for example (192.168.1.50/24) • Gateway4: Here, you have to enter default gateway IP address for example (192.168.1.1) • Nameserver: You have to add DNS entry for example (8.8.8.8, 8.8.4.4) • Dhcp4: no 3. Now, you have to run “sudo netplan apply” command. 4. If there is an issue, you can run “sudo netplan –debug apply” command. |
My netplan config for reference. Spacing is very important. Do not use tabs. This is configured to use itself for dns.
Code:
network: Code:
network: |
Good info to know here!!!
|
Good info to know here!!!
|
All times are GMT -5. The time now is 04:03 PM. |