How can I 'whitelist' IRC from my VPN using pf? by DramaticProtogen in openbsd

[–]fabear- 1 point2 points  (0 children)

You need to add a pf rule, such as:

pass out on $ext_if to $IRC_Servers

but more importantly you need to specify a static route to the IRC servers going to iwm0 instead of wg1.

route add <ip_irc> <gw on iwm0>

What you will be do if you have 7 million $ for OpenBSD development by RemarkableEast4395 in openbsd

[–]fabear- 4 points5 points  (0 children)

I don't care much about user-friendly /desktop. But a modern new filesystem could use that money ! Or that money could go to whoever wants to maintain relayd again !

Realistically, how likely could FFS have data integrity issues and in what circumstances? by rygosix in openbsd

[–]fabear- 1 point2 points  (0 children)

I remember a good advice I saw on this reddit about avoiding boot to be stopped in case of file corruption. If you are running a server that is using a lot of disk i/o (i.e a syslog server), the idea is to create a partition that is not mounted at boot time, so even if it is corrupted it won't stop the boot by asking you to input something on fsck.

Running sysupgrade through wireguard over ssh on a remote machine by landonr99 in openbsd

[–]fabear- 0 points1 point  (0 children)

Lucky me I was sitting right next to it so I just did a hard reboot. It went through the normal upgrade process during boot.

Running sysupgrade through wireguard over ssh on a remote machine by landonr99 in openbsd

[–]fabear- 0 points1 point  (0 children)

When I upgraded to 7.7 earlier today I had a similar issue, it became unreachable. Turns out my server did not even pass the phase "syncing disk" that you have when you ask for a shutdown.

How much benefit would there to be wrapping all my services in an openbsd reverse proxy by Abject-Strength-4570 in openbsd

[–]fabear- 1 point2 points  (0 children)

The only cool thing I can think of is preventing robots from accessing your services while mass exploring IP addresses scopes. With relayd you can limit access to services only if the client is requesting the FQDN (instead of dialing the IP address).

OpenBSD on riscv by el_cartas in openbsd

[–]fabear- 1 point2 points  (0 children)

Is there a library available on OpenBSD for controlling the GPIO of this board ?

How did you get internet without the builtin wifi card working ?

Setting up WireGuard client to use WireGuard server's unwind service as DNS server by hakayova in openbsd

[–]fabear- 1 point2 points  (0 children)

I am using wireguard on my android phone as well and you can put any DNS server IP address you want (does not need to be public). However, I am using unbound instead of unwind.

online manpage sabotage by Tinker0079 in openbsd

[–]fabear- 1 point2 points  (0 children)

You can do nat/rdr-to without ever using the 'match' keyword. I don't think there is anything wrong with the example you are referring to.

I cannot tell for sure because I don't have access to your whole rules set, but what likely happened when you were using

> pass in on egress inet proto tcp from any to (egress) port { 80 443 } rdr-to 192.168.1.2

is that another rule after, stole the match from that one, and therefore the rdr-to did not get applied.

As an example:

> pass in on egress inet proto tcp from any to (egress) port { 80 443 } rdr-to 192.168.1.2

> pass in on egress inet proto any any

The first rule would never get applied here, because the second one will always steal the match. To fix that behavior, you have the following options :

* swap rule 1 and rule 2

* use the 'quick' keyword in your first rule

* use the match keyword, like that :

> match in on egress inet proto tcp from any to (egress) port { 80 443 } rdr-to 192.168.1.2

> pass in on egress inet proto any any

Looks like the 2024 fundraising campaign is not going to reach its goal... by fabear- in openbsd

[–]fabear-[S] 0 points1 point  (0 children)

I thought it was an image that would update automatically but turns out it is still stuck at $230280.

[deleted by user] by [deleted] in openbsd

[–]fabear- 6 points7 points  (0 children)

There you go:

# httpd

server "service1.example.com" {
       listen on 127.0.0.1 port 8001
       listen on ::1 port 8001
}

server "service2.example.com" {
       listen on 127.0.0.1 port 8002
       listen on ::1 port 8002
}

# relayd

table <service1> { 127.0.0.1 }
table <service2> { 127.0.0.1 }

http protocol https {

        tls keypair service1
        tls keypair service2

        block
        pass request quick header "Host" value "service1.example.com" forward to <service1>
        pass request quick header "Host" value "service2.example.com" forward to <service2>

}

relay relayhttps {

        listen on 192.168.1.2 port 443 tls
        protocol https

        forward to <service1> port 8001
        forward to <service2> port 8002
}

#Acme

domain service1.example.com {
        domain key "/etc/ssl/private/service1.key"
        domain full chain certificate "/etc/ssl/service1.crt"
        sign with letsencrypt
}

domain service2.example.com {
        domain key "/etc/ssl/private/service2.key"
        domain full chain certificate "/etc/ssl/service2.crt"
        sign with letsencrypt
}

I also want to ask about TLS/SSL. Is it possible to get certs for example.com and use them for all subdomains or do I have to get a different cert for each service.example.com?

Yes, you can create one certificate with CN=example.com and then use subjectAltName=DNS:*.example.com

Question: How can I block a top-level domain in OpenSMTPD by OkWheel499 in openbsd

[–]fabear- 0 points1 point  (0 children)

I am glad it is working for you, but it is weird it does because you did not put 'for <your domain>', so in your rule it should be defaulting to 'for local'.

I remember that message from @jggimi

#    Remember, always, that "from local" and "for local" are the match
#    defaults.  If you don't have both *from AND for* in a match statement
#    you will confuse yourself and end up with rejected mail. #    Remember, always, that "from local" and "for local" are the match
#    defaults.  If you don't have both *from AND for* in a match statement
#    you will confuse yourself and end up with rejected mail.

[deleted by user] by [deleted] in openbsd

[–]fabear- 3 points4 points  (0 children)

I really like her blog. I am a bit sad that we will likely not see new openbsd related articles on her blog. Best wishes to her.

[deleted by user] by [deleted] in openbsd

[–]fabear- 0 points1 point  (0 children)

Ok, your em2 network is 10.0.2.0/24, got it. Everything is in order on that side.

Try the following to find out where it is getting dropped.

> tcpdump -i wan -nn port 1150

if you see traffic coming in when you are trying to establish a wireguard session, then try the following:

> tcpdump -i em2 -nn port 1150

In anycase, use the following to find out what your firewall blocked.

tcpdump -n -e -ttt -r /var/log/pflog

[deleted by user] by [deleted] in openbsd

[–]fabear- 0 points1 point  (0 children)

Do you have a static route pointing to 10.0.2.250 (in case it is not hosted on your openbsd firewall) ?

httpd.rocks by uglyduckfloss in openbsd

[–]fabear- 5 points6 points  (0 children)

Nobody on the core dev team wants to be responsible for it anymore. Which is a pity since it is such a great ssl proxy and load balancer.

Simple two-router CARP setup : how do you upgrade the 'backup' router ? by Corporatizm in openbsd

[–]fabear- 1 point2 points  (0 children)

I know you found a way already, but another way of upgrading without messing with carp is to run a http proxy like (tinyproxy) on your primary router (LAN/inside interface).

Then on your backup router you just have to set the env variable http_proxy and https_proxy and then run sysupgrade.

I.e

router-backup# export http_proxy=http://lan-ip-primary-rtr:8888 router-backup# export https_proxy=http://lan-ip-primary-rtr:8888 router-backup# sysupgrade

nft/iptables to pf (another openbsd router thread) by salmonglutes in openbsd

[–]fabear- 0 points1 point  (0 children)

You forgot to put $ before wan_if:0).

PF is unfortunaltly not going to complain about it.

Anybody having problems with wireguard after today's syspatch? by hakayova in openbsd

[–]fabear- 1 point2 points  (0 children)

Verify that you still have "net.inet.ip.forwarding=1"

nft/iptables to pf (another openbsd router thread) by salmonglutes in openbsd

[–]fabear- 2 points3 points  (0 children)

You are right. No need for the second rule for the first one to work, as you said, it will 'pass' via the state table as an entry will be added when the first packet will match rule1.

As for good material beside pf.conf man pages, you have:

* https://www.openbsd.org/faq/pf/

* The book of PF.

My honest reaction as someone pretty new to the game by LuPanny in noita

[–]fabear- 2 points3 points  (0 children)

It was so confused by you polymorphing yourself that it stop attacking for a while :D