On Wed, Dec 02, 2020 at 06:49:01PM -0600, Chris Bennett wrote:
> Hi,
> after seeing a post here using CIDR, I re-read some manual pages.
> I have been using aliases, but it looks like using CIDR is the preferred
> method.
> Could someone explain that a little better than the manual pages do?
> An example might help better to explain why aliases are used when
> changing network numbers. Is it a short term fix?
> Is there a downside to using aliases vs CIDR?
 
So, I'm not quite sure what you mean because in hostname.if the term
"alias" refers to giving the interface more than one IP address. For
example, here's my hostname.if file, /etc/hostname.vr0.

inet 192.168.3.25 255.255.255.0
inet6 autoconf
inet6 alias 2001:470:314f:3::25 64

The first line is my IPv4 address, not in CIDR format. I am not sure
that you are even able to specify the address in CIDR, although I could
be wrong. This has been my setup for many iterations of OpenBSD.

The second line allows me to pick up an IPv6 address via my router's
SLAAC setup. Your ISP may or may not provide this. The third line is an
alias, where I am manually specifying which IPv6 address I'd like to
apply in addition to the addresses that are autoconf-ed. I do this
because I run a mail server and I want to make sure that the server does
its communication over a static IP address.

> My other question is what to put for the address.
> I have 104.149.1.112/28. Should I just put this?
> 113 is the gateway. What is 112? It doesn't ping.
> 113 pings even if the rest is inaccessible.

When you are assigned a range of IP addresses from your ISP, you are
given the range in CIDR format like you specify. For example, I have a
static IP address for my mail server and my ISP gave me the CIDR range
of 206.55.191.72/30. .72 is the "network address" and is unusable. .73
is my gateway and .74 is the actual, single IP address that I have
assigned to my server. That's why you can't ping .112. You can probably
give your server 104.149.1.114 and be good to go.

There was a useful tool that someone posted on misc a while back called
netcalc. I think this is its website:
https://jamsek.dev/posts/2019/Sep/21/ipv4-and-ipv6-cidr-subnet-calculator/
Check it out if you want to get a better grasp on CIDR notation.

-Mike

-- 
Put your Nose to the Grindstone!
                -- Amalgamated Plastic Surgeons and Toolmakers, Ltd.

Reply via email to