Static IP with NetPlan

I have a dev server with a Comcast static ip that has worked wonderfully for 10 years...went to upgrade to Ubuntu 18.04 and whats this NetPlan biznezz and why will it not accept my subnet?

Followed all documentation from Comcast (like I have every other time I have formatted this machine) and it is asking for bit set. I generally know what this means but I am lost...

Let me be a tad bit clearer...I am doing a fresh install and choosing my network device from the start...so essentially setting up the netplan config from "go"....

9

2 Answers

That is called CIDR notation where the first part is your IP address like 192.168.1.100 and the second part is your netmask like /24.

Together they would look like:

192.168.1.100/24

The /24 CIDR is actually for the netmask like the following:

CIDR | MASK
/24 | 255.255.255.0
/25 | 255.255.255.128
/26 | 255.255.255.192
/27 | 255.255.255.224
/28 | 255.255.255.240
/29 | 255.255.255.248
/30 | 255.255.255.252
/31 | 255.255.255.254
/32 | 255.255.255.255 

/24 is the most common in home networks. Linksys and other such routers will assign on IPv4 DHCP records that will look like 192.168.1.100 where the gateway or router IP address is 192.168.1.1. And with a subnet mask of /24 or 255.255.255.0 that means that the IP address octets have to match from 192.168.1.xxx where the last 3 digits can be anything from 1-254 to be in the same subnet.

One tool that I use on a daily basis especially with my job is the Online IP Subnet Calculator. Just to give you something along what your IP might be. I am not sure what your IP is. I am assuming it is a Public Static IP. So, I am going to use a made up IP as 74.172.65.26 with your mask of 255.255.255.252.

enter image description here

Just on the quick image there we can see that the Mask Bits is 30, so the notation would be 74.172.65.26/30 Which would mean that our gateway should be 74.172.65.25 which has to be in the same subnet as our IP address. Clicking on the CIDR just above switches to a slightly different calculator, but I input the same information and received about the same in return.

enter image description here

There we can see that our route would be 74.172.65.24 as our network and our network CIDR Notation would be 74.172.65.24/30 but that is not our IP address. Our broadcast on that network is 74.172.65.27 as that is the highest IP. This is the equivalent of an IP of 192.168.1.15 mask 255.255.255.0 network where our network CIDR Notation would be 192.168.1.0/24 and our broadcast would be 192.168.1.255 and our gateway IP would be more than likely at 192.168.1.1.

Hope this helps!

5

The way you do it at the beginning of Ubuntu 18.x plus installation, if you go static is:

Netmask: 10.10.10.0/24 (don´t put 255.255.255.0, it won´t work)
IP: 10.10.10.20
GW: 10.10.10.1
DNS: 10.10.10.1 etc

That should work!

1

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