Re: CIDR vs aliases with ifconfig/hostname.if

2020-12-02 Thread Stuart Henderson
On 2020-12-03, Greg Thomas  wrote:
> Nope, as mentioned it's the network address, for every subnet you're going
> to get a network address and a broadcast address, and your usable IPs in
> between.

When it's used as an ethernet-type network, yes. If it's routed to you via
another link (for example if you get a /29 from an ISP and it's routed to
you via ppp or via a separate link network) you can often use those
first/last addresses, at least for nat/port forwarding.




Re: PayPal pool for developer M1 Mac mini for OpenBSD port

2020-12-02 Thread Otto Moerbeek
On Thu, Dec 03, 2020 at 03:18:54AM +0200, Mihai Popescu wrote:

> I have only good wishes for the project, but I still don't get one thing:
> why do some people start to behave oddly whenever Apple comes into
> discussion.
> They are doing a proprietary thing, closed as hell, no documentation and so
> on. Why is this impulse to write code for such a thing. Just asking ...

It's a new interesting ARM platform with very good performance. Yes,
it is closed but it's also kind of a nice challenge to overcome that
hurdle. So mixed feelings about that part.

-Otto



Re: CIDR vs aliases with ifconfig/hostname.if

2020-12-02 Thread Chris Bennett
On Wed, Dec 02, 2020 at 10:51:34PM -0800, Greg Thomas wrote:
> Nope, as mentioned it's the network address, for every subnet you're going
> to get a network address and a broadcast address, and your usable IPs in
> between.
> 
OK, that's very clear the way you just said it. That explains really
well why CIDR is so important - clarity.

Thanks,
Chris



Re: CIDR vs aliases with ifconfig/hostname.if

2020-12-02 Thread Greg Thomas
Nope, as mentioned it's the network address, for every subnet you're going
to get a network address and a broadcast address, and your usable IPs in
between.

On Wed, Dec 2, 2020 at 10:45 PM Chris Bennett <
cpb_m...@bennettconstruction.us> wrote:

> On Wed, Dec 02, 2020 at 11:26:15PM -0500, Allan Streib wrote:
> > Mike Coddington  writes:
> >
> > > 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.
> >
> > There is also ipcalc in packages and that is one I use frequently,
> > though it's only for IPv4.
> >
> > $ ipcalc 104.149.1.112/28
> > address   : 104.149.1.112
> > netmask   : 255.255.255.240 (0xfff0)
> > network   : 104.149.1.112   /28
> > broadcast : 104.149.1.127
> > host min  : 104.149.1.113
> > host max  : 104.149.1.126
> >
> > Allan
> >
>
> So, what happens with 104.149.1.112? Does anybody get to actually use
> it? Or is it just a placeholder?
>
> I never really paid a lot of attention to CIDR until I started to need a
> lot of IP addresses for websites, email, etc. for TLS/SSL certs.
>
> I stumbled upon this server where I have my other two and I couldn't
> pass up $31 a month. I can't reasonably backup properly at home, too
> slow a connection.
>
> Chris
>
>
>


Re: CIDR vs aliases with ifconfig/hostname.if

2020-12-02 Thread Chris Bennett
On Wed, Dec 02, 2020 at 11:26:15PM -0500, Allan Streib wrote:
> Mike Coddington  writes:
> 
> > 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.
> 
> There is also ipcalc in packages and that is one I use frequently,
> though it's only for IPv4.
> 
> $ ipcalc 104.149.1.112/28
> address   : 104.149.1.112
> netmask   : 255.255.255.240 (0xfff0)
> network   : 104.149.1.112   /28
> broadcast : 104.149.1.127
> host min  : 104.149.1.113
> host max  : 104.149.1.126
> 
> Allan
> 

So, what happens with 104.149.1.112? Does anybody get to actually use
it? Or is it just a placeholder?

I never really paid a lot of attention to CIDR until I started to need a
lot of IP addresses for websites, email, etc. for TLS/SSL certs.

I stumbled upon this server where I have my other two and I couldn't
pass up $31 a month. I can't reasonably backup properly at home, too
slow a connection.

Chris




Re: CIDR vs aliases with ifconfig/hostname.if

2020-12-02 Thread Allan Streib
Mike Coddington  writes:

> 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.

There is also ipcalc in packages and that is one I use frequently,
though it's only for IPv4.

$ ipcalc 104.149.1.112/28
address   : 104.149.1.112
netmask   : 255.255.255.240 (0xfff0)
network   : 104.149.1.112   /28
broadcast : 104.149.1.127
host min  : 104.149.1.113
host max  : 104.149.1.126

Allan



Re: PayPal pool for developer M1 Mac mini for OpenBSD port

2020-12-02 Thread Caipenghui
I think it's going to start all over again, transplanting takes a lot of time, 
and there are too many unknowns.

Caipenghui

于 2020年12月3日 GMT+08:00 上午9:18:54, Mihai Popescu  写到:
>I have only good wishes for the project, but I still don't get one
>thing:
>why do some people start to behave oddly whenever Apple comes into
>discussion.
>They are doing a proprietary thing, closed as hell, no documentation
>and so
>on. Why is this impulse to write code for such a thing. Just asking ...


Re: CIDR vs aliases with ifconfig/hostname.if

2020-12-02 Thread Mike Coddington
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.



Re: PayPal pool for developer M1 Mac mini for OpenBSD port

2020-12-02 Thread Mihai Popescu
I have only good wishes for the project, but I still don't get one thing:
why do some people start to behave oddly whenever Apple comes into
discussion.
They are doing a proprietary thing, closed as hell, no documentation and so
on. Why is this impulse to write code for such a thing. Just asking ...


CIDR vs aliases with ifconfig/hostname.if

2020-12-02 Thread Chris Bennett
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?

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.
There was a mysterious problem that I had to get tech support to fix.
Signal not present. Whatever that meant.

This is a cheap clearance bare metal, so IPMI/KVM is Java based and I
can't work with that. I have an old version of OpenBSD that worked
somewhere for that, but it doesn't work here.
So I don't want to have tech support login.

I know, simple questions, but my search engine skills really don't work.

Thanks,
Chris Bennett




OpenBSD as a NAS

2020-12-02 Thread Ashton Fagg
Hi all,

I'm currently in the process of provisioning a new NAS for home. It's
replacing an older Synology unit that ticks me off in so many ways.

I am looking to hear other's experiences with using OpenBSD as a NAS -
specifically in terms of reliability, and for suggestions on how to
provision my storage.

I have an LSI card (supported by the drivers in OpenBSD) that is
currently flashed to IT mode, but it can of course flashed back to the
IR firmware which lets it act as a hardware RAID controller.

My needs for the NAS are as follows: NFS and Samba share support,
reasonable performance, some amount of tolerance to disk failure,
reliable and trustworthy software and file system, ability to closely
monitor disk/array health. By extension, it should also be as simple as
possible.

It might be nice to have it be able to host an iSCSI volume, but that's
not essential.

I don't care about bleeding edge performance, fancy web UIs or any other
"shiny" stuff.

By my estimates, OpenBSD with softraid volumes should tick all of those
boxes. The box will do nothing else besides be a file server. OpenBSD is
my preferred OS nowadays, but I am open to something else if it's the
best tool for the job. I guess I'm trying to find out if there's any
compelling reason why I *shouldn't* use OpenBSD with softraid.

(ZFS also scares me, btw. Maybe unjustifiably so, but it seems very
complex and I suspect much of the hype comes down to zealotry and
fanboyism.)

The questions I have are:

a) Is softraid reliable enough to support my use-case? Does anyone have
anecdotes to encourage/discourage use of softraid for this application?

b) Would I be better off using the LSI RAID controller for the arrays?

c) Bearing in mind that the provisioning scheme I have in mind is to
provision the disks in pairs (forming RAID1 arrays), thus resulting in
3-4 separate volumes (6-8 disks), is there any reason I should *not* use
OpenBSD, and look more toward something like TrueNAS or FreeBSD?

(Before anyone mentions it - Yes, I have a proper backup system. I do
not rely on the redundancy provided by RAID arrays in lieu of a real
backup. I have both a local backup and offsite backup.)

Thanks in advance.



PayPal pool for developer M1 Mac mini for OpenBSD port

2020-12-02 Thread Ben Goren
Greetings, all!

Patrick Wildt has set up a PayPal pool to raise funds to purchase an M1 Mac 
mini so he can start porting OpenBSD to the platform. If you’d like to be able 
to run OpenBSD on an M1 system, now would be a great time to throw some pennies 
his way.

The donation link: https://paypal.me/pools/c/8uPSkfNJMp

Read below for an idea of what one might expect if we can get a machine into 
Patrick’s hands.

Cheers,

b&

Patrick wrote:

> Yes, kettenis@ and me are the two ones doing the major work on porting
> to new devices.  Not sure if kettenis@ is interested, but I can ask him.
> I definitely am, a Mac Mini as a dedicated machine to do stuff with and
> not care about what is installed would really help.
> 
> Marcan has started a crowdfunding on Patreon.  He's a really capable
> person, and he'll definitely lay a lot of groundwork needed for porting
> OpenBSD to the platform.  He apparenetly will also do his work in a
> dual-licensed fashion, so the BSDs will easily profit from it.
> 
> So, the first steps are basically to follow Marcan's work and use all
> that information and code to port OpenBSD as well.
> 
> This *will* take some time, because essentially there are only the
> binary drivers, but it's doable and I think with a bit of patience
> we will have OpenBSD running on the M1 as well.
> 
> Biggest hurdle, as always, will be support for graphics acceleration.



Re: fortran

2020-12-02 Thread Stuart Henderson
On 2020-12-02, Артём Мазуров  wrote:
> Hello.
>
> How can I get fortran compiler ? The gfortran port is deprecated and
> flang is broken.
>
>

pkg_add g95 (no idea why the package has that name), the binary is
egfortran (like the other GCC compilers in ports the binary name is
prefixed 'e' to differentiate itself from the compiler that is in
base on some archs).

$ egfortran -v 
Using built-in specs.
COLLECT_GCC=egfortran
COLLECT_LTO_WRAPPER=/usr/local/libexec/gcc/x86_64-unknown-openbsd6.8/8.4.0/lto-wrapper
Target: x86_64-unknown-openbsd6.8
Configured with: /usr/obj/ports/gcc-8.4.0/gcc-8.4.0/configure 
--with-stage1-ldflags=-L/usr/obj/ports/gcc-8.4.0/bootstr
ap/lib --verbose --program-transform-name='s,^,e,' --disable-nls 
--with-system-zlib --disable-libmudflap --disable-lib
gomp --disable-libssp --disable-tls --with-gnu-ld --with-gnu-as 
--enable-threads=posix --enable-wchar_t --with-gmp=/us
r/local --enable-languages=c,c++,fortran,objc,ada --disable-libstdcxx-pch 
--enable-default-ssp --enable-default-pie --
without-isl --enable-cpp --prefix=/usr/local --sysconfdir=/etc 
--mandir=/usr/local/man --infodir=/usr/local/info --loc
alstatedir=/var --disable-silent-rules --disable-gtk-doc
Thread model: posix
gcc version 8.4.0 (GCC) 




fortran

2020-12-02 Thread Артём Мазуров
Hello.

How can I get fortran compiler ? The gfortran port is deprecated and
flang is broken.



Re: Bridging multiple WAN via VLAN

2020-12-02 Thread Stuart Henderson
On 2020-12-01, michal.lyszc...@bofc.pl  wrote:
> Hello,
> I was wondering if and how I could bridge 2 WAN interfaces into single
> cable over vlan. Sounds cryptic, so let's start with the diagram of what
> I'd like to achieve:
>
>   lte   wifi
>   \|/   \|/   I have 2 WAN interfaces, LTE and WIFI
>| |Both are connected to OBSD1 box via
>| |USB cable, installation is on a rooftop
>   +---+
>  | OBSD1 |   OBSD1 is a raspberry pi 4 network thingy
>   +---+
>   |   From the roof, to my server goes single
>   |   CAT5E ethernet cable
>   +---+
>  | OBSD2 |   OBSD2 is a firewall/router
>   +---+
>  |   |   |   The rest are various computers, I got that
>  |   |   |   part covered
>  |   |   |
>  LAN DMZ IOT
>
>
> Now, both LTE and WIFI are USB devices that can give OBSD1 direct
> IP address - like modem. I know I could simply operate OBSD1 like
> router - install dhcpd to give IP to OBSD2 and forward traffic with
> pf. But that seems like unnecessary overhead and I'd like to setup
> packet priority/queueing on OBSD2 and treat OBSD1 like a stupid device.
> 
> So I was wondering, is it possible to bridge network so that:
> (it's easier with another diagram)
>
>   IPIP
> 1.2.3.4   4.3.2.1
>   \|/   \|/
>| |
>  +-o-*-+  o - lte usb modem; * - wifi usb card
>  | | | |
>  |   vlan1 vlan2   |  OBSD1 packs raw layer2 frames into
>  | `+' |  separate vlans
>  |  |  |
>  +--o--+  o - em0 interface
> |
> | Data goes through single cable
> |
>  +--o--+  o - em0 interface
>  |  |  |
>  |.-+-.|  OBSD2 unpacks vlan1 and 2 into separate
>  |  vlan1   vlan2  |  virtual interfaces.
>  | 1.2.3.4 4.3.2.1 |
>  +-+
>
> Now I'd like for vlan1 and vlan2 on OBSD2 to have 1.2.3.4 and 4.3.2.1
> IPs, so that I can perform redundancy/load balancing/queueing/whatever
> directly on OBSD2 device, and treat OBSD1 like some kind of stupid
> switch/hub. Hope it's clear what I'd like to do.

This is clear, you have explained it well.

> Is it possible? Or am I imaging things and it's better to do it with
> dhcp/pf routing? If it's possible to do with vlans on layer2, then
> what am I suppose to look for? I can read man pages, but honestly
> I don't really know how to approach that problem, so some keywords,
> programs, rfcs would be nice to have:)

If they were wired ethernet interfaces then you could do this directly
with bridge. But bridge needs an ethernet-type layer 2 interface.

The LTE devices are a layer 3 type interface so this would need to be
routed (and usually also natted, unless you have a fancy provider that
can route a block of addresses to it).

With wifi, an AP often works by bridging to ethernet and that is OK,
but when connecting a wired device behind a wireless client there are
problems. The standard frame format has source/destination/AP MAC
addresses, but for "client bridge" to work it needs a fourth so it
can pass on the MAC address of the wired client. APs that support
WDS mode can cope with this, but OpenBSD doesn't have support for
this, either in client or in AP mode.

So normally you'll need to use routing and possibly NAT to have
OpenBSD connect a wired client to a wifi interface.

I think the way to get as close as possible to what you want with
OpenBSD in a way that will definitely work is to do this on OBSD1:

- configure whichever you consider the "main" connection to fetch
an address, use nat and routing to pass traffic to OBSD2 on one vlan

- configure the second connection and vlan2 in another rdomain. again
use nat and routing to pass traffic. (separate rdomain so you can use
the normal method to fetch an address/gateway without interfering with
the other interface).

However there is a possible hack to allow this for a single client.
I haven't tested but there is at least a chance that it may work.
You can try configuring the wifi interface "up" but with no IP address.
Use tpmr(4) instead of bridge(4) (they are configured the same way,
just with the different interface name). And on OBSD2 use "ifconfig
lladdr" to change the MAC address to that of OBSD1's wifi interface.


Whichever method you use on OBSD1 to get the connections across,
on OBSD2 you would configure the vlans however you want (maybe with
rdomains, maybe with route-to/reply-to, whichever is easiest).


Outside of OpenBSD, mikrotik has "LTE passthrough" which fetches the
address from the mobile network and doesn't use it itself but instead
passes it to a single host (done via DHCP with a short lease time),
so if the mobile network hands out an internet-routed IP the server
would be able to use it directly. They also support wifi client bridge
mode (or if you're unlucky and it doesn't work with the AP then can
be routed/natted).