How to setup static ip on Ubuntu Server 18.04 in VMWare Workstation 14

I am new so please bear with me.

I am on a laptop with Windows 10 (which totally sucks) connected by wifi, and trying to setup a static ip in Ubuntu Server 18.04 in VMWare Workstation 14. I have googled how to set this up with a static ip, but none of the directions worked for me. I have tried over and over, but I must be missing something. I admit my uderstanding is minimal, however I am trying to learn.

I understand that netplan is the new way as of version 17. Can anyone help me set this up? I do know how to view my virtual machine's ip information. However I cannot seem to configure it properly for the static ip address change. Is there anything speacial that I need to do outside of what google has?

I reinstalled the distro and used dhcp because I am a novice at configuring such networking settings. When I give the command: ip a I get this below....

root@servertest:~# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo valid_lft forever preferred_lft forever inet6 ::1/128 scope host valid_lft forever preferred_lft forever
2: ens33: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000 link/ether 00:0c:29:dd:61:82 brd ff:ff:ff:ff:ff:ff inet **192.168.159.134/24** brd 192.168.159.255 scope global dynamic ens33 valid_lft 1594sec preferred_lft 1594sec inet6 fe80::20c:29ff:fedd:6182/64 scope link valid_lft forever preferred_lft forever

I see that my local ip is "inet 192.168.159.134" is that correct?

How do I take this information and make the changes needed to have a static ip in my virtual machine?

Google gave me a .yaml file in /etc/netplan/ that you must make changes on:

**network:

version: 2
renderer: networkd
ethernets: eth0: dhcp4: no dhcp6: no addresses: [192.168.1.70/24] gateway4: 192.168.1.1 nameservers: addresses: [192.168.1.1, 8.8.8.8, 8.8.4.4]**

I plugged in my info but my machine lost connection after. Unless I leave dhcp on, I am stuck. I am trying to practice hosting my own small websites as training to learn linux administration. If I can finally get this static ip right, I can move on to LAMP. If anyone can help a noob out, I'd appreciate it more than you know. Thanks for reading this long post if you made it this far. I await your instructions jedi master!....Lol...seriously though.

Reset to default

Know someone who can answer? Share a link to this question via email, Twitter, or Facebook.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like