-
demido
i'm trying to learn how to use freebsd as a wireguard server to torrent through. i can connect and pass traffic but something feels like not all traffic is going through. i'm using pf.conf to nat traffic out from wg client and rdr traffic in to wg client.
paste.debian.net/hidden/551bbd71 anything i can do better pls?
-
ivy
demido: do you want all traffic on that system to go through the vpn, or only torrent traffic?
-
demido
well originally i just wanted the torrent traffic but now i'm trying anything, so i was basically passing ALL traffic through to wg client except the wg connection itself, and ssh
-
demido
kinda desperate to figure it out hehe
-
ivy
demido: okay, well rather than using pf nat, i'd suggest using separate fibs (routing tables). for all traffic, set the fib 0 default route to the wg interface and configure the tunnels in fib 1, or for only torrent traffic, set the fib 1 default route to the wg interface and start the torrent client in fib 1 (but you need to be careful of leaking DNS traffic here)
-
demido
ok can i ask eli5 why do "that"?
-
ivy
it's just neater - rather than messing around with NAT to make it work, you're just telling the kernel to do what you actually want, i.e. route traffic X via the vpn and traffic Y via the local router
-
ivy
also probably more reliable and easier to understand once you have it working :-)
-
demido
ah ok so my pf is kinda a hack and maybe abusing pf
-
demido
how do we work with fibs/routing tables?
-
ivy
so first off set net.fibs=1 and net.add_addr_allfibs=1 in /etc/sysctl.conf, then run "/etc/rc.d/sysctl start". now you have two routing tables, which you can view with "netstat -rn -F0" and "netstat -rn -F1"
-
ivy
er, net.fibs=2, sorry!
-
demido
should net.add_addr_allfibs=2 too? or 1
-
ivy
no, 1 is fine for that
-
demido
should i disable pf before doing this change?
-
ivy
if it says net.fibs is read only you need to set it in /boot/loader.conf instead, but i think it's been a dynamic tunable for ages
-
ivy
i would turn off your pf nat rules, you don't need to disable pf entirely if you have filtering
-
demido
no filtering atm. want to get a solid connection first, then i'll experiment with filtering
-
demido
ok i'll make those changes sec
-
» Afterglow is learning something here
-
Afterglow
I'm using FreeBSD since version 4.something, and I never heard of fibs (probably not knowing that I needed them :-) )
-
ivy
demido: actually, after you set that i suggest rebooting to make sure add_addr_allfibs takes effect (i think this is only applied when interfaces come up initially)
-
demido
ivy i have net.inet.ip.forwarding=1 in sysctl.conf, should i remove that? i read it was needed for the wg natting
-
ivy
that's not necessary for this setup but it won't hurt either
-
demido
i'll remove. k gonna reboot box sec
-
ivy
also, do you have IPv6 here or only IPv4? and is the internet connection doing anything weird like DHCP or is it just a static config?
-
demido
i didn't configure ipv6. don't know if it's automatic somehow?
-
demido
just static conf
-
demido
when reboot finishes i'll run netstat -rn -F0 and netstat -rn -F1 to look
-
demido
ok i looked at routing table and routing table (fib: 1)
-
demido
they look pretty similar at this point
-
ivy
yeah, they should be mostly identical except you won't have a default route in fib 1
-
ivy
so i guess to start with it's easier to just send all the traffic through wireguard
-
demido
ok yes
-
demido
all except the ssh into the wg server, and the wg client connection to the wg server which would create a loop, right?
-
ivy
first off you need to duplicate your current default route in fib 1, so for example "route add -inet default 1.2.3.4 -fib 1" (replace 1.2.3.4 with your default router), then make sure you can "setfib 1 ping freebsd.org"
-
ivy
yeah, the idea is to put wireguard itself in fib 1, which is similar to how linux does this with network namespaces
-
demido
ahhhh
-
ivy
(and probably sshd too)
-
demido
i ssh to wg server separately from the wg connection from wg client fyi
-
ivy
oh, do you have a serial / vnc console to access the server in case something goes wrong? this is not the type of config i like to do with only ssh access :-)
-
demido
ok so that route command will add default route to fib1, the wg connection fib, so that the wg connection has a way out to the inet using the vpn's static ipv4 ip?
-
demido
ya i do hehe
-
ivy
right, so to make it use that you need to put the wireguard interface in fib 1: "ifconfig wg0 tunnelfib 1"
-
demido
is it possible to put "route add -inet default 1.2.3.4 -fib 1" into a file like rc.conf so it's permanent? i'm afraid to just type it, then forget later what all i did
-
ivy
(there are two ifconfig options here, 'fib' would put the encapsulated traffic into fib 1, 'tunnelfib' puts the wireguard traffic itself into fib 1, which is what you want)
-
ivy
demido: yes, we'll set this up in /etc/rc.conf in a sec, if it works :-)
-
demido
ah ok great! sec i'll type
-
ivy
so the rc.conf option for the route is: static_routes="vpn"; route_vpn="default 1.2.3.4 -fib 1" (except use a newline instead of ';'), then you need to add tunnelfib to the ifconfig line, so something like ifconfig_wg0="<other stuff> tunnelfib 1"
-
demido
i ran sudo route add -inet default 1.2.3.4 -fib 1, then sudo ifconfig wg0 tunnelfib 1
-
demido
i don't have an ifconfig_wg0. i have ifconfig_vtnet0..., then i have wireguard_enable="YES" and wireguard_interfaces="wg0"
-
demido
is that a new line to add?
-
ivy
ah, you're using wireguard from ports, hmm
-
demido
yep
-
demido
it has config file in /usr/local/etc/wireguard/wg0.conf
-
ivy
there's a way to run a command in wg.conf for that, i think? in which case you'd want it to run 'ifconfig wg0 tunnelfib 1'
-
ivy
looks like PostUp=...
-
demido
sec
-
ivy
brb
-
demido
i still add static_routes="vpn"; route_vpn="default 1.2.3.4 -fib 1" to rc.conf right?
-
demido
(on 2 lines)
-
demido
ok i put those 2 lines into rc.conf, and the PostUp line into wg0.conf under [Interface]
-
ivy
yeah, that's right
-
demido
they match the sudo commands
-
demido
do i reboot now?
-
ivy
yes, reboot and make sure everything looks right
-
demido
ok ssh back in gonna run netstat -rn -F0 and netstat -rn -F1 now
-
demido
ok fib: 1 has default destination now
-
demido
which is the static ip of the server and its physical if
-
demido
well, "physical" (vtnet0)
-
demido
is that all? connect from wg client and it should be good?
-
ivy
the route should be via the ip address of your default router, not the server's ip address... whatever's currently in defaultrouter="" in /etc/rc.conf
-
demido
oh ok i'll fix that then reboot again sorry
-
ivy
same for the vpn route in rc.conf, that should be the same address as the default route
-
demido
that's the only place i had to fix the ip
-
demido
rebooting
-
demido
ok now both fibs have default route, and gateway is the same for both, the router ip
-
demido
now should wg client be connected?
-
ivy
yeah, wg should work now - after it comes up, make sure 'ifconfig wg0' shows 'tunnelfib 1'
-
demido
on the wg server right?
-
demido
wg0 has tunnelfib: 1!
-
ivy
is the machine you're working on now the client or the server? (i assumed this is the machine you're running the BT client on, or no?)
-
demido
while wg client reboots.. how does wg server know that traffic coming to it should get redirected to the wg client EXCEPT wg connections from the client, and ssh connections from 'any'?
-
demido
no i have 3
-
demido
this 1, the vpn server is a vps in a shitty host, then the 3rd box is on my lan for torrenting
-
demido
it's the wg client, the 3rd box
-
ivy
ah ok
-
demido
i ssh from this computer into both
-
demido
wg server and client
-
demido
how does wg server know that traffic coming to it should get redirected to the wg client EXCEPT wg connections from the client, and ssh connections from 'any'?
-
ivy
hm, this may actually be an unnecessarily complicated configuration for what you're trying to do :-)
-
demido
did we mess up?
-
ivy
i was thinking you wanted traffic from this machine to go over wireguard, but you want this machine to just be a router for another wg client, right?
-
demido
ya
-
demido
i want wg server to take connection from wg client, and basically pass ALL traffic through to/from wg client, as if wg client was the wg server
-
demido
except ssh connections to wg server, and wg connections to wg server from client
-
demido
it's so my isp doesn't see me running torrent traffic in/out
-
demido
lots of udp and other p2p stuff
-
ivy
hmm, in that case you don't need the fib stuff (sorry!) but you might still need the static route to route traffic over the wireguard tunnel... or are you doing that in wireguard config right now? iirc, wg-quick can add a route for AllowedIPs automatically, but in this case you'd want AllowedIPS to be 0.0.0.0/0
-
demido
btw wg client can ping wg server's private ip, but can't ping www.freebsd.org. wg client's wg0.conf has allowedips 0.0.0.0/0 for [peer]
-
demido
not doing any route stuff in wg on server or client
-
demido
only setting address, dns, private key, allowed ips, endpoint, publickey, and keepalive on client
-
demido
wg server wg0.conf has address, listen port, postup we added, privatekey, allowedips is wg private ip, publickey
-
demido
what should we do?
-
ivy
ok, so try this: remove the static route and fib config from rc.conf and the PostUp from wg config and reboot then, then in the server's wg.conf, you want something like "PostUp=/sbin/route add 192.16.0.10/32 wg0" ... i *think* AllowedIPs set to the client IP (192.168.0.10) there should be fine
-
ivy
although wg-quick may do this automatically, i'm not sure - if you start the wg tunnel without PostUp, do you see a route for 192.168.0.10 in netstat -rn?
-
demido
lemme reset. on wg server commented out postup. now going to comment out 2 fib lines from sysctl, then comment out static_routes and route_vpn from rc.conf. then reboot. good?
-
ivy
yep
-
ivy
don't put the PostUp with /sbin/route in yet, see what the routing table looks like first
-
ivy
i know wg-quick has some magic here, i just don't remember what it is exactly :-)
-
demido
yep, rebooting then will answer your q
-
demido
yea lol
-
demido
ok rebooted, on wg server, netstat -rn: 192.168.0.10 is in Internet: section, link#4 under gateway, UHS flags, wg0 netif
-
ivy
ok, make sure ip.forwarding is 1 still, put back your pf rule for 'nat on vtnet0', but not the rdr, just to test, then run 'tcpdump -ni wg0' on the server and try to connect to the internet from the client... you should at least see incoming traffic from the client
-
ivy
(i'm assuming the client is not freebsd)
-
demido
k sec. no client is debian
-
demido
ok forwarding is back in sysctl.conf. nat on vtnet0 from $wgclientip to any -> vtnet0, is back in /etc/pf.conf. reboot now?
-
demido
(then tcpdump)
-
ivy
you can probably just /etc/rc.d/sysctl start; /etc/rc.d/pf reload
-
demido
ok sec
-
ivy
on the client, just ping an IP address or something to avoid any other issues like DNS
-
demido
ok on wg client i ping www.freebsd.org ip, and i see in wg server tcpdump it go through
-
demido
oh not ntp went through too hehe
-
demido
wg client got reply too fwiw
-
demido
s/not/now
-
Afterglow
you're making a mistake here: wireguard doesn't know about server/client, only peers. And traffic goes from peer to peer, not 'through peers'. If you want a peer to route traffic for you to somewhere else than the peer, you need to NAT the traffic out of there
-
ivy
Afterglow: we're back to their original pf setup which has an outgoing nat for the wg peer
-
demido
-
demido
that was my pf.conf
-
ivy
(and yes, 'client' and 'server' is technically not correct terminology for pf, but... people do tend to use it :-)
-
ivy
s/for pf/for wg/
-
ivy
demido: so is the client internet working now (via wg)?
-
demido
so can i make my pf.conf better?
-
demido
lemme test
-
demido
ya i can curl an iso file
-
demido
and do dns queries etc
-
ivy
that's odd, since i think we're back to your original config that didn't work... does it still work if you put the rdr rules back as well?
-
demido
i didn't add the rdr nordr stuff back btw. only the nat
-
demido
do i even need them?
-
demido
i mean i guess so
-
demido
i do want the wg client to be 'as if' it is the wg server, in the datacenter and not in my home behind my isp
-
ivy
depends, if you want to receive incoming traffic then yes, although my preference would be to just rdr the specific ports you need
-
demido
well the wg client worked before as far as i could tell, it just didn't seem to get full bandwidth like it did from the server itself
-
ivy
(actually, my preference would be to use an entirely separate public IP address for incoming traffic, but i know that can be hard to do at cheap vps providers)
-
demido
so i felt like i must not be forwarding everything bidirectional
-
demido
ya
-
demido
maybe the problem was i wasn't redirecting everything, but only >1024?
-
demido
does anything <1024 make udp bandwidth better?
-
ivy
demido: are you downloading and uploading at the same time? because it's all going over vtnet0, your incoming traffic is duplicated as outgoing traffic and vice versa
-
demido
yea
-
demido
sorry i meant port 1024
-
ivy
(like say you have 100Mbps on the server, and the client is downloading something at 50Mbps, the server is sending 50Mbps of data out already, so the client would only be able to upload at 50Mbps...)
-
demido
yea
-
demido
what seems to happen is wg client doesn't establish as many p2p connections as wg server itself gets. for the same files
-
demido
so it just felt like the proxying had to be flawe
-
demido
d
-
demido
but you guys can't see a prob in my pf.conf so it must be ok?
-
demido
Afterglow you agree with ivy that
paste.debian.net/hidden/551bbd71 can't be improved?
-
shbrngdo
ivy - true for half duplex, but I think full duplex through a switch can get you close to full bandwidth. On a hub, probably not.
-
Afterglow
demido, I'm not very specialized with pf, but I'll take a look
-
demido
tyvm
-
demido
it's mostly/completely udp traffic going through fwiw
-
demido
but you see i redirected even tcp
-
demido
is there anything in that pf.conf that doesn't keep established connections alive? i guess that doesn't even make sense in context of udp
-
demido
find anything?
-
Afterglow
nope
-
demido
ok so it looks good then?
-
uskerine_
Hi, Is it possible to read the handbook for older versions? Like imagine I want to use the handbook for FreeBSD 5
-
uskerine_
-
uskerine_
-
uskerine_
that was posted in the wrong forum
-
nwe
does anyone here running FreeBSD on macbook air 2012 and have get touchpad to work? and can share configuration for xorg.conf.d/touchpad.conf ?
-
nwe
got it working now, forgot to add moused_port="wsp0" and moused_enable="YES" :)
-
Afterglow
how can I find the service listening on a certain port (tcp4 882) when sockstat gives me question marks on USER, COMMAND, PID and FD?
-
[tj]
k
-
[tj]
are you sure it is listening?
-
[tj]
does it appear in sockstat -sl
-
Afterglow
tcp4 0 0 192.168.13.16.882 *.* LISTEN
-
Afterglow
This is what netstat gives me
-
[tj]
and what does sockstat give you?
-
Afterglow
? ? ? ? tcp4 192.168.13.16:882 *:*
-
Afterglow
if I telnet into it, it sets up the connection
-
[tj]
with -ls?
-
Afterglow
? ? ? ? tcp4 192.168.13.16:882 *:* LISTEN
-
[tj]
cool, I have no idea
-
Afterglow
I'm now tcpdumping it to see if anyone connects. This machine exposes nothing to the internet, btw
-
ridcully
Afterglow: do you have lsof installed?
-
Afterglow
yup
-
mzar
Afterglow: sockstat -l and check suspicous PID
-
Afterglow
look at my sockstat output above: PID shows a questionmark
-
Afterglow
USER COMMAND PID FD PROTO LOCAL ADDRESS FOREIGN ADDRESS PATH STATE CONN STATE
-
Afterglow
? ? ? ? tcp4 192.168.13.16:882 *:* LISTEN
-
Afterglow
ridcully, trying `lsof -Pi4TCP | grep 882` doesn't show the process
-
Afterglow
ridcully, correction, doesn't show anything about port 882
-
Afterglow
To be complete: fstat -s | grep "tcp.*:882" isn't showing anything either
-
Afterglow
machine was rebooted yesterday, after upgrading to 14.2
-
kevans
Afterglow: the ? are specifically because there's no socket associated with it anymore
-
Afterglow
Found the culprit: after restarting lockd (nfs) the listening port vanished, and it opened another one
-
kevans
yeah that'd do it, too
-
uskerine_
Afterglow I had exactly the same finding today
-
uskerine_
-
» ivy spies a kevans
-
» kevans runs
-
mzar
have a nice run kevans
-
tsoome
.oO unleash the dogs:)
-
ivy
kevans: when you're done with your run please fix
bug 284857!
-
kevans
i can unleash dogs but one is a little dachsund/chihuahua thing and the other only has three legs
-
kevans
i can not run fast but i could probably outrun them
-
tsoome
:)
-
ivy
oh, a a ferret dog? we have one of those here
-
ivy
it can't go on a walk with the other dogs because it can't walk fast enough
-
kevans
ivy: I've still no idea how to fix this, I guess melifaro might have some idea
-
ivy
maybe i should try to fix it, it feels like it *should* be easy
-
ivy
last time i tried to fix a wg(4) everything went very badly though
-
kevans
i wonder where your EAFNOSUPPORT is coming from, precisely
-
ivy
i believe it must be in wg_output():
-
Afterglow
uskerine_, hope you did find the perp too
-
ivy
if (parsed_af != af) {
-
ivy
xmit_err(ifp, m, NULL, AF_UNSPEC);
-
ivy
return (EAFNOSUPPORT);
-
ivy
}
-
ivy
i could add some debugging logs if that would help, though
-
mzar
ivy: tunnelfib: 1 ≠route fib, what if tunnelfib = 0 ?
-
ivy
mzar: huh?
-
mzar
in your PR
-
ivy
which PR? 284857?
-
mzar
yes
-
ivy
i don't understand what you mean, "what if tunnelfib = 0" - but it's not, it's 1
-
mzar
OK, so set route with the same fib and use ping with the same fib and reproduce to make it consistent
-
ivy
huh? why? the route doesn't need to have the same fib
-
mzar
OK, if you think so
-
ivy
i know so, this is how tunnelfib works
-
mzar
cool
-
ivy
this is not a misconfiguration on my side, the problem is a missing feature in wg(4)
-
mzar
you have to submit a patch then
-
ivy
oh fuck off
-
ivy
i do not need to submit a patch just to report a bug
-
ivy
the bug exists, i reported it
-
ivy
obviously if i could fix it i would do, maybe i will have a go at that one day...
-
mzar
nice, but if you want to fix it, please submit patch
-
ivy
what is your point even
-
tsoome
we always encourage to submit patches;)
-
mzar
:=D
-
ivy
next question, why can't i get Cy's patch in
bug 284709 to work
-
ivy
for some reason the files that are meant to be in krb5-server keep ending up in krb5-libs
-
ivy
and the files that are meant to be in krb5-libs end up nowhere
-
ivy
okay, i think Cy's patch is wrong, this seems to fix it:
llfw/freebsd-ports 2dc14ff
-
kevans
ivy: yeah, if you can track it down (or ship me a VM or jail config that can reproduce it in isolation? that seems like it'd be feasible) I'd be happy to look more into it
-
ivy
kevans: i can give you two commands right now that would reproduce it?
-
kevans
alright let me grab my notepad
-
ivy
3!hemlock ~# ifconfig wg1 create inet6 -auto_linklocal -ifdisabled fe80::1/64 up
-
ivy
4!hemlock ~# route add -inet 192.168.1.1 -inet6 fe80::2%wg1
-
ivy
add host 192.168.1.1: gateway fe80::2%wg1 fib 0
-
ivy
5!hemlock ~# ping 192.168.1.1
-
ivy
PING 192.168.1.1 (192.168.1.1): 56 data bytes
-
ivy
ping: sendto: Address family not supported by protocol family
-
ivy
ping: sendto: Address family not supported by protocol family
-
ivy
you don't need a working wg peer since the bug is inside local packet processing
-
ivy
sorry, that was 3 commands, i lied :-)
-
kevans
ok fine
-
kevans
:-p
-
kevans
your guess about where it was erroring is infact correct
-
kevans
hmm, AFAICT that can likely just be removed and wg_xmit() will probably do the right thing; presumably your wg configuration would have IPv4 peers (we can have both IPv4 and IPv6 peers on one wg device, right?)
-
kevans
ivy: you want to test that with a valid setup?
termbin.com/l8t6
-
ivy
kevans: i have no ipv4 peers at all, but i'm happy to test this
-
ivy
patch applied, building now...
-
kevans
hmm, that probably won't really function, then
-
ek
Anyone else happen to be seeing strange issues with ROOT DNS servers right now?
-
mzar
ek: there are not thirteen but hundreds of root DNS server, so there's nothing to worry about
-
kevans
ivy: when I say 'ipv4 peers', I really mean one with some ipv4 allowed-ips which you'd need for the wg_xmit() lookup to work
-
mzar
kevans: does if (!(parsed_af == AF_INET || parsed_af == AF_INET6)) make any sense here ?
-
ek
mzar: Yeah. The problem I'm seeing is that I'm no longer able to look anything up.
-
mzar
I have just built and tested it, works for me
-
kevans
mzar: no, we'll get that same effect in wg_xmit() anyways
-
mzar
OK, so kill it
-
ivy
kevans: oh right -- all my peers have allowedips 0.0.0.0/0, ::/0. but they run over ipv6 transport
-
ivy
haven't tested yet as build is still running
-
kevans
ivy: ok, so yeah- I think just removing that check entirely makes sense and will fix it, but I'll wait for confirmation before throwing it into a review
-
mzar
I have looked at tests, but we are not tesing ip6 for wireguard
-
mzar
kevans: in my case it worked, but I have changed to (!(parsed_af == AF_INET || parsed_af == AF_INET6)) what probably be always false
-
kevans
determine_af_and_pullup() will notably not return anything but one of the two or an error
-
kevans
so maybe a better fit as an assertion, but I'd be inclined to just let wg_xmit() complain
-
mzar
we can MFC it to 14 too
-
mzar
I have not spotted such a check for other tunneling interfaces
-
Bushmaster
FreeBSD is working out for me
-
Bushmaster
could have been lot better if we could have postgreSQL client in ports
-
ek
Bushmaster: Not sure what you mean, but I see plenty of postgres clients available in ports.
-
Bushmaster
ek, can you point me one
-
Bushmaster
pgAdmin demand to work only with postgres older version and it removes my postgres17.4
-
Bushmaster
hence i cant work with pgAdmin
-
Bushmaster
do you have DBeaver in ports ek
-
ek
Bushmaster: /usr/ports/databases/postgresql17-client ? Not what you're looking for?
-
ek
Maybe our interpretations of "client" are different.
-
Bushmaster
yes that is what I am looking for
-
Bushmaster
you mean your interpretation
-
mzar
Bushmaster: there are some tricks you can try, likg locking the package, adding it by hand from file not repo, etc, you don't have to reubuild port in this case
-
mzar
s/liking/locking
-
Bushmaster
mzar, have you tested it, i am kind of new to BSD
-
Bushmaster
if you can help me to get pgAdmin install without it forcing me to remove postgre17 that would be BIG HELP
-
Bushmaster
right now, if I do pkg install pgadmin it will just ask me to remove postgre17
-
Bushmaster
that is not I am gonna do
-
Bushmaster
if you can walk me from here, that would be big help
-
mzar
Bushmaster: read about locking packages and adding pkg by hand, read pkg(8), search for lock and add
-
Bushmaster
not much help
-
mzar
dont't hesitate to do some experimentationg
-
Bushmaster
experiment is for syadmin
-
Bushmaster
i am not a sysadmin , I am Java Developer
-
mzar
you are probably one of devops ?
-
paulf
I'd keep quiet about that
-
mzar
ivy: thank you for fighting with bugs preventing IPv6-only deployment !
-
Bushmaster
mzar, no, not devops, java developer
-
mzar
Bushmaster: please don't hesitate to play a bit with packages, and you will be fine, there is no need to rebuild port in this case
-
Bushmaster
okay cool
-
Bushmaster
lot to catch up on when it comes to sysadmin, but yeah, I will look into it
-
hernan604
Bushmaster: pgadmin is an graphical user interface client.. client is just the console client
-
ivy
i really need a better build system than this Ryzen 2700X
-
Bushmaster
hernan604, i do not see any other SQL client in port collections, DBeaver is good one and like to see in port
-
Bushmaster
i mean you even have RKWard for R programming
-
hernan604
Bushmaster: stop saying client. you want a GUI
-
Bushmaster
why cant you integrate DBeaver
-
Bushmaster
these are SQL client, GUI client yes
-
hernan604
Bushmaster: there are plenty of clients for postgres ot mysql in ports/pkg
-
Bushmaster
hernan604, can you find me one?
-
hernan604
-
Bushmaster
let me check
-
Bushmaster
I am in FreeBSD 14.2
-
Bushmaster
not in 12.2
-
Bushmaster
you think it will work?
-
hernan604
should be the same
-
hernan604
or similar
-
hernan604
but you can always try a VM... or install pgadmin inside a linux vm
-
hernan604
check vm-bhyve to manage VMs
-
Bushmaster
this is web client, i may go for it
-
hernan604
its pgadmin4
-
kevans
ivy: I went to write a test for it, but I'm realizing my route(8) knowledge is nonexistent beyond the absolute most basic usage
-
kevans
ivy: going for the reverse situation because it's easier to just adapt an existing test: route add -inet6 2001:db8::/64 -inet 169.254.0.2 ->
-
kevans
add net 2001:db8::/64: gateway 169.254.0.2 fib 0: Invalid argument
-
kevans
that doesn't seem very invalid damnit
-
ivy
kevans: i have never tried adding an ipv6 route with an ipv4 nexthop, but are you sure 169.254.0.2 is directly reachable?
-
ivy
e.g. did you add 169.254.0.0/24 over a wg tunnel already
-
kevans
yeah, it's the other side of this tunnel
-
kevans
epair on the other side is 192.168.2.2, wg in the other jail has 169.254.0.2
-
ivy
it might be this simply doesn't work because no one would ever test it :-)
-
ivy
what does "route -n get 169.254.0.2" say?
-
Bushmaster
hernan604, that will not work, cos I have updated python in FreeBSD14.2
-
kevans
seems happy and describes a route to 169.254.0.0 with mask 255.255.255.0 via wg0
-
Bushmaster
and virtual machine option is absurd, why on earth I need to install Linux inside FreeBSD and then try to run pgAdmin from there
-
ivy
kevans: you should probably submit this as a bug :-)
-
Bushmaster
you have pgAfmin3 in ports ... all you have to do is find out a way to disentangle it from older version of portsgres
-
Bushmaster
so that it can work for any postgres version
-
Bushmaster
or add DBeaver in ports
-
ivy
kevans:
le-fay.org/tmp/7d/route.txt -- this is definitely a bug
-
ivy
probably a bug in netlink, that broke a lot of things
-
ivy
many of which have seen since fixed, but i doubt anyone is using ipv6 route with ipv4 nexthop
-
ivy
s/seen/since
-
» kevans grumbles
-
mzar
noone but Juliusz Chroboczek
-
mzar
-
mzar
that's new. though
-
ivy
babel users gonna babel use
-
hernan604
Bushmaster: then try building pgadmin from ports whith whatever version you want it to
-
Bushmaster
hernan604, as I said I am not sysadmin
-
Bushmaster
you said you have many SQL client, and then carried on talking 'crap' ... stay quiet my dude
-
hernan604
lol
-
hernan604
Bushmaster: you are lost. good luck
-
hernan604
Bushmaster: i will be telling my friends about this java developer... that never used freebsd, and he said freebsd has no clients for postgres LOL... and he is looking for a postgre client... and then when i suggested him to manually build a pgamin port, he said "he is not a sysadmin" hahahhahahaha
-
hernan604
welcome to the console my friend
-
hernan604
to unix
-
Bushmaster
you talking crap ... stay quiet
-
hernan604
you are a troll
-
hernan604
bye
-
nimaje
Bushmaster: pgAdmin works with any posgres version, the problem is that it has to be build for a concrete version, so it is build against the 'default' version, so either switch stuff to the default versions in the official pkg repos, build your own pkgs with changed default versions or search for some other solution
-
Bushmaster
nimaje, i understand , as I said I am not a sysadmin but yeah build your own pkgs with changed default versions is something I sure will able to do over time, I do not see you or anyone else can help me to get it down, if I wanna get it done, I sure can, just will take me time
-
Bushmaster
it should not be build against the default version, it should be independent cos it is simply a postgrSQL client, which should work for any postgreSQL versions. Same as DBeaver, it can work with any SQL servers, so do SSMS which work with any Microsoft SQL Server versions
-
kevans
ivy: weirdly enough I reconfigured it to use your original scenario and I get a routing error instead of EAFNOSUPPORT, but `route get` clearly indicates it trying to route traffic to this IP via wg0
-
mzar
??
-
ivy
kevans: on 15.0?
-
kevans
yeah
-
kevans
though I'm a few months old
-
ivy
it's possible this actually worked a few months ago, i'm sure i used it before, i only noticed it was broken recently
-
ivy
ah, build finished, let's test your patch
-
ivy
kevans: bad news, it still doesn't work, same error
-
ivy
[2!] uk-myb-1 /# route add -inet 192.168.1.1/32 -inet6 fe80::2c8f:916:ed09:eae1%wg.uk-aai-1
-
ivy
add net 192.168.1.1: gateway fe80::2c8f:916:ed09:eae1%wg.uk-aai-1 fib 0
-
ivy
[3!] uk-myb-1 /# ping 192.168.1.1
-
ivy
PING 192.168.1.1 (192.168.1.1): 56 data bytes
-
ivy
ping: sendto: Address family not supported by protocol family
-
ivy
wait
-
ivy
this is the wrong kernel
-
ivy
lmao i forgot to push
-
mzar
ha...
-
mzar
it worked for me, I applied on both ends
-
kevans
i cannot be held responsible for your shenanigans :-)
-
mzar
ivy: I am going to reply to your PR
-
mzar
ivy: I will submit a patch, which will probably be rejected ;-)
-
mzar
;-P
-
ivy
kevans: in my defense i'm working on like 5 PRs right now across src and ports
-
ivy
mzar: if it's just kevans' patch i assume he'll accept it? :-)
-
mzar
ha... that's different one
-
ivy
buildworld done (52 seconds), buildkernel done (25 seconds), now waiting for update-packages which is usually like 500 seconds
-
ivy
i wish we could find a way to make this faster
-
kevans
i just want this test case to work
-
kevans
i'm |-| here at posting a phab review, but I want to see a test case go vroom vroom firs.
-
kevans
first
-
ivy
i can't test this properly until i work out how to make OSPFv3 advertise IPv4 routes with IPv6 nexthop, which i'm honestly not sure is even possible with BIRD
-
ivy
but i can at least show you packets going over the tunnel
-
kevans
this routing table seems sane, right?
termbin.com/lx9z -- in this one, 2001:db8:1::1 is the local wg1, 2001:db8:1::1 is the remote wg2, 192.168.3.1 is some address on the other side
-
kevans
... ::2 is the remote wg2
-
kevans
ping: sendto: No route to host
-
ivy
that looks wrong, 192.168.3.0/24 is via 2001:db8:1::1, but 2001:db8:1::1 is via lo0
-
» kevans swaps it in for using the 'other side' of the tunnel as the gateway to same effect
-
ivy
perhaps you meant to add 192.168.3.0/24 via 2001:db8:1::2
-
ivy
ok, packages built, rebooting now
-
ivy
[3!] uk-myb-1 /# route add -inet 192.168.1.1/32 -inet6 fe80::2c8f:916:ed09:eae1%wg.uk-aai-1
-
ivy
add net 192.168.1.1: gateway fe80::2c8f:916:ed09:eae1%wg.uk-aai-1 fib 0
-
ivy
[4!] uk-myb-1 /# ping 192.168.1.1
-
ivy
PING 192.168.1.1 (192.168.1.1): 56 data bytes
-
ivy
[1!] uk-myb-1 /# tcpdump -ni wg.uk-aai-1 host 192.168.1.1
-
ivy
tcpdump: verbose output suppressed, use -v[v]... for full protocol decode
-
ivy
listening on wg.uk-aai-1, link-type NULL (BSD loopback), snapshot length 262144 bytes
-
ivy
17:39:51.238732 IP 81.187.47.201 > 192.168.1.1: ICMP echo request, id 58121, seq 0, length 64
-
ivy
that seems to be working
-
kevans
there, got the test to work
-
kevans
don't ask me how, but it does what I want it to and demonstrates the error but works after
-
kevans
-
mzar
that's probably another bug: link-local address not working over wg(4) interface
-
mzar
err - wrong window
-
rtprio
but wg interfaces aren't really local, are they
-
mzar
yep
-
mzar
so ND resolution is rather not supposed to work here
-
mzar
anyway, the PR 284857 describes the problem with IPv4 routes with IPv6 next hops over wg intefrace, and proposed solution fixes this issue
-
ivy
mzar: link local addresses work fine over wg(4) though?
-
ivy
i have like 20 bgp/ospf peers over link local addresses on wg(4)
-
ivy
bird> show ospf neigh lf6
-
ivy
lf6:
-
ivy
Router ID Pri State DTime Interface Router IP
-
ivy
10.1.2.2 1 Full/PtP 35.866 wg.uk-myb-2 fe80::340c:19c6:1b3b:730b
-
ivy
81.187.47.194 1 Full/PtP 34.618 wg.uk-aai-1 fe80::2c8f:916:ed09:eae1
-
mzar
nice, so it's not broken
-
ivy
there's no NS/ND since wg(4) is a PtP interface that pretends not to be in a way i find unhelpful
-
ivy
but that's how wireguard works, i don't think freebsd can fix that
-
mzar
ivy: I have responed to your PR, since I have spent some time testing this issue, there is no any race with kevans's approach, just to confirm that it was broken
-
ivy
mzar: i saw your patch, i have no opinion on whether that or kevans' is preferable
-
ivy
huh what? pkg-static: krb5-1.21.3 conflicts with krb5-libs-1.21.3 (installs files into the same place). Problematic file: /usr/local/bin/compile_et
-
ivy
oh never mind, i know what's going on
-
ivy
well, sort of -- i'm not sure why jellyfin depends on krb5... i don't remember it supporting Kerberos authentication
-
dvl
I have one lingering problem with pf: the rules won't load on boot.
bsd.network/web/@dvl/114082898655646261
-
ivy
dvl: what's the point of a bogons table?
-
dvl
ivy: Blocking networks which have addresses which are not assigned to anyone.
-
ivy
dvl: sure, but why?
-
dvl
ivy: ... because I can...?
-
dvl
Or perhaps I can.
-
ivy
but you can't :-P
-
dvl
if pf cooperates
-
ivy
i mean your question is valid, i'm just not sure this is a useful thing to do...
-
dvl
Not at boot, yet. This must be a solved problem.
-
dvl
FWIW, it is commonly done on appliances
-
ivy
less nowadays, i feel
-
ivy
it's not like the 90s when everyone took a bogons feed from team cymru
-
dvl
Ironically, that's the one I'm using.
-
ivy
yeah, i looked at doing that too but i couldn't see any benefit
-
ivy
*maybe* for a transit ISP, to avoid wasted bandwidth if nothing else
-
ivy
but for an end system? i don't think you gain anything
-
ivy
why is security@ discussing Bible passages?
-
mzar
dvl: what does "pfctl -sm" show ? have you tried to increase the limit ? how many addresses do you have ?
-
dvl
mzar:
dpaste.org/VgJOM - I have not tried increasing the limit, mainly because it works after boot.
-
fonks
ivy: looks like a troll or maybe misdirected mail? seems like it's in reply to something but the thread it's in doesn't seem to match where they replied
-
ivy
-
fonks
no, I found it. They seem to have been set off by something in someone's signature.
-
ivy
-
mzar
dvl: it could be problem with: 1. table too small 2. pf cannot parse so large file (too many entries to be added at once)
-
mzar
if the table is too small, try to increase its size
-
dvl
mzar: I wonder why it fails at boot time. Let's see what I have now:
-
mzar
if there is a problem with processing large file, please split it
-
mzar
at boot time ?
-
mzar
PF i loaded later
-
mzar
s/i/is
-
dvl
mzar: The problem occurs when booting the host.
-
dvl
mzar: After it boots, I ssh in, run `pfctl -f /etc/pf.conf`, done.
-
mzar
ha..
-
dvl
mzar: I say boot, I mean during system startup.
-
mzar
anyway, you are close to this value, maybe it's worth increasing this limit ?
-
dvl
mzar: Agreed. I'll paste what I did.
-
dvl
-
» gman999 waves to dvl
-
dvl
Next goal, reboot.
-
dvl
mr gman999
-
dvl
gman999: I thought about you one cold morning... it reminded me of you saying it was pretty safe in the neigborhood when it was real cold, not so much when it was real hot.
-
gman999
:)
-
gman999
unlikely i'l be at bsdcan this year
-
gman999
unfortunately
-
fonks
now there's a product: bsd in a can
-
gman999
located in a small cold city with good kebab
-
dvl
gman999: I will probably be there.
-
gman999
good.
-
gman999
patrick will be my proxy... as always
-
gman999
sends a flurry of 'hellos' when at a con
-
jbo
all we need to make that happen is FreeBSD running on a 2013 Mac Pro
-
dvl
gman999: You'll remember the year I won a NetGate appliance, 10 years ago... that unit will be up for auction this year. I am retiring it.
-
gman999
ha
-
gman999
yes... long time ago
-
jbo
oh BSDcan is in the USA
-
dvl
jbo: You are mistaken.
-
gman999
ha..
-
jbo
dvl, I think trump disagrees
-
gman999
i'll give ottawa the kebab point.
-
gman999
well, and other things
-
gman999
another nycbsdcon will be difficult in the near future...
-
gman999
we have to see at some point.
-
gman999
i dont have the time...
-
gman999
and we struggle to get speakers for regular meetings at this point.
-
gman999
we see though
-
dvl
gw reboot time /cc mzar
-
dvl
mzar: Still does not load on boot.
-
mzar
ha.. problem with parsing so large file, most likely
-
mzar
maybe you can split it into two and add some bogons later, as a workaround
-
gman999
wait you're parsing bogons for something dvl?
-
gman999
issue loading a bogon table or something?
-
dvl
gman999: yes, also tried moving the syctl into /boot/loader.conf, but nope.
bsd.network/web/@dvl/114082898655646261
-
dvl
mzar: on boot, 1 - empty the file, 2 - start pf, 3 - load up the file
-
mzar
I'd rather do it in diffent way
-
mzar
pfctl -t bogons -T add -f complete_set
-
mzar
and at boot try smaller set
-
mzar
adding this to rc.local will work, but after reloading PF someone has to fix it, either the sysadmin or cron
-
mzar
anyway, duct tape fix
-
dvl
mzar: a cron job for @reboot
-
mzar
it's worth filling a PR though
-
dvl
mzar: I don't want anything requiring manual steps
-
dvl
mzar: OK, I shall.
-
mzar
in the past I tried to fix similiar problem using anchors and loading these anchor from files, but it didn't help much and only made things more complex
-
dvl
-
zi
dvl: have you tried setting the pf table sizes via loader.conf? sysctl.conf stuff is loaded much much later
-
dvl
zi: How do I set pf tables sizes in loader.conf?
-
zi
vi /boot/loader.conf
-
zi
shove sysctl.conf lines into file
-
zi
^C:wq
-
zi
shutdown -r now PRAISE ZI
-
zi
something to that effect
-
dvl
First, I need to find the sysctl items. I have tried net.pf.request_maxcount=350000 in there, no fix.
-
zi
net.pf.states_hashsize
-
zi
Size of hash tables that store states. Should be power of 2.
-
zi
Default value is 131072.
-
zi
net.pf.source_nodes_hashsize
-
zi
Size of hash table that store source nodes. Should be power of
-
zi
2. Default value is 32768.
-
dvl
here we go again!
-
zi
may the odds be ever in your favor
-
dvl
zi: added the entries, rebooted, values are not changed.
-
dvl
zi: this is how we do it...
dpaste.org/HyXLS
-
zi
what do you mean that they were not changed?
-
zi
are you loading pf @ boot as well?
-
dvl
[19:59 gw01 dvl ~] % sysctl net.pf.states_hashsize net.pf.source_nodes_hashsize
-
dvl
net.pf.states_hashsize: 131072
-
dvl
net.pf.source_nodes_hashsize: 32768
-
zi
if the module isnt there, you cant set settings from within the module
-
dvl
oooooo
-
» zi taps forehead
-
dvl
Never done that before~
-
zi
pf_load="YES"
-
dvl
and again
-
zi
hope you are getting your card punched each time
-
zi
you'll be in the frequent rebooters hall of fame in no time
-
dvl
indeed
-
dvl
zi: see anything wrong in my config?
dpaste.org/zjJ5s
-
zi
can you share the output of the 2 sysctls you are changing (sysctl xx)
-
zi
and then grep -r net.pf /etc/sysc*
-
zi
and grep set /etc/pf.conf*
-
dvl
[20:10 gw01 dvl ~] % sysctl net.pf.states_hashsize net.pf.source_nodes_hashsize
-
dvl
net.pf.states_hashsize: 131072
-
dvl
net.pf.source_nodes_hashsize: 32768
-
dvl
[20:22 gw01 dvl ~] % grep -r net.pf /etc/sysc*
-
dvl
/etc/sysctl.conf.local:net.pf.request_maxcount=550000
-
dvl
[20:23 gw01 dvl ~] % grep set /etc/pf.conf
-
dvl
set limit { states 200000, src-nodes 100000, frags 200000, table-entries 350000 }
-
dvl
set block-policy return
-
dvl
set loginterface $ext_if
-
dvl
set skip on lo0
-
dvl
and no dpaste for me.
-
zi
% grep pf loader.conf
-
zi
net.pf.source_nodes_hashsize="1048576"
-
zi
% sysctl net.pf.source_nodes_hashsize
-
zi
net.pf.source_nodes_hashsize: 1048576
-
angry_vincent
it looks like if you have /usr/obj on tmpfs, WITH_META_MODE=yes is not respected. Of course, if you try consecutive rebuilds ( without reboot, because /usr/obj gets cleared ). Is this expected behavior?
-
dvl
quotes
-
zi
you must quote it
-
zi
quote it good
-
dvl
can't reboot right now... $WORK
-
zi
hah
-
zi
keep your punchcard handy
-
mzar
dvl: maybe adding PF to kernel will help to fix this problem
-
dvl
mzar: and go away from RELEASE ...?! o.O ;)
-
mzar
I am sorry, wrong advice, let me apologize, I am not much using RELEASEs
-
dvl
mzar: No apology necessary, it is a valid suggestion, and my reply was joking.
-
dvl
bye
-
dvl
zi: no workie. I find edge cases.
-
zi
must be doing something funky here
-
zi
those settings def work, at least on this 13.4-R box
-
dvl
I do find edge cases.
-
rtprio
i love edge cases
-
dvl
Interesting, if I empty the large file, reboot, still does not load the rules. I suspect something else is blocking this. I'm going to visit the console in the basement. SOmetime....
-
zi
maybe fire up a VM to test the loader bits in isolation
-
dvl
zi: You'll remember the old console server.... I scrolled back, found the pf errors stopping the load. Well, I got the rules to load by fixing the hostnames, vs IP addresses, which crept into my pf macros. I also emptied the table file. I'm going to load that back up and try again. Still default values for net.pf.states_hashsize & net.pf.source_nodes_hashsize
-
zi
maybe restore pf.conf to defaults/no tables and just get the loader knobs applying correctly, then start reintroducing stuff
-
zi
and/or move this into a vm for testing so you arent bonking (what im assuming is) your nat gateway
-
dvl
Yeah, it's my nat gateway.
-
dvl
zi: I have solved the major problem of the rules not loading on reboot.
-
dvl
I am not able to get net.pf.states_hashsize set away from default. Yet that is not stopping the table from loading.
-
zi
rgr
-
dvl
I've closed my PR and apologized.
-
dvl
zi: Thanks for helping. Sorry for the noise.
-
dvl
mzar: you as well, thanks. :) Fixed.
-
zi
nw
-
mzar
thank you for giving the opportunity to help with this troubleshooting dvl !
-
dvl
no worries. always happy to share the grief.
-
mzar
lol
-
jbo
are we sharing grief? I'm here.
-
kevans
jbo: I kind of think the answer is that the -newlib port needs to go away
-
jbo
kevans so we are indeed sharing grief then :<
-
kevans
I think life would be better if the -gcc port instead fetched newlib and built it, then libstdc++, and distributed both (maybe later in subpackages)
-
kevans
I don't think it realistically adds much to the build time of a gcc
-
jbo
kevans, is -gcc fetching and building newlib even an option? that sounds like a lot of hassle.
-
jbo
I wouldn't be worried about build time either. I'm more worried about the complexity.
-
kevans
well it's not technically hard to do in ports
-
jbo
kevans, are you going to do it then? <3
-
jbo
it would save me so much hassle every day...
-
kevans
my main concern would be how it current builds, and whether we'd need to swap in our own do-build to drive it all manually
-
jbo
kevans, just out of interest - why do you think that this is the solution vs. just having a -newlib port? Is the problem that the -newlib port would need to be built by the particular -gcc port?
-
kevans
it's mainly that, afaict, a -libstdc++ port would largely be duplicating a -gcc port
-
kevans
because it's distributed with gcc, same build system, need same options, etc
-
jbo
I see
-
jbo
how complex do you think this whole operation would be?
-
kevans
probably not too bad
-
jbo
thank god it's weekend now? :')
-
kevans
well, there's a complication there
-
kevans
it's going to be above 0*C this weekend and relatively nice outsside <_<
-
jbo
hah
-
jbo
well, I hope you can enjoy that :)